本文整理汇总了PHP中TCPDF::SetY方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::SetY方法的具体用法?PHP TCPDF::SetY怎么用?PHP TCPDF::SetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::SetY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Footer
public function Footer()
{
$txt = '';
if ($this->footer_param['form']) {
$txt = HTML2PDF::textGET('pdf05');
}
if ($this->footer_param['date'] && $this->footer_param['heure']) {
$txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf03');
}
if ($this->footer_param['date'] && !$this->footer_param['heure']) {
$txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf01');
}
if (!$this->footer_param['date'] && $this->footer_param['heure']) {
$txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf02');
}
if ($this->footer_param['page']) {
$txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf04');
}
if (strlen($txt) > 0) {
$txt = str_replace('[[date_d]]', date('d'), $txt);
$txt = str_replace('[[date_m]]', date('m'), $txt);
$txt = str_replace('[[date_y]]', date('Y'), $txt);
$txt = str_replace('[[date_h]]', date('H'), $txt);
$txt = str_replace('[[date_i]]', date('i'), $txt);
$txt = str_replace('[[date_s]]', date('s'), $txt);
$txt = str_replace('[[current]]', $this->PageNo(), $txt);
$txt = str_replace('[[nb]]', '{nb}', $txt);
parent::SetY(-11);
$this->setOverline(false);
$this->SetFont('helvetica', 'I', 8);
$this->Cell(0, 10, $txt, 0, 0, 'R');
}
}
示例2:
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 10);
// add a page
$pdf->AddPage();
// NOTE: Uncomment the following line to rasterize SVG image using the ImageMagick library.
//$pdf->setRasterizeVectorImages(true);
$pdf->ImageSVG($file = '../images/testsvg.svg', $x = 15, $y = 30, $w = '', $h = '', $link = 'http://www.tcpdf.org', $align = '', $palign = '', $border = 1, $fitonpage = false);
$pdf->ImageSVG($file = '../images/tux.svg', $x = 30, $y = 100, $w = '', $h = 100, $link = '', $align = '', $palign = '', $border = 0, $fitonpage = false);
$pdf->SetFont('helvetica', '', 8);
$pdf->SetY(195);
$txt = '© The copyright holder of the above Tux image is Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.';
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_058.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
示例3: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 058');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 058', PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 10);
// add a page
$pdf->AddPage();
// NOTE: Uncomment the following line to rasterize SVG image using the ImageMagick library.
//$pdf->setRasterizeVectorImages(true);
$pdf->ImageSVG($file = 'tests/images/testsvg.svg', $x = 15, $y = 30, $w = '', $h = '', $link = 'http://www.tcpdf.org', $align = '', $palign = '', $border = 1, $fitonpage = false);
$pdf->ImageSVG($file = 'tests/images/tux.svg', $x = 30, $y = 100, $w = '', $h = 100, $link = '', $align = '', $palign = '', $border = 0, $fitonpage = false);
$pdf->SetFont('helvetica', '', 8);
$pdf->SetY(195);
$txt = '© The copyright holder of the above Tux image is Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.';
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
// ---------------------------------------------------------
$this->comparePdfs($pdf);
}
示例4: dirname
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('freeserif', 'B', 14);
// add a page
$pdf->AddPage();
$cfg = erConfigClassLhConfig::getInstance();
// set some text to print
$txt = $cfg->getSetting('site', 'seller_attributes');
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
$pdf->SetY(25);
// set some text to print
//$txt = "Buyer\nremdex@gmail.com";
$txt = erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Date Issued') . ": " . date('Y-m-d', $invoice->odate) . "\n";
$txt .= erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Invoice number') . ": " . date('Ymd', $invoice->odate) . $invoice->id;
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'R', true, 0, false, false, 0);
// set font
$pdf->SetFont('freeserif', '', 10);
// ---------------------------------------------------------
//$pdf->SetX(0);
$pdf->SetY(65);
$pdf->writeHTML("\r\n\t\t\r\n<table border=\"1\">\r\n<tr>\r\n\t\t<th><b>" . erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Desciption') . "</b></th>\r\n\t\t<th><b>" . erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Price') . "</b></th>\r\n</tr>\t\t\r\n<tr>\r\n\t<td>{$invoice->option_selection1}</td>\t\t\r\n\t<td>{$invoice->price_front}</td>\t\t\r\n</tr>\r\n</table>\r\n");
$pdf->Write(0, erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Total') . ": " . $invoice->price_front, '', 0, 'R', true, 0, false, false, 0);
$pdf->SetFont('freeserif', '', 14);
$pdf->writeHTML(erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Bill to') . ":<br/>" . $invoice->customer_name);
示例5: SetY
/**
* we redifine the original SetY method, because we don't want the automatic treatment.
* It is HTML2PDF that make the treatment.
* If language is RTL direction this method will call to parent (TCPDF class).
*
* @param float $y
* @param boolean $resetx Reset the X position
* @param boolean $rtloff
* @access public
*/
public function SetY($y, $resetx=true, $rtloff=false)
{
if (!$rtloff AND $this->rtl) {
parent::SetY($y, $resetx, $rtloff);
} else {
if ($resetx)
$this->x=$this->lMargin;
$this->y=$y;
}
}
示例6: while
$i = -1;
while (($line = fgets($handle)) !== false) {
$i = ($i + 1) % $cellsPerPage;
if ($i == 0) {
//page change
$x = $leftMargin;
$y = $topMargin;
$pdf->AddPage();
}
if ($i % 2 == 0) {
$x = $leftMargin;
} else {
$x = $leftMargin + $cellWidth;
}
//template
$pdf->SetY($y);
$pdf->SetX($x);
$pdf->Image('config/template.png', $x, $y, $cellWidth, $cellHeight);
//border
$pdf->MultiCell($cellWidth, $cellHeight, "", 1, 'C');
//name
$pdf->SetY($y + 27.5);
$pdf->SetX($x);
$pdf->SetFont('freemono', '', 18);
$pdf->MultiCell($cellWidth, 20, $line, 0, 'C');
//footer
$pdf->SetFont('freemono', '', 9);
$pdf->SetY($y + 42.5);
$pdf->SetX($x);
$pdf->MultiCell($cellWidth, 20, $footer, 0, 'C', 0, 0, '', '', true, 0, true);
if ($i % 2 == 1) {
示例7: tax_continuous_type4
public function tax_continuous_type4($id = null, $year = null)
{
if (Session::get('level') != '') {
$y = Input::get('y3');
if ($y != '') {
$year = $y;
$id = 'all';
}
$pdf = new TCPDF();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$n = DB::select('select * from s_general_data');
foreach ($n as $k) {
$name = $k->name;
$address = $k->address;
$address2 = $k->address2;
$tax_id2 = $k->tax_id2;
$director = $k->director;
}
$sql = ' select concat(n.pname,"",n.fname," ",n.lname) as name, s.cid, s.tax_id,sum(s.salary+s.r_other) as salary, sum(s.r_c) as r_c, sum(s.special_m+s.pts+s.pts2) as special, sum(s.tax) as tax ,sum(s.kbk) as kbk from s_salary_ocsc_detail s left join n_datageneral n on n.cid=s.cid left join n_position_salary p on p.cid=n.cid where s.cid=5350400051484 and year(s.order_date)=' . $year . ' group by s.cid order by n.datainfoID asc ';
$result = DB::select($sql);
foreach ($result as $key) {
$pdf->AddPage('P', 'A4');
$pdf->SetFont('freeserif', 'B', 11, '', true);
$pdf->MultiCell(185, 5, 'เลขที่ งป. ........................./ ' . ($year == 'null' ? $this->yearThai() : $year + 543), 0, 'R', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 16, '', true);
$pdf->SetY(25);
$pdf->SetX(18);
$pdf->MultiCell(177, 5, 'หนังสือรับรองการหักภาษี ณ ที่จ่าย', 0, 'C', 0, 1, '', '', true);
$pdf->SetY(34);
$pdf->SetX(18);
$pdf->MultiCell(177, 5, 'ตามมาตรา 50 ทวิ แห่งประมวลรัษฎากร', 0, 'C', 0, 1, '', '', true);
//===== แนวตั้ง =====//
$linever1 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 190, 18, 50, $linever1);
$linever2 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(80, 190, 80, 50, $linever2);
$linever3 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(110, 190, 110, 50, $linever3);
$linever4 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(135, 190, 135, 50, $linever4);
$linever5 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(165, 190, 165, 50, $linever5);
$linever6 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(195, 190, 195, 50, $linever6);
//===== แนวนอน =====//
$linetop = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 50, 195, 50, $linetop);
$linetop2 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(80, 63, 195, 63, $linetop2);
$linetop3 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 120, 80, 120, $linetop3);
$linetop4 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(80, 180, 195, 180, $linetop4);
$linetop5 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 190, 195, 190, $linetop5);
//======= text in box 1 ========//
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(52);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, 'ชื่อและที่อยู่ของผู้มีหน้าที่หักภาษี ณ ที่จ่าย บุคคลคณะบุคคล นิติบุคคล ส่วนราชการ องค์การ รัฐวิสาหกิจ ฯลฯ ', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(82);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, $address2, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(105);
$pdf->SetX(19);
$pdf->MultiCell(40, 5, $tax_id2, 0, 'L', 0, 1, '', '', true);
//======= text in box 2 ========//
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(122);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, 'ชื่อและที่อยู่ของผู้ถูกหักภาษี ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 12, '', true);
$pdf->SetY(137);
$pdf->SetX(21);
$pdf->MultiCell(59, 5, $key->name, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(145);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, $address, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(165);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, 'เลขประจำตัวผู้เสียภาษีของผู้ถูกหักภาษี ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 12, '', true);
$pdf->SetY(178);
$pdf->SetX(22);
$pdf->MultiCell(62, 5, $key->cid, 0, 'L', 0, 1, '', '', true);
//======= text in box 3 header content ========//
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(54);
$pdf->SetX(83);
$pdf->MultiCell(32, 5, 'เงินได้ที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(54);
$pdf->SetX(111);
$pdf->MultiCell(32, 5, 'ปีภาษีที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
//.........这里部分代码省略.........
示例8: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 028');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(10, PDF_MARGIN_TOP, 10);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
$pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
// set font
$pdf->SetFont('times', 'B', 20);
$pdf->AddPage('P', 'A4');
$pdf->Cell(0, 0, 'A4 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A4');
$pdf->Cell(0, 0, 'A4 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A5');
$pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A5');
$pdf->Cell(0, 0, 'A5 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A6');
$pdf->Cell(0, 0, 'A6 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A6');
$pdf->Cell(0, 0, 'A6 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A7');
$pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A7');
$pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
// --- test backward editing ---
$pdf->setPage(1, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
$pdf->setPage(2, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
$pdf->setPage(3, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
$pdf->setPage(4, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
$pdf->setPage(5, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
$pdf->setPage(6, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
$pdf->setPage(7, true);
$pdf->SetY(40);
$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
$pdf->setPage(8, true);
$pdf->SetY(40);
$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
$pdf->lastPage();
$this->comparePdfs($pdf);
}
示例9: getSliders
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
$pdf->SetFont('helvetica', '', 14, '', true);
// Add a page
// This method has several options, check the source code documentation for more information.
$pdf->AddPage('L', 'A4');
$sliders = getSliders();
$notes = getNotes();
$gallery = getSliderGallery($sliders[1]["id_slider"]);
if ($gallery) {
$filename = generateRandomString();
file_put_contents("_temp/" . $filename . getExtension($gallery[0]["type_image"]), $gallery[0]["slider_image"]);
$pdf->Image("_temp/" . $filename . getExtension($gallery[0]["type_image"]), 25, 40);
}
$gallery = getSliderGallery($sliders[2]["id_slider"]);
if ($gallery) {
$filename = generateRandomString();
file_put_contents("_temp/" . $filename . getExtension($gallery[0]["type_image"]), $gallery[0]["slider_image"]);
$pdf->Image("_temp/" . $filename . getExtension($gallery[0]["type_image"]), 25, 60);
}
foreach ($notes as $note) {
if ($note["note"] === "Cálculo del Precio de un Rubro") {
$pdf->SetY(220);
$pdf->MultiCell(0, 5, $note["note_text"]);
}
}
$pdf->Output('indice-general-de-la-construcción.pdf', 'I');
break;
}
示例10: nonMelLoanPaperWorkPDF
function nonMelLoanPaperWorkPDF()
{
$this->loan->LoanNumber = $this->loaninfo['LoanNumber'];
$this->Address();
$pdf = new TCPDF();
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Niels Klazenga');
$pdf->SetTitle('non-MEL loan paperwork');
$pdf->SetSubject('non-MEL loan paperwork');
//set margins
$pdf->SetMargins(20, 30, 20);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 10);
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->setViewerPreferences(array('FitWindow' => true));
// set font
$pdf->SetFont('helvetica', '', 10);
// set cell padding
$pdf->setCellPaddings(0, 0, 0, 0);
// set cell margins
$pdf->setCellMargins(0, 0, 0, 0);
// start loan cover letter
$pdf->AddPage();
$pdf->Image('images/mel-letterhead.jpg', 25, 0, '', '', '', '', 'T', true, 300, '', false, false, 0, false, false, false);
$x = 20;
$pdf->MultiCell(120, 5, $this->loaninfo['ShipmentDate'], 0, 'L', 0, 1, $x, 12, true, false, true);
$pdf->MultiCell(120, 5, $this->loan->ShippedTo, 0, 'L', 0, 1, $x, 19, true, false, true);
$pdf->MultiCell(140, 5, '<span style="font-size:16pt;font-weight:bold">MEL returning loan ' . $this->loan->LoanNumber . ' (MEL ref. ' . $this->loaninfo['MELRefNo'] . ')</span>', 0, 'L', 0, 1, $x, 60, true, false, true);
$pdf->MultiCell(140, 1, '<hr/>', 0, 'L', 0, 1, $x - 2.5, $pdf->GetY() + 1, true, false, true);
$w = 30;
$y = $pdf->GetY() - 2;
$pdf->MultiCell($w, 5, 'Taxa:', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(130 - $w, 5, $this->loaninfo['TaxaOnLoan'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
$y = $pdf->GetY() + 1;
$pdf->MultiCell($w, 5, 'Sent for study by:', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(130 - $w, 5, $this->loaninfo['LoanAgents'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
$y = $pdf->GetY() + 1;
$pdf->MultiCell($w, 5, 'Shipment details:', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(130 - $w, 5, $this->loaninfo['ShipmentMethod'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
if ($this->loaninfo['TrackingLabels']) {
$y = $pdf->GetY() + 1;
$pdf->MultiCell($w, 5, 'Tracking label(s):', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(130 - $w, 5, $this->loaninfo['TrackingLabels'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
}
$y = $pdf->GetY() + 1;
$pdf->MultiCell($w, 5, 'Loan summary:', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(40, 5, $this->loaninfo['DateReceived'], 0, 'L', 0, 1, $x + $w + 35, $y, true, false, true);
$pdf->MultiCell(35, 5, (int) $this->loaninfo['QuantityReceived'] . ' received', 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
$last = count($this->loaninfo['ShipmentSummary']) - 1;
foreach ($this->loaninfo['ShipmentSummary'] as $index => $row) {
$y = $pdf->GetY();
if ($index == $last) {
$pdf->MultiCell(40, 5, '<b>' . $row['ShipmentDate'] . '</b>', 0, 'L', 0, 1, $x + $w + 35, $y, true, false, true);
$pdf->MultiCell(35, 5, '<b>' . (int) $row['Number1'] . ' returned</b>', 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
} else {
$pdf->MultiCell(40, 5, $row['ShipmentDate'], 0, 'L', 0, 1, $x + $w + 35, $y, true, false, true);
$pdf->MultiCell(35, 5, (int) $row['Number1'] . ' returned', 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
}
}
$y = $pdf->GetY() + 1;
$pdf->MultiCell($w, 5, 'Outstanding:', 0, 'L', 0, 1, $x, $y, true, false, true);
$outstanding = $this->loaninfo['Outstanding'] > 0 ? (int) $this->loaninfo['Outstanding'] . ' specimens' : 'This loan has now been fully returned';
$pdf->MultiCell(130 - $w, 5, $outstanding, 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
$pdf->MultiCell(140, 5, '<hr/>', 0, 'L', 0, 1, $x - 2.5, $pdf->GetY() + 1, true, false, true);
$paragraphs = array();
$paragraphs[] = <<<EOD
Please acknowledge receipt by returning the yellow copy of this form. Any damage should be noted on the form.
EOD;
$paragraphs[] = <<<EOD
For queries relating to loans, exchange or donations please email MEL at HerbMEL@rbg.vic.gov.au.
EOD;
$pdf->SetY($pdf->GetY() - 2);
foreach ($paragraphs as $para) {
$pdf->Multicell(135, 5, $para, 0, 'L', 0, 1, $x, $pdf->GetY() + 1, true, false, true);
}
$pdf->MultiCell(135, 5, $this->loaninfo['ShippedBy'] . '<br/>on behalf of the Collections Manager', 0, 'L', 0, 1, $x, 220, true, false, true);
$y = 236;
//$image_file = base_url() . 'images/scissors.png';
//$pdf->Image($image_file, 22, $y-2.5, 5, 5, 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
//$pdf->MultiCell(127, 5, '<hr/>', 0, 'L', 0, 1, 25.5, $y, true, false, true);
$pdf->MultiCell(140, 5, '<hr/>', 0, 'L', 0, 1, $x - 2.5, $y, true, false, true);
$y = $pdf->GetY() - 1;
$pdf->MultiCell(45, 5, 'Number of parcels: ' . $this->loaninfo['NumberOfPackages'], 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(75, 5, 'Number of specimens: ' . (int) $this->loaninfo['QuantityReturned'], 0, 'L', 0, 1, 75, $y, true, false, true);
$pdf->MultiCell(125, 5, 'Material received in good condition.', 0, 'L', 0, 1, $x, $pdf->GetY() + 3, true, false, true);
$y = $pdf->GetY() + 3;
$pdf->MultiCell(25, 5, 'Comments: ', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(115, 5, '<hr/>', 0, 'L', 0, 1, $x + 20, $y + 4, true, false, true);
$pdf->MultiCell(135, 5, '<hr/>', 0, 'L', 0, 1, $x, $pdf->GetY() + 1, true, false, true);
$pdf->MultiCell(135, 5, '<hr/>', 0, 'L', 0, 1, $x, $pdf->GetY() + 1, true, false, true);
$y = $pdf->GetY() + 1;
$pdf->MultiCell(35, 5, 'Receiving officer:', 0, 'L', 0, 1, $x, $y, true, false, true);
$pdf->MultiCell(60, 5, '<hr/>', 0, 'L', 0, 1, $x + 30, $y + 4, true, false, true);
$pdf->MultiCell(15, 5, 'Date: ', 0, 'L', 0, 1, $x + 90, $y, true, false, true);
$pdf->MultiCell(25, 5, '<hr/>', 0, 'L', 0, 1, $x + 100, $y + 4, true, false, true);
$pdf->Output('nonmelloan.pdf', 'I');
}
示例11: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 027');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 027', PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
// set a barcode on the page footer
$pdf->setBarcode('2015-06-18 09:12:27');
// set font
$pdf->SetFont('helvetica', '', 11);
// add a page
$pdf->AddPage();
// print a message
$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
$pdf->SetY(30);
// -----------------------------------------------------------------------------
$pdf->SetFont('helvetica', '', 10);
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
// PRINT VARIOUS 1D BARCODES
// CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
$pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
$pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED
$pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
$pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 93 - USS-93
$pdf->Cell(0, 0, 'CODE 93 - USS-93', 0, 1);
$pdf->write1DBarcode('TEST93', 'C93', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Standard 2 of 5
$pdf->Cell(0, 0, 'Standard 2 of 5', 0, 1);
$pdf->write1DBarcode('1234567', 'S25', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Standard 2 of 5 + CHECKSUM
$pdf->Cell(0, 0, 'Standard 2 of 5 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('1234567', 'S25+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Interleaved 2 of 5
$pdf->Cell(0, 0, 'Interleaved 2 of 5', 0, 1);
$pdf->write1DBarcode('1234567', 'I25', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Interleaved 2 of 5 + CHECKSUM
$pdf->Cell(0, 0, 'Interleaved 2 of 5 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('1234567', 'I25+', '', '', '', 18, 0.4, $style, 'N');
// add a page ----------
$pdf->AddPage();
// CODE 128 AUTO
$pdf->Cell(0, 0, 'CODE 128 AUTO', 0, 1);
$pdf->write1DBarcode('CODE 128 AUTO', 'C128', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 A
$pdf->Cell(0, 0, 'CODE 128 A', 0, 1);
$pdf->write1DBarcode('CODE 128 A', 'C128A', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 B
$pdf->Cell(0, 0, 'CODE 128 B', 0, 1);
$pdf->write1DBarcode('CODE 128 B', 'C128B', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 C
$pdf->Cell(0, 0, 'CODE 128 C', 0, 1);
$pdf->write1DBarcode('0123456789', 'C128C', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// EAN 8
$pdf->Cell(0, 0, 'EAN 8', 0, 1);
$pdf->write1DBarcode('1234567', 'EAN8', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
//.........这里部分代码省略.........
示例12: validate_position
private function validate_position($width)
{
$margins = parent::getMargins();
if ($width == 0) {
$width = $this->document_width - $this->last_width;
}
$x_width = parent::GetX() + $width;
if ($x_width > $this->document_width || parent::GetX() >= $this->document_width) {
parent::SetY($this->last_height + $this->separator);
$x_width = $margins['left'] + $width;
}
if (parent::GetY() < $this->last_height) {
parent::SetX($this->last_width);
$x_width = $this->last_width + $width;
}
if (parent::GetY() >= parent::getPageHeight() - $margins['bottom']) {
$this->add_page();
}
if ($x_width < $this->document_width) {
$this->last_width = $x_width + $this->separator;
}
}
示例13: detailNewPage
//.........这里部分代码省略.........
$this->showGroupFooter();
$this->pageFooter();
// $this->pdf->AddPage();
$this->pageHeaderNewPage();
// $this->showGroupHeader();
// $this->background();
$headerY = $this->arrayPageSetting["topMargin"] + $this->arraypageHeader[0]["height"];
$checkpoint = $this->arraydetail[0]["y_axis"];
$biggestY = 0;
$tempY = $this->arraydetail[0]["y_axis"];
} elseif (isset($this->arraylastPageFooter) && $checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt) > $this->arrayPageSetting["pageHeight"] - $this->arraylastPageFooter[0]["height"] - $this->arrayPageSetting["bottomMargin"]) {
$this->showGroupFooter();
$this->lastPageFooter();
// $this->pdf->AddPage();
// $this->background();
$this->pageHeaderNewPage();
// $this->showGroupHeader();
$checkpoint = $this->arraydetail[0]["y_axis"];
$biggestY = 0;
$tempY = $this->arraydetail[0]["y_axis"];
}
if ($checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt) > $tempY) {
$tempY = $checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt);
}
break;
case "relativebottomline":
break;
case "report_count":
// $this->report_count++;
break;
case "group_count":
//### $this->group_count++;
break;
default:
$this->display($compare, $checkpoint);
break;
}
}
if ($checkpoint + $this->arraydetail[0]["height"] > $this->arrayPageSetting["pageHeight"] - $this->arraypageFooter[0]["height"] - $this->arrayPageSetting["bottomMargin"]) {
$this->pageFooter();
// $this->pdf->AddPage();
// $this->background();
$headerY = $this->arrayPageSetting["topMargin"] + $this->arraypageHeader[0]["height"];
$this->pageHeaderNewPage();
// $this->showGroupHeader();
$checkpoint = $this->arraydetail[0]["y_axis"];
$biggestY = 0;
$tempY = $this->arraydetail[0]["y_axis"];
}
foreach ($this->arraydetail as $out) {
$this->currentrow = $this->arraysqltable[$this->global_pointer];
switch ($out["hidden_type"]) {
case "field":
$this->prepare_print_array = array("type" => "MultiCell", "width" => $out["width"], "height" => $out["height"], "txt" => $out["txt"], "border" => $out["border"], "align" => $out["align"], "fill" => $out["fill"], "hidden_type" => $out["hidden_type"], "printWhenExpression" => $out["printWhenExpression"], "soverflow" => $out["soverflow"], "poverflow" => $out["poverflow"], "link" => $out["link"], "pattern" => $out["pattern"]);
$this->display($this->prepare_print_array, 0, true);
if ($this->pdf->GetY() > $biggestY) {
$biggestY = $this->pdf->GetY();
}
break;
case "relativebottomline":
//$this->relativebottomline($out,$tempY);
$this->relativebottomline($out, $biggestY);
break;
default:
$this->display($out, $checkpoint);
//$checkpoint=$this->pdf->GetY();
break;
}
}
$this->pdf->SetY($biggestY);
if ($biggestY > $checkpoint + $this->arraydetail[0]["height"]) {
$checkpoint = $biggestY;
} elseif ($biggestY < $checkpoint + $this->arraydetail[0]["height"]) {
$checkpoint = $checkpoint + $this->arraydetail[0]["height"];
} else {
$checkpoint = $biggestY;
}
if (isset($this->arraygroup) && $this->global_pointer > 0 && $this->arraysqltable[$this->global_pointer][$this->group_pointer] != $this->arraysqltable[$this->global_pointer + 1][$this->group_pointer]) {
$this->showGroupFooter($tempY);
}
//if(isset($this->arraygroup)){$this->global_pointer++;}
$this->global_pointer++;
}
} else {
echo utf8_decode("Sorry cause there is not result from this query.");
exit(0);
}
$this->global_pointer--;
$rownum++;
if ($this->arraysummary[0]["height"] > 0) {
$this->summary();
}
if (isset($this->arraylastPageFooter)) {
// $this->showGroupFooter();
$this->lastPageFooter();
} else {
// $this->showGroupFooter();
$this->pageFooter();
}
}
示例14: date
//.........这里部分代码省略.........
define('PDF_PATH_IMAGE', '/include/image/');
define('PDF_PATH', '/include/');
//define ('FILE_PDF_PATH','include/file/');
$this->load->library('Pdf');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->AddPage();
// Основные показатели
$hx = 11;
// высота ячейки
$Wzamov = 50;
$Wisp = 120;
$Wmulticel = 50;
// Заголовок
$pdf->Image(PDF_PATH_IMAGE . $header_logo_png, 10, 10, 65, 20, 'png', '', '', true, 300, '', false, false, false, false, false, false);
$pdf->SetFont('dejavusans', 'B', 10);
// Header
$pdf->Write(5, $header_account_name, '', 0, 'R', true, 0, false, false, 0, 0);
$pdf->SetFont('dejavusans', '', 9);
// $pdf->Write(5, $header_account_property, '', 0, 'R', true, 0, false, false, 0,0,array(1,1));
$pdf->Write(0, $header_account_property, '', 0, 'R', true, 0, false, false, 0);
// e911.com.ua
$pdf->SetFont('dejavusans', '', 9);
$pdf->Write(5, $header_account_logotext, '', 0, 'L', true, 0, false, false, 0, 0, array(1, 1));
$pdf->SetFont('dejavusans', '', 8);
$date = Date("d.m.Y");
$pdf->SetFillColor(255, 255, 255);
// $ypost = 54;
$pdf->SetFont('', 'B', 9);
$y_header = 40;
$pdf->SetY($y_header, true);
$pdf->cell(50, $hx, 'Постачальник:', 0, 'L');
$pdf->SetY($y_header, true);
$pdf->SetX(100, true);
$pdf->cell(50, $hx, 'Платник:', 0, 'L');
$wedhtCell = 50;
$pdf->SetFont('', '', 9);
// header_main_supplier
$pdf->SetY(50, true);
$pdf->SetX(10, true);
// $pdf->SetY($ypost+8,true);
$pdf->multicell(100, $hx, $header_main_supplier, 0, 'L', 1, 0, '', '', true);
$txt = <<<EOD
{$name_ca}
ЕДРПОУ: {$edrpou}
тел: {$tel}
{$email}
EOD;
$pdf->SetY(50, true);
$pdf->SetX(100, true);
$pdf->multicell(100, $hx, $txt, 0, 'L', 1, 0, '', '', true);
// ЗАКАЗ
$pdf->SetFont('dejavusans', 'B', 16);
// set some text to print
$number_acc_id = $type_acc . $number_acc;
$txt = <<<EOD
Рахунок № {$number_acc_id} від {$date}
EOD;
$pdf->SetY(80, true);
$pdf->Write(5, $txt, '', 0, 'C', true, 0, false, false, 0, 0);
$pdf->SetFont('dejavusans', '', 8);
$txt = <<<EOD
за інформаційні послуги
示例15: switch
{
$pdf->AddPage();
$numefftot = 0;
}
//a secondo del tipo di effetto stampo il relativo modulo
switch($effetto['tipeff'])
{
//questo è il modulo delle ricevute bancarie
case "B":
$pdf->SetFont('helvetica','',7);
$pdf->Rect(5,5+$passo*$numefftot,200,50);
$pdf->Rect(5,60+$passo*$numefftot,65,30);
$pdf->Rect(71,60+$passo*$numefftot,85,30);
$pdf->Rect(157,60+$passo*$numefftot,48,30);
$pdf->Rect(75,20+$passo*$numefftot,125,10,'DF');
$pdf->SetY(30+$numefftot*$passo);
$pdf->Image('@'.$logo,6,6+$passo*$numefftot,30,0);
$pdf->Cell(50,3,$admin_aziend['ragso1'],0,2,'L');
$pdf->Cell(50,3,$admin_aziend['ragso2'],0,2,'L');
$pdf->Cell(50,3,$admin_aziend['indspe'].' Tel.'.$admin_aziend['telefo'],0,2,'L');
$pdf->Cell(50,3,$admin_aziend['capspe'].' '.$admin_aziend['citspe'].' ('.$admin_aziend['prospe'].')',0,2,'L');
$pdf->Cell(50,3,'P.I. '.$admin_aziend['pariva'],0,2,'L');
$pdf->Cell(50,3,'C.F. '.$admin_aziend['codfis'],0,0,'L');
$pdf->SetXY(70,5+$numefftot*$passo);
$pdf->SetFont('helvetica','B',10);
$pdf->Cell(50,10,'RICEVUTA N. '.$effetto['progre'],0,0,'L');
$pdf->SetFont('helvetica','',8);
$pdf->MultiCell(22,10,'Data di pagamento','LTB','L',1);
$pdf->SetXY(140,5+$numefftot*$passo);
$pdf->SetFont('helvetica','B',10);
$pdf->Cell(20,10,$scadenza.' ','RTB',0,'R',1);