当前位置: 首页>>代码示例>>PHP>>正文


PHP TCPDF::SetX方法代码示例

本文整理汇总了PHP中TCPDF::SetX方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::SetX方法的具体用法?PHP TCPDF::SetX怎么用?PHP TCPDF::SetX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCPDF的用法示例。


在下文中一共展示了TCPDF::SetX方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: text

 /**
  * Writes text at the specified x and y coordinates
  *
  * See {@link Style::munge_color()} for the format of the color array.
  *
  * @param float $x
  * @param float $y
  * @param string $text the text to write
  * @param string $font the font file to use
  * @param float $size the font size, in points
  * @param array $color
  * @param float $adjust word spacing adjustment
  */
 function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $adjust = 0, $angle = 0, $blend = "Normal", $opacity = 1.0)
 {
     dompdf_debug("trace", "({$x}, {$y}, {$text}, " . basename($font) . ", {$size}, [{$color['0']}, {$color['1']}, {$color['2']}], {$adjust}, {$angle}, {$blend}, {$opacity})");
     list($r, $g, $b) = $this->_get_rgb($color);
     $this->_pdf->SetTextColor($r, $g, $b);
     $this->_set_line_transparency($blend, $opacity);
     $this->_set_fill_transparency($blend, $opacity);
     $fontdata = $this->_get_font($font);
     $this->_pdf->SetFont($fontdata['family'], $fontdata['style'], $size, $font);
     //$this->_pdf->SetFontSize($size);
     // ???
     if ($adjust > 0) {
         $a = explode(' ', $text);
         //$this->_pdf->SetXY($x - 3, $y + (self::FONT_HEIGHT_SCALE - 1) * $size);
         $this->_pdf->SetXY($x, $y);
         //$y += self::FONT_HEIGHT_SCALE * $size + 1;
         for ($i = 0; $i < count($a) - 1; $i++) {
             $this->_pdf->Write($size, $a[$i] . ' ', '');
             //$this->_pdf->Text($x, $y, $a[$i].' ');
             $this->_pdf->SetX($this->_pdf->GetX() + $adjust);
             //$x += $this->_pdf->GetX() + $adjust;
         }
         $this->_pdf->Write($size, $a[$i], '');
         //$this->_pdf->Text($x, $y, $a[$i].' ');
     } else {
         if ($angle != 0) {
             $this->_pdf->StartTransform();
             //$y += self::FONT_HEIGHT_SCALE * $size;
             //$y += $size;
             $this->_pdf->Rotate(-$angle, $x, $y);
             $this->_pdf->Text($x, $y, $text, false, false, true, 0, 0, '', 0, '', 0, false, 'T', 'T');
             $this->_pdf->StopTransform();
         } else {
             //$pippo = $this->_pdf->getFontAscent($fontdata['family'], $fontdata['style'], $size);
             //$y += $pippo / 8;
             //$y = $y - 0.85 * $size;	// + 0.8 * $size;
             $this->_pdf->Text($x, $y, $text, false, false, true, 0, 0, '', 0, '', 0, false, 'T', 'T');
         }
     }
 }
开发者ID:Razinsky,项目名称:echaude-com,代码行数:53,代码来源:tcpdf_adapter.cls.php

