本文整理汇总了PHP中PDF::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::SetFillColor方法的具体用法?PHP PDF::SetFillColor怎么用?PHP PDF::SetFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF
的用法示例。
在下文中一共展示了PDF::SetFillColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listadoAction
public function listadoAction($aditionalFilter = '')
{
$pdf = new PDF("P", 'mm', "A4");
$pdf->SetTopMargin(15);
$pdf->SetLeftMargin(10);
$pdf->AliasNbPages();
$pdf->SetFillColor(210);
$per = new Permisos();
$em = new EntityManager($per->getConectionName());
$query = "select t1.IdPerfil,t1.Permisos,t4.Perfil,t2.Titulo as Opcion,t3.Titulo as SubOpcion\n from AgtPermisos as t1,menu as t2, submenu as t3, perfiles as t4\n where t1.IDOpcion=t2.IDOpcion\n and t1.IDOpcion=t3.IDOpcion\n and t3.Id=t1.IDSubOpcion\n and t1.IdPerfil=t4.Id\n order by t1.IdPerfil,t1.IDOpcion,t1.IDSubOpcion;";
$em->query($query);
$rows = $em->fetchResult();
$em->desConecta();
unset($per);
$perant = "";
$opcant = "";
foreach ($rows as $row) {
if ($perant != $row['IDPerfil']) {
$pdf->AddPage();
$pdf->Cell(40, 5, $row['Perfil'], 0, 0, "L", 1);
} else {
$pdf->Cell(40, 5, "", 0, 0, "L", 0);
}
$pdf->SetFillColor(240);
if ($opcant != $row['Opcion']) {
$pdf->Cell(30, 5, $row['Opcion'], 0, 0, "L", 1);
} else {
$pdf->Cell(30, 5, "", 0, 0, "L", 0);
}
$perant = $row['IDPerfil'];
$opcant = $row['Opcion'];
$pdf->Cell(40, 5, $row['SubOpcion'], 0, 0, "L", 0);
$permisos = array('C' => substr($row['Permisos'], 0, 1), 'I' => substr($row['Permisos'], 1, 1), 'B' => substr($row['Permisos'], 2, 1), 'A' => substr($row['Permisos'], 3, 1), 'L' => substr($row['Permisos'], 4, 1), 'E' => substr($row['Permisos'], 5, 1));
$pdf->Cell(13, 5, $permisos['C'], 0, 0, "C", 0);
$pdf->Cell(13, 5, $permisos['I'], 0, 0, "C", 1);
$pdf->Cell(13, 5, $permisos['B'], 0, 0, "C", 0);
$pdf->Cell(13, 5, $permisos['A'], 0, 0, "C", 1);
$pdf->Cell(13, 5, $permisos['L'], 0, 0, "C", 0);
$pdf->Cell(13, 5, $permisos['E'], 0, 1, "C", 1);
$pdf->SetFillColor(210);
}
$archivo = "docs/docs" . $_SESSION['emp'] . "/pdfs/" . md5(date('d-m-Y H:i:s')) . ".pdf";
$pdf->Output($archivo, 'F');
$this->values['archivo'] = $archivo;
return array('template' => '_global/listadoPdf.html.twig', 'values' => $this->values);
}
示例2: PDF
$this->SetY(-10);
$this->SetX(5);
$this->SetFont('helvetica', 'I', 5);
$this->Cell(48, 5, utf8_decode("Fecha Impresión " . Date::today()), 0, 0, 'L');
$this->Cell(48, 5, utf8_decode('Página') . $this->PageNo() . '/{nb}', 0, 0, 'R');
}
}
$pdf = new PDF('P', 'mm', array(105, 148));
$pdf->AliasNbPages();
for ($i = 0; $i < 2; $i++) {
$pdf->AddPage();
$pdf->Rect(10, 10, 85, 128);
$pdf->Line(10, 20, 95, 20);
$pdf->Line(10, 30, 95, 30);
$pdf->SetFont('helvetica', 'B', 7);
$pdf->SetFillColor(120, 120, 120);
$pdf->SetTextColor(255, 255, 255);
$pdf->SetX(10);
$pdf->SetY(10);
$pdf->Cell(85, 10, utf8_decode($this->planillaDataDet[0]['id_personal'] . " - " . $this->planillaDataDet[0]['nombre_personal']), 1, 0, 'C', true);
$pdf->Ln(13);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(15, 5, utf8_decode('BOLETA INFORMATIVA DETALLE'), 0, 0, 'L');
$pdf->Ln(10);
$pdf->Cell(65, 5, utf8_decode('Básico ' . $this->planillaDataDet[0]['nom_planilla'] . ' ( ' . $this->planillaDataDet[0]['periodo'] . ' )'), 0, 0, 'L');
$pdf->Cell(20, 5, utf8_decode($this->planillaDataDet[0]['neto_total'] + $this->planillaDataDet[0]['monto_asig_familiar'] + $this->planillaDataDet[0]['otros_descuentos']), 0, 0, 'R');
$pdf->Ln(5);
$pdf->Cell(15, 5, utf8_decode('DESCUENTOS'), 0, 0, 'L');
$pdf->Ln(5);
foreach ($this->planillaDataDesc as $b) {
$pdf->Cell(65, 5, utf8_decode($b['nom_descuento'] . " - " . $b['detalle_descuento']), 0, 0, 'L');
示例3: PDF
$this->Cell(0, 3, 'Emitido por: ' . $usuarioNome);
}
}
//Instancia a classe gerador de pdf
$pdf = new PDF();
//Define os atributos de propriedade do arquivo PDF
$pdf->SetCreator('work | eventos');
$pdf->SetAuthor($usuarioNome . " - " . $empresaNome);
$pdf->SetTitle('Relação de Momentos de Repertório');
$pdf->SetSubject('Relatório gerado automaticamente pelo sistema');
$pdf->AliasNbPages();
$pdf->AddPage();
//Títulos das colunas
$pdf->SetFont('Arial', 'B', 10);
//Define a cor RGB do fundo da celula
$pdf->SetFillColor(178, 178, 178);
//Faz a célula ser preenchida. Isso é feito setando 1 após a expressao de alinhamento
$pdf->Cell(0, 6, 'Descrição do Momento de Repertório', 1, 0, 'L', 1);
$pdf->SetX(170);
$pdf->Cell(0, 6, 'Ativo');
//Monta as linhas com os dados da query
$pdf->SetFont('Arial', '', 10);
while ($dados = mysql_fetch_array($sql)) {
switch ($dados[ativo]) {
case 0:
$ativo = "Inativo";
break;
case 1:
$ativo = "Ativo";
break;
}
示例4: while
$pdf->SetFont('Arial', 'B', 9);
$pdf->SetX(5);
$pdf->SetFont('Amble-Regular', '', 9);
$total = 0;
$sub = 0;
$repetido = 0;
$contador = 0;
$consulta = pg_query("select id_cliente,identificacion,nombres_cli,telefono,direccion_cli from clientes");
while ($row = pg_fetch_row($consulta)) {
$repetido = 0;
$total = 0;
$sql1 = pg_query("select id_factura_venta,num_factura,num_autorizacion,fecha_autorizacion,fecha_caducidad FROM factura_venta where id_cliente='{$row['0']}' and estado='Activo' and fecha_caducidad between '{$fecha}' and '{$_GET['fin']}'");
if (pg_num_rows($sql1)) {
if ($repetido == 0) {
$pdf->SetX(1);
$pdf->SetFillColor(221, 221, 221);
$pdf->Cell(80, 6, utf8_decode('RUC/CI: ' . $row[1]), 1, 0, 'L', 1);
$pdf->Cell(125, 6, utf8_decode('NOMBRE: ' . $row[2]), 1, 1, 'L', 1);
$pdf->SetX(1);
$pdf->Cell(80, 6, utf8_decode('TELF.: ' . $row[3]), 1, 0, 'L', 1);
$pdf->Cell(125, 6, utf8_decode('DIRECCIÓN: ' . $row[4]), 1, 1, 'L', 1);
$pdf->Ln(2);
$pdf->SetX(1);
$pdf->Cell(40, 6, utf8_decode("Nro Factura"), 1, 0, 'C', 0);
$pdf->Cell(35, 6, utf8_decode("Tipo Documento"), 1, 0, 'C', 0);
$pdf->Cell(50, 6, utf8_decode("Nro. Autorización"), 1, 0, 'C', 0);
$pdf->Cell(40, 6, utf8_decode("Fecha Autorización"), 1, 0, 'C', 0);
$pdf->Cell(40, 6, utf8_decode("Fecha caducidad"), 1, 1, 'C', 0);
$repetido = 1;
}
while ($row1 = pg_fetch_row($sql1)) {
示例5: PDF
<?php
define('FPDF_FONTPATH', 'font/');
require_once 'mysql_table.php';
include "comunes.php";
include "../conectar.php";
$pdf = new PDF();
$pdf->Open();
$pdf->AddPage();
//Nombre del Listado
$pdf->SetFillColor(255, 255, 255);
$pdf->SetFont('Arial', 'B', 16);
$pdf->SetY(40);
$pdf->SetX(0);
$pdf->MultiCell(290, 6, "Listado de Cobradores", 0, C, 0);
$pdf->Ln();
//Restauracin de colores y fuentes
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetFont('Arial', 'B', 7);
//Buscamos y listamos las familias
$nombreentidad = $_POST["nombrecobrador"];
$codentidad = $_POST["codcobrador"];
$where = "1=1";
if ($codcobrador != "") {
$where .= " AND codcobrador='{$codcobrador}'";
}
if ($nombrecobrador != "") {
$where .= " AND nombrecobrador like '%" . $nombrecobrador . "%'";
}
$where2 .= " ORDER BY nombrecobrador ASC";
示例6:
}
$termin_length = $termin_length * 5;
//echo '<br>Termin: '.$termine[$t]->typ.' GetY: '.$pdf->GetY().' Page: '.$page_length.' TerminL: '.$termin_length;
if ($pdf->GetY() > $page_length - $termin_length or $tt == 0) {
$tt = 0;
$pdf->AddPage();
$pdf->SetFont('Times', '', $date_font);
$pdf->Cell(10, 3, ' ', 0, 0);
$pdf->Cell(175, 3, utf8_decode(JText::_('WRITTEN')) . ' ' . utf8_decode(JText::_('ON_DAY')) . ' ' . utf8_decode(JHTML::_('date', $now, JText::_('DATE_FORMAT_CLM_PDF'))), 0, 1, 'R');
$pdf->SetFont('Times', '', $head_font);
$pdf->Cell(10, 10, ' ', 0, 0);
$pdf->Cell(150, 10, utf8_decode(JText::_('TERMINE_HEAD')), 0, 1, 'L');
}
$pdf->SetFont('Times', '', $font);
$pdf->SetTextColor(0);
$pdf->SetFillColor(255);
// Monatsberechnungen
if ($t1 == 1 or $datum_arr[$t][1] > $datum_arr[$t - 1][1] or $datum_arr[$t][0] > $datum_arr[$t - 1][0]) {
// Jahresberechnungen
if ($t1 == 1 or $datum_arr[$t][0] > $datum_arr[$t - 1][0]) {
$tt++;
$pdf->SetTextColor(255);
$pdf->SetFillColor(90);
$pdf->Cell($br00, $zelle, " ", 0, 0, 'C');
$pdf->Cell($br99, $zelle, $datum_arr[$t][0], 1, 1, 'C', 1);
}
$tt++;
$pdf->SetTextColor(0);
$pdf->SetFillColor(240);
$pdf->Cell($br00, $zelle, " ", 0, 0, 'C');
$pdf->Cell($br99, $zelle, utf8_decode($arrMonth[date('F', $monatsausgabe)]), 1, 1, 'L', 1);
示例7: substr
$codigo_prod = $row[10];
$descripcion = $row[12];
$precio_venta = $row[4];
}
$sql = pg_query("select * from factura_compra,proveedores where factura_compra.id_proveedor=proveedores.id_proveedor and id_factura_compra='{$id_factura_compra}'");
while ($row = pg_fetch_row($sql)) {
$ci_proveedor = $row[23];
$proveedor = $row[24];
$fecha_compra = $row[5];
$num_fac_compra = $row[11];
}
$sql = pg_query("select * from detalle_factura_compra,productos where detalle_factura_compra.cod_productos=productos.cod_productos and id_factura_compra='{$id_factura_compra}' and productos.cod_productos='{$id_producto}'");
while ($row = pg_fetch_row($sql)) {
$precio_compra = $row[4];
}
$pdf->SetFillColor(216, 216, 231);
$pdf->Cell(100, 8, utf8_decode("RUC/CI:: " . $ci_cliente), 1, 0, 'L', true);
$pdf->Cell(105, 8, utf8_decode("CLIENTE: " . $nombre_cliente), 1, 1, 'L', true);
$pdf->Ln(2);
$pdf->SetX(1);
$pdf->Cell(30, 6, utf8_decode('Nro. Factura'), 1, 0, 'C', 0);
$pdf->Cell(25, 6, utf8_decode('F. Venta'), 1, 0, 'C', 0);
$pdf->Cell(20, 6, utf8_decode('P. Venta'), 1, 0, 'C', 0);
$pdf->Cell(40, 6, utf8_decode('Producto'), 1, 0, 'C', 0);
$pdf->Cell(20, 6, utf8_decode('N. Compra'), 1, 0, 'C', 0);
$pdf->Cell(20, 6, utf8_decode('F. Compra'), 1, 0, 'C', 0);
$pdf->Cell(30, 6, utf8_decode('Proveedor'), 1, 0, 'C', 0);
$pdf->Cell(20, 6, utf8_decode('P. Compra'), 1, 1, 'C', 0);
$pdf->SetX(1);
$pdf->Cell(30, 6, substr($num_fac_venta, 8, 30), 0, 0, 'C', 0);
$pdf->Cell(25, 6, $fecha_venta, 0, 0, 'C', 0);
示例8: array
global $title;
$title = $result[0]['titel'];
//Make PDF
$result = $db->selectWordsFromId($liste);
//Alle Wörter zu einer Liste hinzufügen
$woerter = $translations = array();
foreach ($result as $paar) {
array_push($woerter, html_entity_decode($paar['wort']));
array_push($translations, html_entity_decode($paar['translation']));
}
$db->closeConnection();
//Ab hier auch wieder angepasst.
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFillColor(150);
//Wörter in PDF einfüllen
for ($i = 0; $i < count($woerter); $i++) {
$filler = ($i + 1) % 2;
//Fett:
$pdf->SetFont('Times', 'B', 12);
$pdf->Cell(95, 10, $woerter[$i], 0, 0, '', $filler);
//Nicht Fett
$pdf->SetFont('Times', '', 12);
$pdf->Cell(95, 10, $translations[$i], 0, 1, '', $filler);
}
$pdf->Output("{$title}.pdf", "I");
} else {
header("Location: ../index.php?site=login&error=0");
exit;
}
示例9: Footer
}
//Pie de página
function Footer()
{
$this->SetY(-10);
$this->SetFont('Arial', 'I', 8);
$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/ Comeat / Fecha: ' . date('d/m/Y'), 0, 0, 'C');
}
}
//Creación del objeto de la clase heredada
$fpdf = new PDF('L');
//P Es vertical, L es Horizontal.
$fpdf->AddPage();
$fpdf->SetFont('Arial', '', 11);
//Se finalizan los titulos. Se agrega un "Enter y cambiamos letra"
$fpdf->SetFillColor(255, 190, 119);
$color = 0;
//Inicializamos el foreach que imprimirá todo:
while ($row = mysql_fetch_array($result)) {
//Calculo del total del menú
$imprimirColor = false;
if ($color % 2 == 0) {
$imprimirColor = false;
} else {
$imprimirColor = true;
}
$valor = $row['PRECIO'];
$descuento = $row['OFERTA'];
$incognita = $descuento * $valor / 100;
$total = $valor - $incognita;
//Espacio para centrar
示例10: explode
$px = $px + 3;
$pdf->RotatedText($px, $py + 3, utf8_decode($couch[0]['libelle_them']), $angle);
} else {
$py = $py + 3;
$pdf->RotatedText($px, $py, utf8_decode($couch[0]['libelle_them']), $angle);
}
$idprov = $id;
if ($vision == "pay") {
$px = $px + 2;
} else {
$py = $py + 2;
}
}
$coul = explode(",", $couleu);
$pdf->SetAlpha($apocit);
$pdf->SetFillColor($coul[0], $coul[1], $coul[2]);
$pdf->Rect($px, $py, $rect, $rect, F);
$pdf->SetAlpha(1);
$pdf->Rect($px, $py, $rect, $rect, D);
//$pdf->Text(8,$pyy,$legend);
if ($vision == "pay") {
$pdf->RotatedText($px + 3, $py - 2, utf8_decode($legend), $angle);
} else {
$pdf->RotatedText($px + 5, $py + 3, utf8_decode($legend), $angle);
}
//$pyy=$pyy+3;
if ($vision == "pay") {
$px = $px + 5;
} else {
$py = $py + 5;
if ($_GET['format'] == 'A4' && $py > 280) {
示例11:
$qty = $rows[10];
$tax = $rows[11];
$total = $rows[12] + $tax;
$charge = $baseamt;
if ($qty != '' and $qty > 0) {
$charge = $baseamt * $qty;
} else {
$qty = 0;
}
$Address = 'Address';
$EffDate = $rows[6];
$Line1 = "Monthly Charges as on " . $EffDate;
$Line2 = "Tax applied @ 10% ";
$Line3 = "Total Charges ";
if ($i == 0) {
$pdf->SetFillColor(240, 100, 100);
$pdf->SetFont('Times', 'B', 12);
$pdf->Cell(0, 0.25, "Bill for the month " . $EffDate, 1, 2, "C", 1);
$pdf->SetFillColor(240, 100, 100);
$pdf->SetFont('Times', 'B', 12);
$pdf->Cell(0, 0.25, "Customer Details", 1, 2, "C", 1);
$pdf->SetFont('Times', '', 12);
$pdf->Cell(0, 0.2, $AccName, 1, 0, 'L');
$pdf->Cell(0, 0.2, $accname, 1, 1, 'R');
$pdf->Cell(0, 0.2, $Address, 1, 0, 'L');
//$pdf->Cell(0, 0.20, $address, 1, 1, 'R');
$pdf->Cell(0, 0.2, $addline1, 1, 1, 'R');
$pdf->Cell(0, 0.2, $addline2, 1, 1, 'R');
$pdf->Cell(0, 0.2, $addline3, 1, 1, 'R');
$pdf->Cell(0, 0.2, $addline4, 1, 1, 'R');
$pdf->Cell(0, 0.2, $addline5, 1, 1, 'R');
示例12: iconv
##-- วันที่ วัน เดือน ปี
if (!empty($b) && !empty($e)) {
//$pdf->MultiCell( 0 , 0 , iconv( 'UTF-8','cp874' , 'ระหว่างวันที่ '.$b.' ถึง '.$e )); ## formate date in table is yyyy-mm-ddd
$pdf->MultiCell(0, 0, iconv('UTF-8', 'cp874', 'ระหว่างวันที่ ' . $pdf->date_thai_format($b) . ' ถึง ' . $pdf->date_thai_format($e)));
## formate date in table is yyyy-mm-ddd
// ค่าที่ส่งมา 1-10-2557
// $str_query="SELECT * FROM ESN.`04-monitoring`where `MonitoringDate` between '1467-05-04' and '1990-1-1' ; ";
// date_eng_format($begin)
}
##--หัวตาราง
$pdf->setXY($x_absolute, $y_absolute + $r * 3.5);
$pdf->SetFont('angsana', '', 16);
$pdf->MultiCell(0, 0, iconv('UTF-8', 'cp874', 'ตารางที่ 3 รายละเอียดผลลัพธ์ของการจัดการปัญหาที่เกี่ยวข้องกับการใช้ยาโดยเภสัชกร'));
$pdf->setXY($x_absolute, $y_absolute + $r * 4);
$pdf->SetFont('angsana', 'B', 14);
$pdf->SetFillColor(200, 200, 200, 200);
//$pdf->Cell( 30 , 7 , iconv( 'UTF-8','cp874' , 'ประเภทปัญหาที่เกี่ยวข้องกับการใช้ยา' ) , 1 , 0 , 'C' , true );
$pdf->Cell(30, 7, iconv('UTF-8', 'cp874', 'ประเภทปัญหาที่'), LRT, 0, 'C', true);
$pdf->Cell(50, 7, iconv('UTF-8', 'cp874', 'บทบาทเภสัชกรในการจัดการปัญหา'), LRT, 0, 'C', true);
//$pdf->Cell( 35 , 7 , iconv( 'UTF-8','cp874' , 'จำนวนปัญหาที่จัดการ' ) , 1 , 1 , 'C' , true );
$pdf->Cell(20, 7, iconv('UTF-8', 'cp874', 'จำนวนปัญหา'), LRT, 0, 'C', true);
$pdf->Cell(60, 7, iconv('UTF-8', 'cp874', 'ผลลัพธ์ของการจัดการปัญหา'), LRT, 1, 'C', true);
$pdf->SetFillColor(200, 200, 200, 200);
//$pdf->Cell( 35 , 7 , iconv( 'UTF-8','cp874' , '' ),LR, 0 ,C,true );
$pdf->Cell(30, 7, iconv('UTF-8', 'cp874', 'เกี่ยวข้องกับการใช้ยา'), LRB, 0, 'C', true);
$pdf->Cell(50, 7, iconv('UTF-8', 'cp874', ''), LRB, 0, 'C', true);
$pdf->Cell(20, 7, iconv('UTF-8', 'cp874', 'ที่จัดการ'), LRB, 0, 'C', true);
$pdf->Cell(15, 7, iconv('UTF-8', 'cp874', 'Resdved'), TLRB, 0, 'C', true);
$pdf->Cell(15, 7, iconv('UTF-8', 'cp874', 'Improved'), TLRB, 0, 'C', true);
$pdf->Cell(20, 7, iconv('UTF-8', 'cp874', 'NotImproved'), TLRB, 0, 'C', true);
$pdf->Cell(10, 7, iconv('UTF-8', 'cp874', 'N/A'), TLRB, 1, 'C', true);
示例13: echoResponse
$response['message'] = 'No hay datos';
}
echoResponse(200, $response);
});
// Imprime - retorna un pdf con todas las preguntas respondidas que se le soliciten en la lista indicada
$app->post('/printPreguntas', 'sessionAlive', function () use($app) {
// Reporte
$pdf = new PDF('L', 'mm', 'Letter');
$pdf->Open();
$pdf->AddPage();
$pdf->SetMargins(5, 3, 5);
// margen, left, top y right
//$pdf->Ln(03);
//$pdf->SetWidths(array(65, 60, 55, 50, 20));
$pdf->SetFont('Arial', 'B', 8);
$pdf->SetFillColor(85, 107, 47);
$pdf->SetTextColor(0);
$pdf->ln();
//
$response = array();
$lisPreguntas = json_decode($app->request->getBody());
$idUser = intval($_SESSION['uid']);
$lista = implode(",", $lisPreguntas);
$db = new DbHandler();
$impresas = $db->get1Record("select fn_num_respuesta_print( '{$lista}' ) as cantidad");
//var_dump($impresas);
if ($impresas['cantidad'] == 0) {
// genera las respuestas en el documento PDF
// $target_dir = $_SERVER['DOCUMENT_ROOT'] . "/server/uploaded_files/";
// registra el nuevo lote de preguntas impresas
// insert into pyr_respuesta_print ( id, fecha, id_usuario ) values ( now(), now(), 12 );
示例14: PDF
}
}
$pdf = new PDF();
/*Se define las propiedades de la página */
$pdf->AliasNbPages();
$pdf->AddPage();
/* Se añade una nueva página */
$pdf->SetFont('Arial', 'B', 10);
/* Se define el tipo de fuente: Arial en negrita de ta */
$cons1 = mysql_query("SELECT * FROM cliente order by id_cliente", $conexion);
$lk = 0;
$pdf->SetFont('Arial', '', 9);
//Títulos de las columnas
$header = array('Nº', 'Login', 'Nombre', 'Apellido', 'Teléfono', 'Direcciòn');
//Colores, ancho de línea y fuente en negrita
$pdf->SetFillColor(255, 0, 0);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(128, 128, 128);
$pdf->SetLineWidth(0.3);
$pdf->SetFont('', 'B');
//Cabecera
$w = array(10, 25, 40, 37, 37, 37);
for ($i = 0; $i < count($header); $i++) {
$pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1);
}
$pdf->Ln();
//Restauración de colores y fuentes
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetFont('');
//Datos
示例15: price
/**
* Show total to pay
*
* @param PDF $pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Objet langs
* @return int Position pour suite
*/
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
$col1x = 120;
$col2x = 170;
if ($this->page_largeur < 210) {
$col2x -= 20;
}
$largcol2 = $this->page_largeur - $this->marge_droite - $col2x;
$useborder = 0;
$index = 0;
// Total HT
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$tvaisnull = !empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']) ? true : false;
if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) {
// Nothing to do
} else {
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
continue;
}
foreach ($localtax_rate as $tvakey => $tvaval) {
if ($tvakey != 0) {
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (" . $outputlangs->transnoentities("NonPercuRecuperable") . ")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code) . ' ';
$totalvat .= vatrate(abs($tvakey), 1) . $tvacompl;
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
}
}
}
//}
//Local tax 2 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
continue;
}
foreach ($localtax_rate as $tvakey => $tvaval) {
if ($tvakey != 0) {
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (" . $outputlangs->transnoentities("NonPercuRecuperable") . ")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code) . ' ';
$totalvat .= vatrate(abs($tvakey), 1) . $tvacompl;
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
}
}
}
//}
// VAT
foreach ($this->tva as $tvakey => $tvaval) {
if ($tvakey > 0) {
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
//.........这里部分代码省略.........