本文整理汇总了PHP中Pdf::Line方法的典型用法代码示例。如果您正苦于以下问题:PHP Pdf::Line方法的具体用法?PHP Pdf::Line怎么用?PHP Pdf::Line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pdf
的用法示例。
在下文中一共展示了Pdf::Line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdf
//.........这里部分代码省略.........
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
///////////////////////////////////////////////////FORMATO ENTREGA///////////////////////////////////////////////////
///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
$pdf->SetFont('helvetica', '', 10);
//Normal
$arriba = 6;
$izq = 10;
$der = 10;
$pdf->AddPage('L', 'LETTER');
$pdf->SetFont('pdfahelvetica', '', 10);
//Normal
//$pdf->SetFont('pdfahelveticai', '', 10); // S
$pdf->SetTextColor(0, 0, 0);
$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
$style2 = array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
$style3 = array('width' => 0.2, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(0, 0, 0));
$style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
$style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
$style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
$style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
# Marco
//$pdf->RoundedRect(5, 15-$arriba, 268, 200, 0, '1010', 'NULL');
$pdf->RoundedRect(12, 15 - $arriba, 120, 200, 0, '1000', 'NULL');
$pdf->RoundedRect(23 + 125, 15 - $arriba, 120, 200, 0, '1000', 'NULL');
# Linea encabezado
//$pdf->Line(15, 44, 264.4, 44, $style2);
# Linea media punteada
$pdf->Line(140, 5 - $arriba, 140, 210 + $arriba, $style3);
# Logos de Encabezado
$pdf->Image('resources/img/cdmx.png', 85 - $izq, 20 - $arriba, 50, 13, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
# Textos
$pdf->Text(60 - $izq, 10 - $arriba, 'Formato para Prepa Sí');
$pdf->SetFont('pdfahelveticab', '', 9);
// Negrita
$pdf->Text(35 - $izq, 40 - $arriba, 'Entrega – Recepción Documentos PREPA SÍ 2015-2016');
$pdf->SetFont('pdfahelvetica', '', 9);
// Normal
$pdf->SetLineStyle(array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
$pdf->RoundedRect(34 - $izq, 39 - $arriba, 87, 6, 3, '0000', 'NULL');
$pdf->Text(44 - $izq, 51 - $arriba, 'Fecha de registro electrónico: ___________________');
$pdf->Text(27 - $izq, 62 - $arriba, 'Nombre: ____________________________________________________');
$pdf->Text(27 - $izq, 72 - $arriba, '1.- Solicitud de');
$pdf->RoundedRect(126 - $izq, 72 - $arriba, 8, 5, 3, '0000', 'NULL');
$pdf->Text(27 - $izq, 80 - $arriba, '2.- Comprobante de domicilio, expedido dentro de los 3 meses');
$pdf->Text(33 - $izq, 84 - $arriba, 'anteriores al mes en el que se realice la entrega de los');
$pdf->Text(33 - $izq, 88 - $arriba, 'documentos (copia y original para cotejo):.....................................');
$pdf->RoundedRect(126 - $izq, 88 - $arriba, 8, 5, 3, '0000', 'NULL');
$pdf->Text(27 - $izq, 96 - $arriba, '3.- Comprobante de Inscripcion (vigente), sellado por tu');
$pdf->Text(32 - $izq, 100 - $arriba, ' institución educativa (copia y original para cotejo):........................');
$pdf->RoundedRect(126 - $izq, 100 - $arriba, 8, 5, 3, '0000', 'NULL');
$pdf->Text(27 - $izq, 108 - $arriba, '4.- Comprobante de calificaciones vigente y sellado');
$pdf->Text(32 - $izq, 112 - $arriba, '(copia y original para cotejo):...........................................................');
$pdf->RoundedRect(126 - $izq, 112 - $arriba, 8, 5, 3, '0000', 'NULL');
$pdf->Text(27 - $izq, 120 - $arriba, '5.- Identificación con fotografia (copia y original para cotejo):..............');
$pdf->RoundedRect(126 - $izq, 121 - $arriba, 8, 5, 3, '0000', 'NULL');
$pdf->Text(48 - $izq, 167 - $arriba, 'Fecha de recepción de expediente: ___________________');
$pdf->Text(115 - $izq, 171 - $arriba, 'día/mes/año');
$pdf->SetFont('pdfahelveticab', '', 8);
//Negrita
$pdf->Rect(25 - $izq, 161 + 15 - $arriba, 115, 16, 'DF', null, array(192, 192, 192));
示例2: index
//.........这里部分代码省略.........
$pdf->Cell(25, 5, ucfirst($data['name']), 0, 1, 'L', 0, '', 0);
$pdf->SetXY(30, 40);
$pdf->Cell(25, 5, $data['contact'], 0, 1, 'L', 0, '', 0);
$pdf->SetXY(30, 45);
//$pdf->Cell(25, 5, $data['address'], 0, 1, 'L', 0, '', 0);
$pdf->Cell(25, 5, '', 0, 1, 'L', 0, '', 0);
$pdf->writeHTMLCell($w = 80, $h = 0, $x = 15, $y = '', $data['address'], $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
//$pdf->SetXY(40, 50);
$style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
//$style = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
//$pdf->Line(5, 10, 80, 30, $style);
$pdf->SetFont('helvetica', '', 10);
$pdf->SetXY(131, 35);
$pdf->Cell(25, 5, 'Contact :', 0, 1, 'L', 0, '', 0);
$pdf->SetXY(131, 40);
$pdf->Cell(25, 5, 'Email :', 0, 1, 'L', 0, '', 0);
$pdf->SetXY(131, 45);
$pdf->Cell(25, 5, 'TIN :', 0, 1, 'L', 0, '', 0);
$pdf->SetXY(131, 50);
$pdf->Cell(25, 5, 'CST :', 0, 1, 'L', 0, '', 0);
$pdf->SetXY(131, 55);
$pdf->Cell(25, 5, 'Sales Person :', 0, 1, 'L', 0, '', 0);
$pdf->SetFont('helvetica', '', 10);
$pdf->SetXY(147, 35);
$pdf->Cell(25, 5, $data['retailcontact'], 0, 1, 'L', 0, '', 0);
$pdf->SetXY(143, 40);
$pdf->Cell(25, 5, $data['maildid'], 0, 1, 'L', 0, '', 0);
$pdf->SetXY(140, 45);
$pdf->Cell(25, 5, $data['tin'], 0, 1, 'L', 0, '', 0);
$pdf->SetXY(140, 50);
$pdf->Cell(25, 5, $data['cst'], 0, 1, 'L', 0, '', 0);
$pdf->SetXY(155, 55);
$pdf->Cell(25, 5, $data['salesperson'], 0, 1, 'L', 0, '', 0);
$invoicedetails = '<table><thead><tr><th style="font-weight:bold;" width="35%">Quotation Details</th><th></th></tr></thead><tbody>';
$invoicedetails .= '<tr><td width="25%">Quotation Number:</td><td>' . $data['qid'] . '</td></tr>';
$invoicedetails .= '<tr><td width="25%">Quotation Date:</td><td>' . date("m/d/y", $data['quotationdate']) . '</td></tr>';
$pdf->Ln(20);
$pdf->writeHTMLCell($w = 0, $h = 0, $x = 15, $y = '', $invoicedetails, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
$pdf->Line(15, 100, 195, 100, $style4);
$pdf->Line(15, 110, 195, 110, $style4);
$pos = 105;
$pdf->SetFont('helvetica', '', 10);
$itemdetails = '<table cellpadding="5" cellspacing="10"><thead><tr style="font-weight:bold;"><th width="15%" style="text-align:center;">Item Code</th><th width="27%" style="text-align:center;">Description of Goods</th><th width="7%">QTY</th><th width="13%" style="text-align:center;">Price</th><th width="9%" style="text-align:center;">TAX%</th><th width="15%" style="text-align:center;">DIS%</th><th width="14%" style="text-align:center;">Net</th></tr></thead><tbody>';
foreach ($data['itemdetails'] as $row) {
$actualprice = $row['price'] * $row['quantity'];
$disvalue = $row['quantity'] * $row['price'] * $row['dis'] / 100;
$taxvalue = ($actualprice - $disvalue) * $row['taxpercent'] / 100;
$rowtotal = $actualprice - ($disvalue + $taxvalue);
$itemdetails .= '<tr><td width="15%">' . $row['itemcode'] . '</td><td width="27%">' . $row['description'] . '</td><td width="7%">' . $row['quantity'] . '</td><td width="13%" style="text-align:right;">' . number_format($row['price'], 2, '.', ',') . '</td><td width="9%" style="text-align:right;">' . number_format($row['taxpercent'], 2, '.', ',') . '</td><td width="15%" style="text-align:right;">' . number_format($row['dis'], 2, '.', ',') . '</td><td width="14%" style="text-align:right;">' . number_format($rowtotal, 2, '.', ',') . '</td></tr>';
$pos = $pos + 10;
}
$itemdetails .= '</tbody></table>';
$pos = $pos + 50;
$pdf->Ln(5);
$pdf->writeHTMLCell($w = 0, $h = 0, $x = 15, $y = '', $itemdetails, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
$pdf->Ln(2);
$pdf->Line(15, $pos, 195, $pos, $style4);
$subdetails = '<table><thead><tr><th style="font-weight:bold;" width="50%"></th><th></th></tr></thead><tbody>';
$subdetails .= '<tr><td width="50%" style="font-weight:bold;">Subtotal :</td><td style="text-align:right;">' . number_format($data['subtotal'], 2, '.', ',') . '</td></tr>';
$subdetails .= '<tr><td width="50%" style="font-weight:bold;">Tax Total :</td><td style="text-align:right;">' . number_format($data['taxtotal'], 2, '.', ',') . '</td></tr>';
$subdetails .= '<tr><td width="50%" style="font-weight:bold;">Round Off :</td><td style="text-align:right;">' . number_format($data['roundoff'], 2, '.', ',') . '</td></tr>';
$subdetails .= '<tr><td width="50%" style="font-weight:bold;">Net Amount:</td><td style="text-align:right;">' . number_format($data['netamount'], 2, '.', ',') . '</td></tr>';
$subdetails .= '</tbody></table>';
//$pdf->Ln(5);
$pdf->SetXY(140, $pos);
$pdf->writeHTMLCell($w = 52, $h = 0, $x = 125, $y = '', $subdetails, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'right', $autopadding = true);
$remarksdetails = '<table><thead><tr><th style="font-weight:bold;" width="50%"></th><th></th></tr></thead><tbody>';
$remarksdetails .= '<tr><td width="50%"></td><td style="text-align:right;"></td></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td style="text-align:right;"></td></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td style="text-align:right;"></td></tr>';
//$remarksdetails .= '<tr><td width="95%">Rupees '.ucfirst($this->no_to_words($data['netamount']).' only/-').'</td><td width="5%"></td></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td style="text-align:right;"></td></tr>';
$remarksdetails .= '<tr><td width="50%" style="font-weight:bold;">Term&Condition</td><td style="text-align:right;"></td></tr>';
$remarksdetails .= '<tr><td width="90%" style="text-align:Justify;">' . $data['term'] . '</td><td width="10%"></td></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td></td></tr>';
$remarksdetails .= '<tr><th style="font-weight:bold;text-align:right;" width="95%">For CONSOLIDATED PREMIUM RETAILERS</th></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td></td></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td></td></tr>';
$remarksdetails .= '<tr><td width="50%"></td><td></td></tr>';
$remarksdetails .= '<tr><td style="text-align:right; width:80%;">Authorised Signatory</td><td></td></tr>';
$remarksdetails .= '</tbody></table>';
$pdf->SetXY(140, $pos);
//$pdf->Ln(5);
$pdf->writeHTMLCell($w = 180, $h = 0, $x = 15, $y = '', $remarksdetails, $border = 0, $ln = 1, $fill = 0, $reseth = false, $align = 'right', $autopadding = true);
/*
$footerdetails = '<table><thead><tr><th></th><th style="font-weight:bold;" width="75%">For CONSOLIDATED PREMIUM RETAILERS</th></tr></thead><tbody>';
$footerdetails .= '<tr><td width="50%"></td><td></td></tr>';
$footerdetails .= '<tr><td width="50%"></td><td></td></tr>';
$footerdetails .= '<tr><td width="50%"></td><td></td></tr>';
$footerdetails .= '<tr><td style="text-align:right; width:80%;">Authorised Signatory</td><td></td></tr>';
$footerdetails .= '<tr><td style="text-align:center;" width="30%"></td><td></td></tr>';
$footerdetails .= '<tr><td style="text-align:left;" width="50%"></td><td></td></tr>';
$footerdetails .= '</tbody></table>';
//$pdf->SetXY(160, 150);
$pdf->Ln(5);
//$pdf->writeHTMLCell($w=180, $h=0, $x=15, $y='',$footerdetails, $border=1, $ln=1, $fill=0, $reseth=false, $align='right', $autopadding=true);
*/
$pdf->Output($data['qid'] . '.pdf', 'I');
}