示例2: testPdfOutput

    public function testPdfOutput()
    {
        $this->markTestIncomplete('Travis failure needs further investigation. ');
        // 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 014');
        $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 . ' 014', 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);
        // ---------------------------------------------------------
        // IMPORTANT: disable font subsetting to allow users editing the document
        $pdf->setFontSubsetting(false);
        // set font
        $pdf->SetFont('helvetica', '', 10, '', false);
        // add a page
        $pdf->AddPage();
        /*
        It is possible to create text fields, combo boxes, check boxes and buttons.
        Fields are created at the current position and are given a name.
        This name allows to manipulate them via JavaScript in order to perform some validation for instance.
        */
        // set default form properties
        $pdf->setFormDefaultProp(array('lineWidth' => 1, 'borderStyle' => 'solid', 'fillColor' => array(255, 255, 200), 'strokeColor' => array(255, 128, 128)));
        $pdf->SetFont('helvetica', 'BI', 18);
        $pdf->Cell(0, 5, 'Example of Form', 0, 1, 'C');
        $pdf->Ln(10);
        $pdf->SetFont('helvetica', '', 12);
        // First name
        $pdf->Cell(35, 5, 'First name:');
        $pdf->TextField('firstname', 50, 5);
        $pdf->Ln(6);
        // Last name
        $pdf->Cell(35, 5, 'Last name:');
        $pdf->TextField('lastname', 50, 5);
        $pdf->Ln(6);
        // Gender
        $pdf->Cell(35, 5, 'Gender:');
        $pdf->ComboBox('gender', 30, 5, array(array('', '-'), array('M', 'Male'), array('F', 'Female')));
        $pdf->Ln(6);
        // Drink
        $pdf->Cell(35, 5, 'Drink:');
        //$pdf->RadioButton('drink', 5, array('readonly' => 'true'), array(), 'Water');
        $pdf->RadioButton('drink', 5, array(), array(), 'Water');
        $pdf->Cell(35, 5, 'Water');
        $pdf->Ln(6);
        $pdf->Cell(35, 5, '');
        $pdf->RadioButton('drink', 5, array(), array(), 'Beer', true);
        $pdf->Cell(35, 5, 'Beer');
        $pdf->Ln(6);
        $pdf->Cell(35, 5, '');
        $pdf->RadioButton('drink', 5, array(), array(), 'Wine');
        $pdf->Cell(35, 5, 'Wine');
        $pdf->Ln(6);
        $pdf->Cell(35, 5, '');
        $pdf->RadioButton('drink', 5, array(), array(), 'Milk');
        $pdf->Cell(35, 5, 'Milk');
        $pdf->Ln(10);
        // Newsletter
        $pdf->Cell(35, 5, 'Newsletter:');
        $pdf->CheckBox('newsletter', 5, true, array(), array(), 'OK');
        $pdf->Ln(10);
        // Address
        $pdf->Cell(35, 5, 'Address:');
        $pdf->TextField('address', 60, 18, array('multiline' => true, 'lineWidth' => 0, 'borderStyle' => 'none'), array('v' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'dv' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'));
        $pdf->Ln(19);
        // Listbox
        $pdf->Cell(35, 5, 'List:');
        $pdf->ListBox('listbox', 60, 15, array('', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7'), array('multipleSelection' => 'true'));
        $pdf->Ln(20);
        // E-mail
        $pdf->Cell(35, 5, 'E-mail:');
        $pdf->TextField('email', 50, 5);
        $pdf->Ln(6);
        // Date of the day
        $pdf->Cell(35, 5, 'Date:');
        $pdf->TextField('date', 30, 5, array(), array('v' => date('Y-m-d'), 'dv' => date('Y-m-d')));
        $pdf->Ln(10);
        $pdf->SetX(50);
        // Button to validate and print
        $pdf->Button('print', 30, 10, 'Print', 'Print()', array('lineWidth' => 2, 'borderStyle' => 'beveled', 'fillColor' => array(128, 196, 255), 'strokeColor' => array(64, 64, 64)));
        // Reset Button
//.........这里部分代码省略.........
开发者ID:fooman,项目名称:tcpdf,代码行数:101,代码来源:Example014Test.php

示例3: array

//Adress
$pdf->Cell(35, 5, 'Address:');
$pdf->TextField('address', 60, 18, array('multiline' => true, 'strokeColor' => 'ltGray'));
$pdf->Ln(19);
//E-mail
$pdf->Cell(35, 5, 'E-mail:');
$pdf->TextField('email', 50, 5, array('strokeColor' => 'ltGray'));
$pdf->Ln(6);
//Newsletter
$pdf->Cell(35, 5, 'Receive our', 0, 1);
$pdf->Cell(35, 5, 'newsletter:');
$pdf->CheckBox('newsletter', 5, true);
$pdf->Ln(10);
//Date of the day (determined and formatted by JS)
$pdf->Write(5, 'Date: ');
$pdf->TextField('date', 30, 5);
$pdf->IncludeJS("getField('date').value=util.printd('dd/mm/yyyy',new Date());\n");
$pdf->Ln();
$pdf->Write(5, 'Signature:');
$pdf->Ln(3);
//Button to validate and print
$pdf->SetX(95);
$pdf->Button('print', 20, 8, 'Print', 'Print()', array('textColor' => 'yellow', 'fillColor' => '#FF5050'));
//Form validation functions
$pdf->IncludeJS("\r\nfunction CheckField(name,message) {\r\n\tvar f = getField(name);\r\n\tif(f.value == '') {\r\n\t    app.alert(message);\r\n\t    f.setFocus();\r\n\t    return false;\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction Print() {\r\n\t//Validation\r\n\tif(!CheckField('firstname','First name is mandatory'))\r\n\t\treturn;\r\n\tif(!CheckField('lastname','Last name is mandatory'))\r\n\t\treturn;\r\n\tif(!CheckField('gender','Gender is mandatory'))\r\n\t\treturn;\r\n\tif(!CheckField('address','Address is mandatory'))\r\n\t\treturn;\r\n\t//Print\r\n\tprint();\r\n}\r\n");
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output("example_014.pdf", "I");
//============================================================+
// END OF FILE
//============================================================+
开发者ID:arhe,项目名称:pwak,代码行数:31,代码来源:example_014.php

示例4: printlongtext

 public function printlongtext($fontfamily, $fontstyle, $fontsize)
 {
     //$this->gotTextOverPage=false;
     $this->columnFooter();
     $this->pageFooter();
     $this->pageHeader();
     $this->columnHeader();
     $this->hideheader == true;
     $this->currentband = 'detail';
     $fontfile = $this->fontdir . '/' . $fontfamily . '.php';
     if (file_exists($fontfile) || $this->bypassnofont == false) {
         $fontfile = $this->fontdir . '/' . $arraydata["font"] . '.php';
         $this->pdf->SetFont($fontfamily, $fontstyle, $fontsize, $fontfile);
     } else {
         $fontfamily = "freeserif";
         if ($fontstyle == "") {
             $this->pdf->SetFont('freeserif', $fontstyle, $fontsize, $this->fontdir . '/freeserif.php');
         } elseif ($fontstyle == "B") {
             $this->pdf->SetFont('freeserifb', $fontstyle, $fontsize, $this->fontdir . '/freeserifb.php');
         } elseif ($fontstyle == "I") {
             $this->pdf->SetFont('freeserifi', $fontstyle, $fontsize, $this->fontdir . '/freeserifi.php');
         } elseif ($fontstyle == "BI") {
             $this->pdf->SetFont('freeserifbi', $fontstyle, $fontsize, $this->fontdir . '/freeserifbi.php');
         } elseif ($fontstyle == "BIU") {
             $this->pdf->SetFont('freeserifbi', "BIU", $fontsize, $this->fontdir . '/freeserifbi.php');
         } elseif ($fontstyle == "U") {
             $this->pdf->SetFont('freeserif', "U", $fontsize, $this->fontdir . '/freeserif.php');
         } elseif ($fontstyle == "BU") {
             $this->pdf->SetFont('freeserifb', "U", $fontsize, $this->fontdir . '/freeserifb.php');
         } elseif ($fontstyle == "IU") {
             $this->pdf->SetFont('freeserifi', "IU", $fontsize, $this->fontdir . '/freeserifbi.php');
         }
     }
     //$this->pdf->SetFont($fontfamily,$fontstyle,$fontsize,$this->fontdir.'/'.$fontfamily.'php');
     $this->pdf->SetTextColor($this->forcetextcolor_r, $this->forcetextcolor_g, $this->forcetextcolor_b);
     //$this->pdf->SetTextColor(44,123,4);
     $this->pdf->SetFillColor($this->forcefillcolor_r, $this->forcefillcolor_g, $this->forcefillcolor_b);
     $bltxt = $this->continuenextpageText;
     //       print_r($this->continuenextpageText);
     //                         echo "longtext:$fontfamily,$fontstyle,$fontsize<br/><br/>";
     $this->pdf->SetY($this->arraypageHeader[0]["height"] + $this->columnheaderbandheight + $this->arrayPageSetting["topMargin"]);
     $this->pdf->SetX($bltxt['x']);
     $maxheight = $this->arrayPageSetting["pageHeight"] - $this->arraypageFooter[0]["height"] - $this->pdf->GetY() - $bltxt['height'];
     $this->pdf->MultiCell($bltxt['width'], $bltxt['height'], $bltxt['txt'], $bltxt['border'], $bltxt['align'], $bltxt['fill'], $bltxt['ln'], '', '', $bltxt['reset'], $bltxt['streth'], $bltxt['ishtml'], $bltxt['autopadding'], $maxheight - $bltxt['height'], $bltxt['valign']);
     if ($this->pdf->balancetext != '') {
         $this->continuenextpageText = array('width' => $bltxt["width"], 'height' => $bltxt["height"], 'txt' => $this->pdf->balancetext, 'border' => $bltxt["border"], 'align' => $bltxt["align"], 'fill' => $bltxt["fill"], 'ln' => 1, 'x' => $bltxt['x'], 'y' => '', 'reset' => true, 'streth' => 0, 'ishtml' => false, 'autopadding' => true, 'valign' => $bltxt['valign']);
         $this->pdf->balancetext = '';
         $this->printlongtext($fontfamily, $fontstyle, $fontsize);
     }
     //echo $this->currentband;
     if ($this->pdf->balancetext == '' && $this->currentband == 'detail') {
         if ($this->maxpagey['page_' . ($this->pdf->getPage() - 1)] == '') {
             $this->maxpagey['page_' . ($this->pdf->getPage() - 1)] = $this->pdf->GetY();
         } else {
             if ($this->maxpagey['page_' . ($this->pdf->getPage() - 1)] < $this->pdf->GetY()) {
                 $this->maxpagey['page_' . ($this->pdf->getPage() - 1)] = $this->pdf->GetY();
             }
         }
     }
 }
开发者ID:fabiorossetto1,项目名称:phpjasperxml,代码行数:60,代码来源:Report.php

示例5: array

$fill = 0;
$x_init = $x;
$pdf->SetXY($x_init, $y);
$max_rows = 1;
foreach ($pdfdata as $rows) {
    $lc = array();
    for ($i = 0; $i < count($rows); $i++) {
        $lc[] = $pdf->getNumLines($rows[$i], $w[$i]);
    }
    //Max no of Lines the row occupies
    $linecount = max($lc);
    for ($i = 0; $i < count($rows); $i++) {
        $pdf->MultiCell($w[$i], $header_h * $linecount + $header_h, trim($rows[$i]) . "\n", 0, 'J', 0, 0, $x_init, $y, true);
        //$pdf->writeHTMLCell($w[$i], $row_height, $x_init, $y,$rows[$i]."\n",0,0,0);
        $x_init = $x_init + $w[$i];
        $pdf->SetX($x_init);
    }
    // Line break - Line X
    $y = $y + $header_h * $linecount + $header_h;
    if ($y > $y_max) {
        $pdf->AddPage();
        $y = $y_start;
    }
    $x_init = $x;
    $pdf->SetXY($x_init, $y);
    $fill = !$fill;
}
// ---------------------------------------------------------
ob_end_clean();
//Close and output PDF document
$pdf->Output("Report.pdf", "I");
开发者ID:kaz190,项目名称:dotproject,代码行数:31,代码来源:overdue.php

示例6: CheckField

$pdf->Cell(35, 5, 'Address:');
$pdf->TextField('address', 60, 18, array('multiline' => true, 'lineWidth' => 0, 'borderStyle' => 'none'), array('v' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'dv' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'));
$pdf->Ln(19);
// Listbox
$pdf->Cell(35, 5, 'List:');
$pdf->ListBox('listbox', 60, 15, array('', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7'), array('multipleSelection' => 'true'));
$pdf->Ln(20);
// E-mail
$pdf->Cell(35, 5, 'E-mail:');
$pdf->TextField('email', 50, 5);
$pdf->Ln(6);
// Date of the day
$pdf->Cell(35, 5, 'Date:');
$pdf->TextField('date', 30, 5, array(), array('v' => date('Y-m-d'), 'dv' => date('Y-m-d')));
$pdf->Ln(10);
$pdf->SetX(50);
// Button to validate and print
$pdf->Button('print', 30, 10, 'Print', 'Print()', array('lineWidth' => 2, 'borderStyle' => 'beveled', 'fillColor' => array(128, 196, 255), 'strokeColor' => array(64, 64, 64)));
// Reset Button
$pdf->Button('reset', 30, 10, 'Reset', array('S' => 'ResetForm'), array('lineWidth' => 2, 'borderStyle' => 'beveled', 'fillColor' => array(128, 196, 255), 'strokeColor' => array(64, 64, 64)));
// Submit Button
$pdf->Button('submit', 30, 10, 'Submit', array('S' => 'SubmitForm', 'F' => 'http://localhost/printvars.php', 'Flags' => array('ExportFormat')), array('lineWidth' => 2, 'borderStyle' => 'beveled', 'fillColor' => array(128, 196, 255), 'strokeColor' => array(64, 64, 64)));
// Form validation functions
$js = <<<EOD
function CheckField(name,message) {
\tvar f = getField(name);
\tif(f.value == '') {
\t    app.alert(message);
\t    f.setFocus();
\t    return false;
\t}
开发者ID:ambagasdowa,项目名称:projections,代码行数:31,代码来源:example_014.php

示例7: SetX

 /**
  * we redifine the original SetX 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   $x
  * @param boolean $rtloff
  * @access public
  */
 public function SetX($x, $rtloff=false)
 {
     if (!$rtloff AND $this->rtl) {
         parent::SetX($x, $rtloff);
     } else {
         $this->x=$x;
     }
 }
开发者ID:RomLAURENT,项目名称:Jar2Fer,代码行数:17,代码来源:myPdf.class.php

示例8: 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);
//.........这里部分代码省略.........
开发者ID:themesanasang,项目名称:salary,代码行数:101,代码来源:TaxController.php

示例9: array

            $pdf->SetFillColorArray($colorized && is_numeric($letter) ? $aColors[$letter] : array(255, 255, 255));
            if ($textOrientation == 'vertical') {
                $pdf->Cell($hBox, $wBox, $letter, 1, 2, 'C', true, '', 0, true);
            } else {
                $pdf->Cell($wBox, $hBox, $letter, 1, 0, 'C', true, '', 0, true);
            }
        }
        if ($textOrientation == 'vertical') {
            $pdf->StopTransform();
        }
        // Print media name in a box of its own
        if ($tape != 'dlt') {
            $pdf->SetFontSize($fontSize);
            if ($textOrientation == 'vertical') {
                // begin at bottom left, and start a rotation
                $pdf->SetXY($posX + $radius + $wBox * 6, $posY + $hLabel);
                $pdf->StartTransform();
                $pdf->Rotate(90);
                $pdf->Cell($hBox, $wBox, strtoupper($tape), 1, 0, 'C', false, '', 0, true);
                $pdf->StopTransform();
            } else {
                $pdf->SetX($posX + $radius + $wBox * 6);
                $pdf->Cell($wBox, $hBox, strtoupper($tape), 1, 0, 'C', false, '', 0, true);
            }
            $txt .= strtoupper($tape);
        }
        // Finish with the actual barcode
        $pdf->write1DBarcode($txt, 'C39', $posX, $posY + $paddingTop, $wLabel, $hBarcode, '', $style);
    }
}
$pdf->Output('barcodes.pdf', 'D');
开发者ID:rsynnest,项目名称:barcode,代码行数:31,代码来源:print.php

示例10:

$q=mysql_query("SELECT * FROM `pus_tpjm` WHERE ssid='$ssid'"); $k=0;
//$pdf->MultiCell(100, 0, mysql_num_rows($q), 'LTRB', 'C', 0, 1, '', '', true);
$kol=0; $row=0; $i=0; $nkol=floor($dcPageW/($lwidth+1)); $nrow=99; //$nrow=floor($dcPageH/$lheight);
while($r=mysql_fetch_array($q)){
	$t01=mysql_query("SELECT pus_buku.replid,pus_buku.idbuku,pus_buku.barkode,pus_katalog.callnumber FROM pus_buku LEFT JOIN pus_katalog ON pus_katalog.replid=pus_buku.katalog WHERE pus_buku.replid='".$r['buku']."' LIMIT 0,1");
	$b=mysql_fetch_array($t01);
	//$b=dbSFA("*","pus_buku","W/replid='".$r['buku']."'");
	// Print Label >>
	$x=($lwidth+1)*$kol+$dcMarginL; $y=$lheight*$row+$dcMarginT;
	$pdf->SetXY($x,$y); $pl=false;
	if($plhead=='1'){ $pl=true;
	$pdf->setCellPaddings(0, 0.5, 0, 0);
	$pdf->SetFont('dejavusans', '', 10, '', true);
	$pdf->MultiCell($lwidth, 0, $title, 'LTR', 'C', 0, 1, '', '', true);
	if($k==0) $lheight+=$pdf->getLastH();	
	$pdf->SetX($x);
	$pdf->setCellPaddings(0, 0, 0, 0.5);
	$pdf->SetFont('dejavusans', '', 7, '', true);
	$pdf->MultiCell($lwidth, 0, $desc, 'LBR', 'C', 0, 9, '', '', true);
	if($k==0) $lheight+=$pdf->getLastH();	
	}
	if($plcnum=='1'){ $pl=true;
	//dc_YDown(1);
	$pdf->SetX($x);
	$pdf->setCellPaddings(0,0.5,0,0.5);
	$pdf->SetFont('dejavusans', 'B', 10, '', true);
	$cx=str_replace(" ","\n",preg_replace("/\s+/"," ",$b['callnumber']));
	$pdf->MultiCell($lwidth, 0, $cx, 1, 'C', 0, 1, '', '', true);
	//dc_YDown(1);
	if($k==0) $lheight+=$pdf->getLastH();
	}
开发者ID:nickohappy7,项目名称:sister,代码行数:31,代码来源:label.php

示例11: add_table

 public function add_table($table)
 {
     $absolute_position = $this->is_absolute($table);
     if (!$absolute_position) {
         $this->validate_position($table->ancho);
     }
     if ($table->fondo) {
         $this->choose_color();
     }
     $this->SetLineWidth(0.3);
     // set the width of the table
     $margins = parent::getMargins();
     if ($table->ancho == 0) {
         if (parent::GetX() == $margins['left']) {
             $table->ancho = $this->document_width;
         } elseif (isset($table->x)) {
             $table->ancho = $this->document_width - $table->x;
         } else {
             $table->ancho = $this->document_width - $this->last_width;
         }
     }
     // get the widths of the headers
     $encabezados = (array) $table->encabezados;
     $string_widths = 0;
     $has_superheaders = false;
     foreach ($encabezados as $key => $cell) {
         if (is_array($cell)) {
             $has_superheaders = true;
             foreach ($cell as $value) {
                 $string_widths += parent::GetStringWidth($value);
             }
         } else {
             $string_widths += parent::GetStringWidth($cell);
         }
     }
     if ($table->borde == 0) {
         $header_border = 'B';
         $data_border = 0;
     } else {
         $header_border = 1;
         $data_border = 'LR';
     }
     // print headers
     $x = parent::GetX();
     $y = parent::GetY();
     $widths = array();
     $i = 0;
     if ($has_superheaders) {
         $cell_h = 26;
     } else {
         $cell_h = 13;
     }
     foreach ($encabezados as $index => $cell) {
         if (is_array($cell)) {
             $super_w = 0;
             $super_x = parent::GetX();
             foreach ($cell as $key => $value) {
                 array_push($widths, $this->GetStringWidth($value) / $string_widths * $table->ancho);
                 parent::WriteHTMLCell($widths[$i + $key], $cell_h / 2, parent::GetX(), $y + $cell_h / 2, "<b>" . $value . "</b>", $header_border, 0, $table->fondo, true, 'C');
                 $super_w += $widths[$i + $key];
             }
             parent::WriteHTMLCell($super_w, $cell_h / 2, $super_x, $y, "<b>" . $index . "</b>", $header_border, 0, $table->fondo, true, 'C');
             parent::SetXY(parent::GetX(), $y + $cell_h / 2);
         } else {
             array_push($widths, $this->GetStringWidth($cell) / $string_widths * $table->ancho);
             parent::WriteHTMLCell($widths[$index], $cell_h, parent::GetX(), $y, "<b>" . $cell . "</b>", $header_border, 0, $table->fondo, true, 'C');
         }
         $i++;
     }
     parent::Ln();
     parent::SetX($x);
     // print data
     $fill = false;
     foreach ($table->datos as $row) {
         foreach ($row as $i => $field) {
             $this->WriteHTMLCell($widths[$i], 6, '', '', $field, $data_border, 0, $fill, true, 'L', true);
         }
         if (parent::GetY() + 20 > parent::getPageHeight() - PDF_MARGIN_BOTTOM) {
             parent::AddPage();
         }
         $height = parent::getLastH();
         $this->Ln();
         if ($table->fondo) {
             $fill = !$fill;
         }
     }
     $this->Cell(array_sum($widths), 0, '', 'T', $table->salto);
     // set document positions
     parent::SetXY(parent::GetX() + $this->separator, parent::GetY());
     if ($absolute_position) {
         $this->last_width = parent::GetX();
     }
     $y = parent::GetY();
     if ($y > $this->last_height) {
         $this->last_height = $y;
     }
 }
开发者ID:kailIII,项目名称:pos-erp,代码行数:97,代码来源:pdf.php

示例12: date


//.........这里部分代码省略.........
        $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
за інформаційні послуги
EOD;
        $pdf->Write(5, $txt, '', 0, 'C', true, 0, false, false, 0, 0);
        // Table Account
开发者ID:AlexChab,项目名称:my_crm,代码行数:67,代码来源:Crm.php

示例13: round

 // Summarize
 $btot = mysql_num_rows(mysql_query("SELECT * FROM `book`"));
 $bdue = mysql_num_rows(mysql_query("SELECT * FROM `" . $r['ntable'] . "`"));
 //$bcek=mysql_num_rows(mysql_query("SELECT * FROM `".$r['ntable']."cek`"));
 $bcekY = mysql_num_rows(mysql_query("SELECT * FROM `" . $r['ntable'] . "` WHERE cek='Y'"));
 $bcekN = $bdue - $bcekY;
 //mysql_num_rows(mysql_query("SELECT * FROM `".$r['ntable']."` WHERE cek='N'"));
 $bcek = $bcekY + $bcekN;
 $bcekYp = round($bcekY * 100 / $bcek, 2);
 $bcekNp = round($bcekN * 100 / $bcek, 2);
 $buli = mysql_num_rows(mysql_query("SELECT * FROM `" . $r['ntable'] . "new`"));
 $pdf->SetFont('dejavusans', '', 8, '', true);
 $pdf->MultiCell(30, 0, 'Stock take name', 0, 'L', 0, 0, '', '', true);
 $pdf->MultiCell(100, 0, ': ' . $r['name'], 0, 'L', 0, 0, '', '', true);
 if ($psum == '1') {
     $pdf->SetX($dcPaperW - 85);
     $pdf->MultiCell(30, 0, 'Total book in list', 0, 'L', 0, 0, '', '', true);
     $pdf->MultiCell(100, 0, ': ' . $btot . ' book' . ($btot > 1 ? 's' : ''), 0, 'L', 0, 1, '', '', true);
 } else {
     $pdf->Ln();
 }
 $pdf->MultiCell(30, 0, 'Stock take date', 0, 'L', 0, 0, '', '', true);
 $pdf->MultiCell(100, 0, ': ' . fftgl($r['date']), 0, 'L', 0, 0, '', '', true);
 if ($psum == '1') {
     $pdf->SetX($dcPaperW - 85);
     $pdf->MultiCell(30, 0, 'Total book checked', 0, 'L', 0, 0, '', '', true);
     $pdf->MultiCell(100, 0, ': ' . $bcekY . " ( " . $bcekYp . " % )" . " book" . ($bcekY > 1 ? "s" : ""), 0, 'L', 0, 1, '', '', true);
 } else {
     $pdf->Ln();
 }
 $pdf->MultiCell(30, 0, 'Finished', 0, 'L', 0, 0, '', '', true);
开发者ID:epiii,项目名称:siadu-epiii,代码行数:31,代码来源:stockreport.php

示例14:

     $pdf->SetXY(67,9+$numefftot*$passo);
     $pdf->SetFont('times','',14);
     $pdf->Cell(60,10,$admin_aziend['citspe'].', '.$datafatt);
     $pdf->SetXY(165,12+$numefftot*$passo);
     $pdf->Cell(67,10,gaz_format_number($effetto['impeff']));
     $pdf->SetXY(85,21+$numefftot*$passo);
     $pdf->Cell(50,10,$scadenza);
     $pdf->SetXY(76,34+$numefftot*$passo);
     $pdf->Cell(120,10,$admin_aziend['ragso1'].' '.$admin_aziend['ragso2']);
     $pdf->SetXY(90,45+$numefftot*$passo);
     $pdf->Cell(140,10,substr($impwords,4,99));
     $pdf->SetXY(5,60+$numefftot*$passo);
     $pdf->SetFont('helvetica','B',7);
     $pdf->Cell(71,6,substr($banapp['descri'],0,34));
     $pdf->Cell(80,6,$client['ragso1'].' '.$client['ragso2'],0,1,'L');
     $pdf->SetX(5);
     $pdf->Cell(71,6,'ABI: '.$banapp['codabi']);
     $pdf->Cell(80,6,$client['codfis'],0,1,'L');
     $pdf->SetX(5);
     $pdf->Cell(71,6,'CAB: '.$banapp['codcab']);
     $pdf->Cell(80,6,$client['indspe'],0,1,'L');
     $pdf->SetX(5);
     $pdf->Cell(71,6,$banapp['locali'].' ('.$banapp['codpro'].')');
     $pdf->Cell(80,6,$client['capspe'].' '.$client['citspe'].' ('.$client['prospe'].')',0,1,'L');
     $pdf->SetXY(5,90+$numefftot*$passo);
     $pdf->Cell(165,4,'Cambiale-tratta n.'.$effetto['progre'].' emessa '.$salcon.$effetto['numfat'].'/'.$effetto['seziva'].' del '.$datafatt.' di € '.$effetto['totfat'],'LTB');
     $pdf->Cell(37,4,'bolli a tergo €  '.gaz_format_number($impbol),'RTB',1,'R');
 break;
 //questo è il modulo delle cambiali tratte
 case "V":
     $calc->payment_taxstamp($effetto['impeff'],$admin_aziend['perbol']);
开发者ID:andreabia,项目名称:gazie,代码行数:31,代码来源:stampa_effett.php

示例15: generateJobOrderReportPDF

    public function generateJobOrderReportPDF()
    {
        /* E_STRICT doesn't like FPDF. */
        $errorReporting = error_reporting();
        error_reporting($errorReporting & ~ E_STRICT);
        include_once('./lib/fpdf/fpdf.php');
        error_reporting($errorReporting);

        // FIXME: Hook?
        $isASP = $_SESSION['CATS']->isASP();

        $unixName = $_SESSION['CATS']->getUnixName();

        $siteName       = $this->getTrimmedInput('siteName', $_GET);
        $companyName    = $this->getTrimmedInput('companyName', $_GET);
        $jobOrderName   = $this->getTrimmedInput('jobOrderName', $_GET);
        $periodLine     = $this->getTrimmedInput('periodLine', $_GET);
        $accountManager = $this->getTrimmedInput('accountManager', $_GET);
        $recruiter      = $this->getTrimmedInput('recruiter', $_GET);
        $notes          = $this->getTrimmedInput('notes', $_GET);

        if (isset($_GET['dataSet']))
        {
            $dataSet = $_GET['dataSet'];
            $dataSet = explode(',', $dataSet);
        }
        else
        {
            $dataSet = array(4, 3, 2, 1);
        }


        /* PDF Font Face. */
        // FIXME: Customizable.
        $fontFace = 'helvetica';
        $pdf=new \TCPDF();
        //$pdf = new FPDF();
        $pdf->AddPage();

        if (!eval(Hooks::get('REPORTS_CUSTOMIZE_JO_REPORT_PRE'))) return;
        $pdf->SetFont($fontFace, 'B', 10);
        if ($isASP && $unixName == 'cognizo')
        {
            /* TODO: MAKE THIS CUSTOMIZABLE FOR EVERYONE. */
            
            $pdf->Image('images/cognizo-logo.jpg', 130, 10, 59, 20);
            $pdf->SetXY(129,27);
            $pdf->Write(5, 'Information Technology Consulting');
        }

        $pdf->SetXY(25, 35);
        $pdf->SetFont($fontFace, 'BU', 14);
        $pdf->Write(5, "Recruiting Summary Report\n");

        $pdf->SetFont($fontFace, '', 10);
        $pdf->SetX(25);
        $pdf->Write(5, DateUtility::getAdjustedDate('l, F d, Y') . "\n\n\n");

        $pdf->SetFont($fontFace, 'B', 10);
        $pdf->SetX(25);
        $pdf->Write(5, 'Company: '. $companyName . "\n");

        $pdf->SetFont($fontFace, '', 10);
        $pdf->SetX(25);
        $pdf->Write(5, 'Position: ' . $jobOrderName . "\n\n");

        $pdf->SetFont($fontFace, '', 10);
        $pdf->SetX(25);
        $pdf->Write(5, 'Period: ' . $periodLine . "\n\n");

        $pdf->SetFont($fontFace, '', 10);
        $pdf->SetX(25);
        $pdf->Write(5, 'Account Manager: ' . $accountManager . "\n");

        $pdf->SetFont($fontFace, '', 10);
        $pdf->SetX(25);
        $pdf->Write(5, 'Recruiter: ' . $recruiter . "\n");

        /* Note that the server is not logged in when getting this file from
         * itself.
         */
        // FIXME: Pass session cookie in URL? Use cURL and send a cookie? I
        //        really don't like this... There has to be a way.
        // FIXME: "could not make seekable" - http://demo.catsone.net/index.php?m=graphs&a=jobOrderReportGraph&data=%2C%2C%2C
        //        in /usr/local/www/catsone.net/data/lib/fpdf/fpdf.php on line 1500
        $URI = CATSUtility::getAbsoluteURI(
            CATSUtility::getIndexName()
            . '?m=graphs&a=jobOrderReportGraph&data='
            . urlencode(implode(',', $dataSet))
        );

        $pdf->Image($URI, 70, 95, 80, 80, 'jpg');

        $pdf->SetXY(25,180);
        $pdf->SetFont($fontFace, '', 10);
        $pdf->Write(5, 'Total Candidates ');
        $pdf->SetTextColor(255, 0, 0);
        $pdf->Write(5, 'Screened');
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Write(5, ' by ' . $siteName . ": \n\n");
//.........这里部分代码省略.........
开发者ID:Hassanj343,项目名称:candidats,代码行数:101,代码来源:ReportsUI.php


注:本文中的TCPDF::SetX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。