Example #1
8
 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 012');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // disable header and footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     // 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();
     $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.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));
     $style3 = array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 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));
     // Line
     $pdf->Text(5, 4, 'Line examples');
     $pdf->Line(5, 10, 80, 30, $style);
     $pdf->Line(5, 10, 5, 30, $style2);
     $pdf->Line(5, 10, 80, 10, $style3);
     // Rect
     $pdf->Text(100, 4, 'Rectangle examples');
     $pdf->Rect(100, 10, 40, 20, 'DF', $style4, array(220, 220, 200));
     $pdf->Rect(145, 10, 40, 20, 'D', array('all' => $style3));
     // Curve
     $pdf->Text(5, 34, 'Curve examples');
     $pdf->Curve(5, 40, 30, 55, 70, 45, 60, 75, null, $style6);
     $pdf->Curve(80, 40, 70, 75, 150, 45, 100, 75, 'F', $style6);
     $pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, 'DF', $style6, array(200, 220, 200));
     // Circle and ellipse
     $pdf->Text(5, 79, 'Circle and ellipse examples');
     $pdf->SetLineStyle($style5);
     $pdf->Circle(25, 105, 20);
     $pdf->Circle(25, 105, 10, 90, 180, null, $style6);
     $pdf->Circle(25, 105, 10, 270, 360, 'F');
     $pdf->Circle(25, 105, 10, 270, 360, 'C', $style6);
     $pdf->SetLineStyle($style5);
     $pdf->Ellipse(100, 103, 40, 20);
     $pdf->Ellipse(100, 105, 20, 10, 0, 90, 180, null, $style6);
     $pdf->Ellipse(100, 105, 20, 10, 0, 270, 360, 'DF', $style6);
     $pdf->SetLineStyle($style5);
     $pdf->Ellipse(175, 103, 30, 15, 45);
     $pdf->Ellipse(175, 105, 15, 7.5, 45, 90, 180, null, $style6);
     $pdf->Ellipse(175, 105, 15, 7.5, 45, 270, 360, 'F', $style6, array(220, 200, 200));
     // Polygon
     $pdf->Text(5, 129, 'Polygon examples');
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
     $pdf->Polygon(array(5, 135, 45, 135, 15, 165));
     $pdf->Polygon(array(60, 135, 80, 135, 80, 155, 70, 165, 50, 155), 'DF', array($style6, $style7, $style7, 0, $style6), array(220, 200, 200));
     $pdf->Polygon(array(120, 135, 140, 135, 150, 155, 110, 155), 'D', array($style6, 0, $style7, $style6));
     $pdf->Polygon(array(160, 135, 190, 155, 170, 155, 200, 160, 160, 165), 'DF', array('all' => $style6), array(220, 220, 220));
     // Polygonal Line
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 164)));
     $pdf->PolyLine(array(80, 165, 90, 160, 100, 165, 110, 160, 120, 165, 130, 160, 140, 165), 'D', array(), array());
     // Regular polygon
     $pdf->Text(5, 169, 'Regular polygon examples');
     $pdf->SetLineStyle($style5);
     $pdf->RegularPolygon(20, 190, 15, 6, 0, 1, 'F');
     $pdf->RegularPolygon(55, 190, 15, 6);
     $pdf->RegularPolygon(55, 190, 10, 6, 45, 0, 'DF', array($style6, 0, $style7, 0, $style7, $style7));
     $pdf->RegularPolygon(90, 190, 15, 3, 0, 1, 'DF', array('all' => $style5), array(200, 220, 200), 'F', array(255, 200, 200));
     $pdf->RegularPolygon(125, 190, 15, 4, 30, 1, null, array('all' => $style5), null, null, $style6);
     $pdf->RegularPolygon(160, 190, 15, 10);
     // Star polygon
     $pdf->Text(5, 209, 'Star polygon examples');
     $pdf->SetLineStyle($style5);
     $pdf->StarPolygon(20, 230, 15, 20, 3, 0, 1, 'F');
     $pdf->StarPolygon(55, 230, 15, 12, 5);
     $pdf->StarPolygon(55, 230, 7, 12, 5, 45, 0, 'DF', array('all' => $style7), array(220, 220, 200), 'F', array(255, 200, 200));
     $pdf->StarPolygon(90, 230, 15, 20, 6, 0, 1, 'DF', array('all' => $style5), array(220, 220, 200), 'F', array(255, 200, 200));
     $pdf->StarPolygon(125, 230, 15, 5, 2, 30, 1, null, array('all' => $style5), null, null, $style6);
     $pdf->StarPolygon(160, 230, 15, 10, 3);
     $pdf->StarPolygon(160, 230, 7, 50, 26);
     // Rounded rectangle
     $pdf->Text(5, 249, 'Rounded rectangle examples');
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
     $pdf->RoundedRect(5, 255, 40, 30, 3.5, '1111', 'DF');
     $pdf->RoundedRect(50, 255, 40, 30, 6.5, '1000');
     $pdf->RoundedRect(95, 255, 40, 30, 10.0, '1111', null, $style6);
     $pdf->RoundedRect(140, 255, 40, 30, 8.0, '0101', 'DF', $style6, array(200, 200, 200));
     // Arrows
     $pdf->Text(185, 249, 'Arrows');
     $pdf->SetLineStyle($style5);
     $pdf->SetFillColor(255, 0, 0);
     $pdf->Arrow(200, 280, 185, 266, 0, 5, 15);
     $pdf->Arrow(200, 280, 190, 263, 1, 5, 15);
     $pdf->Arrow(200, 280, 195, 261, 2, 5, 15);
     $pdf->Arrow(200, 280, 200, 260, 3, 5, 15);
     // - . - . - . - . - . - . - . - . - . - . - . - . - . - . -
     // ellipse
     // add a page
     $pdf->AddPage();
     $pdf->Cell(0, 0, 'Arc of Ellipse');
     // center of ellipse
     $xc = 100;
     $yc = 100;
     // X Y axis
     $pdf->SetDrawColor(200, 200, 200);
     $pdf->Line($xc - 50, $yc, $xc + 50, $yc);
     $pdf->Line($xc, $yc - 50, $xc, $yc + 50);
     // ellipse axis
     $pdf->SetDrawColor(200, 220, 255);
     $pdf->Line($xc - 50, $yc - 50, $xc + 50, $yc + 50);
     $pdf->Line($xc - 50, $yc + 50, $xc + 50, $yc - 50);
     // ellipse
     $pdf->SetDrawColor(200, 255, 200);
     $pdf->Ellipse($xc, $yc, 30, 15, 45, 0, 360, 'D', array(), array(), 2);
     // ellipse arc
     $pdf->SetDrawColor(255, 0, 0);
     $pdf->Ellipse($xc, $yc, 30, 15, 45, 45, 90, 'D', array(), array(), 2);
     $this->comparePdfs($pdf);
 }
Example #2
2
 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 009');
     $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 . ' 009', 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);
     // -------------------------------------------------------------------
     // add a page
     $pdf->AddPage();
     // set JPEG quality
     $pdf->setJPEGQuality(75);
     // Image method signature:
     // Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // Example of Image from data stream ('PHP rules')
     $imgdata = base64_decode('iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABlBMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDrEX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==');
     // The '@' character is used to indicate that follows an image data stream and not an image file name
     $pdf->Image('@' . $imgdata);
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // Image example with resizing
     $pdf->Image('./tests/images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // test fitbox with all alignment combinations
     $horizontal_alignments = array('L', 'C', 'R');
     $vertical_alignments = array('T', 'M', 'B');
     $x = 15;
     $y = 35;
     $w = 30;
     $h = 30;
     // test all combinations of alignments
     for ($i = 0; $i < 3; ++$i) {
         $fitbox = $horizontal_alignments[$i] . ' ';
         $x = 15;
         for ($j = 0; $j < 3; ++$j) {
             $fitbox[1] = $vertical_alignments[$j];
             $pdf->Rect($x, $y, $w, $h, 'F', array(), array(128, 255, 128));
             $pdf->Image('./tests/images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
             $x += 32;
             // new column
         }
         $y += 32;
         // new row
     }
     $x = 115;
     $y = 35;
     $w = 25;
     $h = 50;
     for ($i = 0; $i < 3; ++$i) {
         $fitbox = $horizontal_alignments[$i] . ' ';
         $x = 115;
         for ($j = 0; $j < 3; ++$j) {
             $fitbox[1] = $vertical_alignments[$j];
             $pdf->Rect($x, $y, $w, $h, 'F', array(), array(128, 255, 255));
             $pdf->Image('./tests/images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
             $x += 27;
             // new column
         }
         $y += 52;
         // new row
     }
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // Stretching, position and alignment example
     $pdf->SetXY(110, 200);
     $pdf->Image('./tests/images/image_demo.jpg', '', '', 40, 40, '', '', 'T', false, 300, '', false, false, 1, false, false, false);
     $pdf->Image('./tests/images/image_demo.jpg', '', '', 40, 40, '', '', '', false, 300, '', false, false, 1, false, false, false);
     $this->comparePdfs($pdf);
 }
 /**
  * Draws a filled rectangle at x1,y1 with width w and height h
  *
  * See {@link Style::munge_color()} for the format of the color array.
  *
  * @param float $x1
  * @param float $y1
  * @param float $w
  * @param float $h
  * @param array $color
  */
 function filled_rectangle($x1, $y1, $w, $h, $color, $blend = "Normal", $opacity = 1.0)
 {
     //var_dump($color);
     dompdf_debug("trace", "({$x1}, {$y1}, {$w}, {$h}, [{$color['0']}, {$color['1']}, {$color['2']}], {$blend}, {$opacity})");
     //$this->_set_stroke_color($color);
     //$this->_set_fill_color($color);
     //$this->_set_line_style(1, "square", "miter", array());
     $this->_set_line_transparency($blend, $opacity);
     $this->_set_fill_transparency($blend, $opacity);
     $this->_pdf->Rect($x1, $y1, $w, $h, 'F', $this->_make_line_style($color, 1, "square", "miter", array()), $this->_get_rgb($color));
     //***
 }
Example #4
1
 $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
 // set auto page breaks
 $pdf->SetAutoPageBreak(TRUE, 10);
 // set image scale factor
 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
 $pdf->setFontSubsetting(true);
 $pdf->SetFont('', 'B', 16, '', true);
 $pdf->SetTitle("Mapsurveys (K) LTD. - Payslip");
 $id = $employee->id;
 $basic = $employee->basic_pay;
 $pdf->AddPage();
 $pdf->setColor('fill', 220, 220, 220);
 $pdf->Cell(130, 0, 'SALARY VOUCHER', 0, 1, 'C', true);
 $pdf->SetFont('', 'B', 10);
 $pdf->Ln(9);
 $pdf->Rect(15, 40, 130, 150);
 $dateObj = DateTime::createFromFormat("!m", $month);
 $pdf->Cell(50, 0, "Mapsurveys (K) Limited");
 $pdf->Cell(40, 0, "Month of Pay:");
 $pdf->SetFont('');
 $pdf->Cell(40, 0, $monthName = $dateObj->format('F'));
 $pdf->SetFont('', 'B');
 $pdf->Ln(10);
 $pdf->Cell(15, 0, "Name:");
 $pdf->SetFont('');
 $pdf->Cell(35, 0, $employee->fname[0] . "." . $employee->mname[0] . ". " . $employee->lname);
 $pdf->SetFont('', 'B');
 $pdf->Cell(40, 0, "Date Paid:");
 $pdf->SetFont('');
 $pdf->Cell(40, 0, date("d-M-Y"));
 $pdf->Ln(6);
 /**
  * Draws a filled rectangle at x1,y1 with width w and height h
  *
  * See {@link Style::munge_color()} for the format of the color array.
  *
  * @param float $x1
  * @param float $y1
  * @param float $w
  * @param float $h
  * @param array $color
  */
 function filled_rectangle($x1, $y1, $w, $h, $color, $blend = "Normal", $opacity = 1.0)
 {
     //var_dump($color);
     //dompdf_debug("trace", "($x1, $y1, $w, $h, [$color[0], $color[1], $color[2]], $blend, $opacity)");
     //$this->_set_stroke_color($color);
     //$this->_set_fill_color($color);
     //$this->_set_line_style(1, "square", "miter", array());
     $this->_set_line_transparency($blend, $opacity);
     $this->_set_fill_transparency($blend, $opacity);
     $this->_pdf->Rect($x1, $y1, $w, $h, 'F', $this->_make_line_style($color, 1, "square", "miter", array()), $this->_get_rgb($color));
     //***
 }
Example #6
0
$pdf->MultiCell(40, 5, "D test multicell line 1\ntest multicell line 2\ntest multicell line 3", 1, 'J', 0, 2);
$pdf->MultiCell(40, 5, "E test multicell line 1\ntest multicell line 2\ntest multicell line 3", 1, 'L', 0, 1);
$pdf->MultiCell(40, 5, "F test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line\nF test multicell line", 1, 'L', 0, 1);
// reset pointer to the last page
$pdf->lastPage();
// --- START GRAPHIC TRANFORMATIONS TEST -------------------
// Code Provided by Moritz Wagner and Andreas Würmser
$pdf->setPrintHeader(false);
$pdf->AddPage();
$pdf->Bookmark('Transformations', 0, 0);
$pdf->setPrintFooter(false);
//Scaling
$pdf->Bookmark('Scaling', 1, 4);
$pdf->SetDrawColor(200);
$pdf->SetTextColor(200);
$pdf->Rect(50, 20, 40, 10, 'D');
$pdf->Text(50, 19, 'Scale');
$pdf->SetDrawColor(0);
$pdf->SetTextColor(0);
//Start Transformation
$pdf->StartTransform();
//Scale by 150% centered by (50,30) which is the lower left corner of the rectangle
$pdf->ScaleXY(150, 50, 30);
$pdf->Rect(50, 20, 40, 10, 'D');
$pdf->Text(50, 19, 'Scale');
//Stop Transformation
$pdf->StopTransform();
//Translation
$pdf->Bookmark('Translation', 1, 14);
$pdf->SetDrawColor(200);
$pdf->SetTextColor(200);
Example #7
0
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'BI', 8);
// add a page
$pdf->AddPage();
/*
 * setAlpha() gives transparency support. You can set the 
 * alpha channel from 0 (fully transparent) to 1 (fully 
 * opaque). It applies to all elements (text, drawings, 
 * images).
 */
$pdf->SetLineWidth(1.5);
// draw opaque red square
$pdf->SetFillColor(255, 0, 0);
$pdf->Rect(30, 60, 40, 40, 'DF');
// set alpha to semi-transparency
$pdf->SetAlpha(0.5);
// draw green square
$pdf->SetFillColor(0, 255, 0);
$pdf->Rect(40, 70, 40, 40, 'DF');
// draw jpeg image
$pdf->Image('../images/image_demo.jpg', 50, 80, 40, 40, '', 'http://www.tcpdf.org', '', true, 72);
// restore full opacity
$pdf->SetAlpha(1);
// print name
$pdf->Text(55, 85, 'TRANSPARENCY');
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_025.pdf', 'I');
//============================================================+
Example #8
0
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
//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();
//Scaling
$pdf->SetDrawColor(200);
$pdf->SetTextColor(200);
$pdf->Rect(50, 20, 40, 10, 'D');
$pdf->Text(50, 19, 'Scale');
$pdf->SetDrawColor(0);
$pdf->SetTextColor(0);
//Start Transformation
$pdf->StartTransform();
//Scale by 150% centered by (50,30) which is the lower left corner of the rectangle
$pdf->ScaleXY(150, 50, 30);
$pdf->Rect(50, 20, 40, 10, 'D');
$pdf->Text(50, 19, 'Scale');
//Stop Transformation
$pdf->StopTransform();
//Translation
$pdf->SetDrawColor(200);
$pdf->SetTextColor(200);
$pdf->Rect(125, 20, 40, 10, 'D');
Example #9
0
 else    $cfpiva = '';
 //formatto le date
 $scadenza = substr($effetto['scaden'],8,2).'-'.substr($effetto['scaden'],5,2).'-'.substr($effetto['scaden'],0,4);
 $datafatt = substr($effetto['datfat'],8,2).'-'.substr($effetto['datfat'],5,2).'-'.substr($effetto['datfat'],0,4);
 if ($numefftot == 3)
     {
     $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');
Example #10
0
// check also the following methods:
// SetDrawColorArray()
// SetFillColorArray()
// SetTextColorArray()
// set font
$pdf->SetFont('helvetica', 'B', 18);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of CMYK, RGB and Grayscale colours', '', 0, 'L', true, 0, false, false, 0);
// define style for border
$border_style = array('all' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0));
// --- CMYK ------------------------------------------------
$pdf->SetDrawColor(50, 0, 0, 0);
$pdf->SetFillColor(100, 0, 0, 0);
$pdf->SetTextColor(100, 0, 0, 0);
$pdf->Rect(30, 60, 30, 30, 'DF', $border_style);
$pdf->Text(30, 92, 'Cyan');
$pdf->SetDrawColor(0, 50, 0, 0);
$pdf->SetFillColor(0, 100, 0, 0);
$pdf->SetTextColor(0, 100, 0, 0);
$pdf->Rect(70, 60, 30, 30, 'DF', $border_style);
$pdf->Text(70, 92, 'Magenta');
$pdf->SetDrawColor(0, 0, 50, 0);
$pdf->SetFillColor(0, 0, 100, 0);
$pdf->SetTextColor(0, 0, 100, 0);
$pdf->Rect(110, 60, 30, 30, 'DF', $border_style);
$pdf->Text(110, 92, 'Yellow');
$pdf->SetDrawColor(0, 0, 0, 50);
$pdf->SetFillColor(0, 0, 0, 100);
$pdf->SetTextColor(0, 0, 0, 100);
$pdf->Rect(150, 60, 30, 30, 'DF', $border_style);
Example #11
0
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Graphic Transformations', '', 0, 'C', 1, 0, false, false, 0);
// set font
$pdf->SetFont('helvetica', '', 10);
// --- Scaling ---------------------------------------------
$pdf->SetDrawColor(200);
$pdf->SetTextColor(200);
$pdf->Rect(50, 70, 40, 10, 'D');
$pdf->Text(50, 66, 'Scale');
$pdf->SetDrawColor(0);
$pdf->SetTextColor(0);
// Start Transformation
$pdf->StartTransform();
// Scale by 150% centered by (50,80) which is the lower left corner of the rectangle
$pdf->ScaleXY(150, 50, 80);
$pdf->Rect(50, 70, 40, 10, 'D');
$pdf->Text(50, 66, 'Scale');
// Stop Transformation
$pdf->StopTransform();
// --- Translation -----------------------------------------
$pdf->SetDrawColor(200);
$pdf->SetTextColor(200);
$pdf->Rect(125, 70, 40, 10, 'D');
Example #12
0
$pdf->SetFont("helvetica", "", 10);
$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.5, "cap" => "butt", "join" => "miter", "dash" => 0, "color" => array(255, 0, 0));
$style3 = array("width" => 1, "cap" => "round", "join" => "round", "dash" => "2,10", "color" => array(255, 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, 0, 0));
$style6 = array("width" => 0.5, "cap" => "butt", "join" => "miter", "dash" => "10,10", "color" => array(0, 255, 0));
$style7 = array("width" => 0.5, "cap" => "butt", "join" => "miter", "dash" => 0, "color" => array(200, 200, 0));
// Line
$pdf->Text(5, 7, "Line examples");
$pdf->Line(5, 10, 80, 30, $style);
$pdf->Line(5, 10, 5, 30, $style2);
$pdf->Line(5, 10, 80, 10, $style3);
// Rect
$pdf->Text(100, 7, "Rectangle examples");
$pdf->Rect(100, 10, 40, 20, "DF", $style4, array(220, 220, 200));
$pdf->Rect(145, 10, 40, 20, "D", array("all" => $style3));
// Curve
$pdf->Text(5, 37, "Curve examples");
$pdf->Curve(5, 40, 30, 55, 70, 45, 60, 75, null, $style6);
$pdf->Curve(80, 40, 70, 75, 150, 45, 100, 75, "F", $style6);
$pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, "DF", $style6, array(200, 220, 200));
// Circle and ellipse
$pdf->Text(5, 82, "Circle and ellipse examples");
$pdf->SetLineStyle($style5);
$pdf->Circle(25, 105, 20);
$pdf->Circle(25, 105, 10, 90, 180, null, $style6);
$pdf->Circle(25, 105, 10, 270, 360, "F");
$pdf->Circle(25, 105, 10, 270, 360, "C", $style6);
$pdf->SetLineStyle($style5);
$pdf->Ellipse(100, 105, 40, 20);
Example #13
0
             case 'angle':
                 $pdf->Rotate(-$value, $left, $top);
                 break;
             case 'fill_r':
                 $r = $value;
                 break;
             case 'fill_g':
                 $g = $value;
                 break;
             case 'fill_b':
                 $b = $value;
                 break;
         }
     }
     $pdf->SetFillColor($r, $g, $b);
     $pdf->Rect($left, $top, $width, $height, 'F');
 }
 if ($objects[$i]["type"] == "path") {
     foreach ($objects[$i] as $key => $value) {
         switch ($key) {
             case 'top':
                 $top = $value;
                 break;
             case 'left':
                 $left = $value;
                 break;
             case 'height':
                 $height = $value;
                 break;
             case 'width':
                 $width = $value;
Example #14
0
//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', "B", 12);
// add a page
$pdf->AddPage();
$pdf->SetLineWidth(1);
$pdf->SetDrawColor(50, 0, 0, 0);
$pdf->SetFillColor(100, 0, 0, 0);
$pdf->SetTextColor(100, 0, 0, 0);
$pdf->Rect(30, 60, 20, 20, 'DF');
$pdf->Text(30, 85, 'Cyan');
$pdf->SetDrawColor(0, 50, 0, 0);
$pdf->SetFillColor(0, 100, 0, 0);
$pdf->SetTextColor(0, 100, 0, 0);
$pdf->Rect(60, 60, 20, 20, 'DF');
$pdf->Text(60, 85, 'Magenta');
$pdf->SetDrawColor(0, 0, 50, 0);
$pdf->SetFillColor(0, 0, 100, 0);
$pdf->SetTextColor(0, 0, 100, 0);
$pdf->Rect(90, 60, 20, 20, 'DF');
$pdf->Text(90, 85, 'Yellow');
$pdf->SetDrawColor(0, 0, 0, 50);
$pdf->SetFillColor(0, 0, 0, 100);
$pdf->SetTextColor(0, 0, 0, 100);
$pdf->Rect(120, 60, 20, 20, 'DF');
Example #15
0
    <td width="336"><p align="center">________________________________________</p>
    </td>
    <td width="320"><p align="center">________________________________________</p>
    </td>
  </tr>
  <tr>
    <td><div align="center">{$Aval1} - {$VarAval1}</div></td>
    <td><div align="center">{$Aval2} - {$VarAval2}</div></td>
  </tr>  
  <tr>
    <td colspan="2"><div align="center">
      <p align="justify">Este pagaré si no fuera pagado a su vencimiento causará INTERESES  a razón 1.00% MENSUAL por todo el tiempo que dure insoluto y está sujeto a COBRO  ANTICIPADO del saldo al no ser con PUNTUALIDAD cualquier abono especifico en  las CONDICIONES DEL CONTRATO.</p>
    </div>      </td>
  </tr>
</table>
EOD;
$pdf->writeHTML($tb12, true, false, false, false, '');
//ºººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººº
$pdf->SetDrawColor(10);
//                   tamaño
//          x         x  y
$pdf->Rect(10, 40, 190, 90, 'D');
$pdf->SetDrawColor(0);
$pdf->SetDrawColor(10);
//                   tamaño
//          x         x  y
$pdf->Rect(10, 165, 190, 90, 'D');
$pdf->SetDrawColor(0);
//$pdf->RoundedRect(5, 255, 40, 30, 3.50, '1111', 'DF');
//Close and output PDF document
$pdf->Output('solicitud.pdf', 'I');
Example #16
0
// Define some new spot colors
// $c, $m, $y and $k (2nd, 3rd, 4th and 5th parameter) are the CMYK color components.
// AddSpotColor($name, $c, $m, $y, $k)
$pdf->AddSpotColor('My TCPDF Dark Green', 100, 50, 80, 45);
$pdf->AddSpotColor('My TCPDF Light Yellow', 0, 0, 55, 0);
// Select the spot color
// $tint (the second parameter) is the intensity of the color (0-100).
// SetTextSpotColor($name, $tint=100)
// SetDrawSpotColor($name, $tint=100)
// SetFillSpotColor($name, $tint=100)
$pdf->SetTextSpotColor('My TCPDF Black', 100);
$pdf->SetDrawSpotColor('My TCPDF Black', 100);
$starty = 100;
// print some spot colors
$pdf->SetFillSpotColor('My TCPDF Dark Green', 100);
$pdf->Rect(30, $starty, 40, 20, 'DF');
$pdf->Text(73, $starty + 8, 'My TCPDF Dark Green');
$starty += 24;
$pdf->SetFillSpotColor('My TCPDF Light Yellow', 100);
$pdf->Rect(30, $starty, 40, 20, 'DF');
$pdf->Text(73, $starty + 8, 'My TCPDF Light Yellow');
// --- default values defined on spotcolors.php ---
$starty += 24;
$pdf->SetFillSpotColor('My TCPDF Red', 100);
$pdf->Rect(30, $starty, 40, 20, 'DF');
$pdf->Text(73, $starty + 8, 'My TCPDF Red');
$starty += 24;
$pdf->SetFillSpotColor('My TCPDF Green', 100);
$pdf->Rect(30, $starty, 40, 20, 'DF');
$pdf->Text(73, $starty + 8, 'My TCPDF Green');
$starty += 24;
Example #17
0
/**
 * 图片
 */
function pdf_seven()
{
    require_once 'tcpdf.php';
    // 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 009');
    $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 . ' 009', 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)
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    // -------------------------------------------------------------------
    // add a page
    $pdf->AddPage();
    // set JPEG quality
    $pdf->setJPEGQuality(75);
    // Image method signature:
    // Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // Example of Image from data stream ('PHP rules')
    $imgdata = base64_decode('iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABlBMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDrEX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==');
    // The '@' character is used to indicate that follows an image data stream and not an image file name
    $pdf->Image('@' . $imgdata);
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // Image example with resizing
    $pdf->Image('examples/images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // test fitbox with all alignment combinations
    $horizontal_alignments = array('L', 'C', 'R');
    $vertical_alignments = array('T', 'M', 'B');
    $x = 15;
    $y = 35;
    $w = 30;
    $h = 30;
    // test all combinations of alignments
    for ($i = 0; $i < 3; ++$i) {
        $fitbox = $horizontal_alignments[$i] . ' ';
        $x = 15;
        for ($j = 0; $j < 3; ++$j) {
            $fitbox[1] = $vertical_alignments[$j];
            $pdf->Rect($x, $y, $w, $h, 'F', array(), array(128, 255, 128));
            $pdf->Image('examples/images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
            $x += 32;
            // new column
        }
        $y += 32;
        // new row
    }
    $x = 115;
    $y = 35;
    $w = 25;
    $h = 50;
    for ($i = 0; $i < 3; ++$i) {
        $fitbox = $horizontal_alignments[$i] . ' ';
        $x = 115;
        for ($j = 0; $j < 3; ++$j) {
            $fitbox[1] = $vertical_alignments[$j];
            $pdf->Rect($x, $y, $w, $h, 'F', array(), array(128, 255, 255));
            $pdf->Image('examples/images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
            $x += 27;
            // new column
        }
        $y += 52;
        // new row
    }
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // Stretching, position and alignment example
    $pdf->SetXY(110, 200);
    $pdf->Image('examples/images/image_demo.jpg', '', '', 40, 40, '', '', 'T', false, 300, '', false, false, 1, false, false, false);
    $pdf->Image('examples/images/image_demo.jpg', '', '', 40, 40, '', '', '', false, 300, '', false, false, 1, false, false, false);
    // -------------------------------------------------------------------
    //饼状图
    // add a page
    $pdf->AddPage();
    $pdf->Write(0, 'Example of PieSector() method.');
    $xc = 105;
    $yc = 100;
    $r = 50;
    $pdf->SetFillColor(0, 0, 255);
    $pdf->PieSector($xc, $yc, $r, 20, 120, 'FD', false, 0, 2);
    $pdf->SetFillColor(0, 255, 0);
    $pdf->PieSector($xc, $yc, $r, 120, 250, 'FD', false, 0, 2);
    $pdf->SetFillColor(255, 0, 0);
    $pdf->PieSector($xc, $yc, $r, 250, 20, 'FD', false, 0, 2);
    // write labels
    $pdf->Text(105, 65, 'BLUE11');
    $pdf->Text(60, 95, 'GREEN');
    $pdf->Text(120, 115, 'RED');
    //二维码
    // add a page
    $pdf->AddPage();
    // print a message
    $txt = "You can also export 2D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcode directory.\n";
    $pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // set style for barcode
    $style = array('border' => true, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1);
    // write RAW 2D Barcode
    $code = '111011101110111,010010001000010,010011001110010,010010000010010,010011101110010';
    $pdf->write2DBarcode($code, 'RAW', 80, 30, 30, 20, $style, 'N');
    // write RAW2 2D Barcode
    $code = '[111011101110111][010010001000010][010011001110010][010010000010010][010011101110010]';
    $pdf->write2DBarcode($code, 'RAW2', 80, 60, 30, 20, $style, 'N');
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // set style for barcode
    $style = array('border' => 2, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1);
    // QRCODE,L : QR-CODE Low error correction
    $pdf->write2DBarcode('你好!哈哈', 'QRCODE,L', 20, 30, 50, 50, $style, 'N');
    $pdf->Text(20, 25, 'QRCODE L');
    // QRCODE,M : QR-CODE Medium error correction
    $pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,M', 20, 90, 50, 50, $style, 'N');
    $pdf->Text(20, 85, 'QRCODE M');
    // QRCODE,Q : QR-CODE Better error correction
    $pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,Q', 20, 150, 50, 50, $style, 'N');
    $pdf->Text(20, 145, 'QRCODE Q');
    // QRCODE,H : QR-CODE Best error correction
    $pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 20, 210, 50, 50, $style, 'N');
    $pdf->Text(20, 205, 'QRCODE H');
    // -------------------------------------------------------------------
    // PDF417 (ISO/IEC 15438:2006)
    /*
     The $type parameter can be simple 'PDF417' or 'PDF417' followed by a
     number of comma-separated options:
     'PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6'
     Possible options are:
     	a  = aspect ratio (width/height);
     	e  = error correction level (0-8);
     	Macro Control Block options:
     	t  = total number of macro segments;
     	s  = macro segment index (0-99998);
     	f  = file ID;
     	o0 = File Name (text);
     	o1 = Segment Count (numeric);
     	o2 = Time Stamp (numeric);
     	o3 = Sender (text);
     	o4 = Addressee (text);
     	o5 = File Size (numeric);
     	o6 = Checksum (numeric).
     Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional.
     To use a comma character ',' on text options, replace it with the character 255: "\xff".
    */
    $pdf->write2DBarcode('www.tcpdf.org', 'PDF417', 80, 90, 0, 30, $style, 'N');
    $pdf->Text(80, 85, 'PDF417 (ISO/IEC 15438:2006)');
    // -------------------------------------------------------------------
    // DATAMATRIX (ISO/IEC 16022:2006)
    $pdf->write2DBarcode('http://www.tcpdf.org', 'DATAMATRIX', 80, 150, 50, 50, $style, 'N');
    $pdf->Text(80, 145, 'DATAMATRIX (ISO/IEC 16022:2006)');
    // -------------------------------------------------------------------
    // new style
    $style = array('border' => 2, 'padding' => 'auto', 'fgcolor' => array(0, 0, 255), 'bgcolor' => array(255, 255, 64));
    // QRCODE,H : QR-CODE Best error correction
    $pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 80, 210, 50, 50, $style, 'N');
    $pdf->Text(80, 205, 'QRCODE H - COLORED');
    // new style
    $style = array('border' => false, 'padding' => 0, 'fgcolor' => array(128, 0, 0), 'bgcolor' => false);
    // QRCODE,H : QR-CODE Best error correction
    $pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 140, 210, 50, 50, $style, 'N');
    $pdf->Text(140, 205, 'QRCODE H - NO PADDING');
    //Close and output PDF document
    $pdf->Output('example.pdf', 'I');
}
Example #18
0
 public function display($arraydata, $y_axis = 0, $fielddata = false)
 {
     //print_r($arraydata);echo "<br/>";
     //    $this->pdf->Cell(10,10,"SSSS");
     $this->Rotate($arraydata["rotation"]);
     if ($arraydata["rotation"] != "") {
         if ($arraydata["rotation"] == "Left") {
             $w = $arraydata["width"];
             $arraydata["width"] = $arraydata["height"];
             $arraydata["height"] = $w;
             $this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY());
         } elseif ($arraydata["rotation"] == "Right") {
             $w = $arraydata["width"];
             $arraydata["width"] = $arraydata["height"];
             $arraydata["height"] = $w;
             $this->pdf->SetXY($this->pdf->GetX(), $this->pdf->GetY() - $arraydata["height"]);
         } elseif ($arraydata["rotation"] == "UpsideDown") {
             //soverflow"=>$stretchoverflow,"poverflow"
             $arraydata["soverflow"] = true;
             $arraydata["poverflow"] = true;
             //   $w=$arraydata["width"];
             // $arraydata["width"]=$arraydata["height"];
             //$arraydata["height"]=$w;
             $this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY() - $arraydata["height"]);
         }
     }
     if ($arraydata["type"] == "SetFont") {
         if ($arraydata["font"] == 'uGB') {
             $this->pdf->isUnicode = true;
         } else {
             $this->pdf->isUnicode = false;
         }
         $this->pdf->SetFont($arraydata["font"], $arraydata["fontstyle"], $arraydata["fontsize"]);
     } elseif ($arraydata["type"] == "subreport") {
         $this->runSubReport($arraydata);
     } elseif ($arraydata["type"] == "MultiCell") {
         $currenty = $this->pdf->GetY();
         if ($fielddata == false) {
             if ($this->allowprintuntill >= $currenty) {
                 $this->checkoverflow($arraydata, $this->updatePageNo($arraydata["txt"]));
             }
         } elseif ($fielddata == true) {
             if ($this->allowprintuntill >= $currenty) {
                 $this->checkoverflow($arraydata, $this->updatePageNo($this->analyse_expression($arraydata["txt"], $arraydata["isPrintRepeatedValues"])));
             } elseif ($this->parentcurrentband == "detail") {
                 $this->pdf->Cell(40, 10, "SADSD");
             }
             //                  echo $arraydata["txt"]."+\"|(".$y_axis.",".print_r($arraydata,true)."),$this->allowprintuntill,$newy\"<br/><br/>";
         }
     } elseif ($arraydata["type"] == "SetXY") {
         $this->pdf->SetXY($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis);
     } elseif ($arraydata["type"] == "Cell") {
         $currenty = $this->pdf->GetY();
         if ($this->allowprintuntill >= $currenty) {
             $this->pdf->Cell($arraydata["width"], $arraydata["height"], $this->updatePageNo($arraydata["txt"]), $arraydata["border"], $arraydata["ln"], $arraydata["align"], $arraydata["fill"], $arraydata["link"]);
         } elseif ($this->parentcurrentband == "detail") {
             $this->pdf->Cell(40, 10, "SADSD");
         }
     } elseif ($arraydata["type"] == "Rect") {
         $this->pdf->Rect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"]);
     } elseif ($arraydata["type"] == "Image") {
         $path = $this->analyse_expression($arraydata["path"]);
         $imgtype = substr($path, -3);
         if ($imgtype == 'jpg' || right($path, 3) == 'jpg' || right($path, 4) == 'jpeg') {
             $imgtype = "JPEG";
         } elseif ($imgtype == 'png' || $imgtype == 'PNG') {
             $imgtype = "PNG";
         }
         if (file_exists($path) || left($path, 4) == 'http') {
             $this->pdf->Image($path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
         } elseif (left($path, 22) == "data:image/jpeg;base64") {
             $imgtype = "JPEG";
             $img = str_replace('data:image/jpeg;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"]);
             //,$imgtype,$arraydata["link"]);
         } elseif (left($path, 22) == "data:image/png;base64,") {
             $imgtype = "PNG";
             // $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
             $img = str_replace('data:image/png;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"]);
             //,$imgtype,$arraydata["link"]);
         }
     } elseif ($arraydata["type"] == "SetTextColor") {
         $this->pdf->SetTextColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "SetDrawColor") {
         $this->pdf->SetDrawColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "SetLineWidth") {
         $this->pdf->SetLineWidth($arraydata["width"]);
     } elseif ($arraydata["type"] == "Line") {
         $this->pdf->Line($arraydata["x1"] + $this->arrayPageSetting["leftMargin"], $arraydata["y1"] + $y_axis, $arraydata["x2"] + $this->arrayPageSetting["leftMargin"], $arraydata["y2"] + $y_axis);
     } elseif ($arraydata["type"] == "SetFillColor") {
         $this->pdf->SetFillColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "lineChart") {
         $this->showLineChart($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "barChart") {
         $this->showBarChart($arraydata, $y_axis, 'barChart');
     } elseif ($arraydata["type"] == "stackedBarChart") {
         $this->showBarChart($arraydata, $y_axis, 'stackedBarChart');
     } elseif ($arraydata["type"] == "stackedAreaChart") {
         $this->showAreaChart($arraydata, $y_axis, $arraydata["type"]);
     } elseif ($arraydata["type"] == "Barcode") {
         $this->showBarcode($arraydata, $y_axis);
     }
 }
Example #19
0
 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 037');
     $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 . ' 037', 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', '', 11);
     // add a page
     $pdf->AddPage();
     $html = '<h1>Example of Spot Colors</h1>Spot colors are single ink colors, rather than colors produced by four (CMYK), six (CMYKOG) or more inks in the printing process (process colors). They can be obtained by special vendors, but often the printers have found their own way of mixing inks to match defined colors.<br /><br />As long as no open standard for spot colours exists, TCPDF users will have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly into the $spotcolor array in <b><em>include/tcpdf_colors.php</em></b> file, or define them using the <b><em>AddSpotColor()</em></b> method.<br /><br />Common industry standard spot colors are:<br /><span color="#008800">ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH</span>.';
     // Print text using writeHTMLCell()
     $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, 'J', true);
     $pdf->SetFont('helvetica', '', 10);
     // Define some new spot colors
     // $c, $m, $y and $k (2nd, 3rd, 4th and 5th parameter) are the CMYK color components.
     // AddSpotColor($name, $c, $m, $y, $k)
     $pdf->AddSpotColor('My TCPDF Dark Green', 100, 50, 80, 45);
     $pdf->AddSpotColor('My TCPDF Light Yellow', 0, 0, 55, 0);
     $pdf->AddSpotColor('My TCPDF Black', 0, 0, 0, 100);
     $pdf->AddSpotColor('My TCPDF Red', 30, 100, 90, 10);
     $pdf->AddSpotColor('My TCPDF Green', 100, 30, 100, 0);
     $pdf->AddSpotColor('My TCPDF Blue', 100, 60, 10, 5);
     $pdf->AddSpotColor('My TCPDF Yellow', 0, 20, 100, 0);
     // Select the spot color
     // $tint (the second parameter) is the intensity of the color (0-100).
     // SetTextSpotColor($name, $tint=100)
     // SetDrawSpotColor($name, $tint=100)
     // SetFillSpotColor($name, $tint=100)
     $pdf->SetTextSpotColor('My TCPDF Black', 100);
     $pdf->SetDrawSpotColor('My TCPDF Black', 100);
     $starty = 100;
     // print some spot colors
     $pdf->SetFillSpotColor('My TCPDF Dark Green', 100);
     $pdf->Rect(30, $starty, 40, 20, 'DF');
     $pdf->Text(73, $starty + 8, 'My TCPDF Dark Green');
     $starty += 24;
     $pdf->SetFillSpotColor('My TCPDF Light Yellow', 100);
     $pdf->Rect(30, $starty, 40, 20, 'DF');
     $pdf->Text(73, $starty + 8, 'My TCPDF Light Yellow');
     // --- default values defined on spotcolors.php ---
     $starty += 24;
     $pdf->SetFillSpotColor('My TCPDF Red', 100);
     $pdf->Rect(30, $starty, 40, 20, 'DF');
     $pdf->Text(73, $starty + 8, 'My TCPDF Red');
     $starty += 24;
     $pdf->SetFillSpotColor('My TCPDF Green', 100);
     $pdf->Rect(30, $starty, 40, 20, 'DF');
     $pdf->Text(73, $starty + 8, 'My TCPDF Green');
     $starty += 24;
     $pdf->SetFillSpotColor('My TCPDF Blue', 100);
     $pdf->Rect(30, $starty, 40, 20, 'DF');
     $pdf->Text(73, $starty + 8, 'My TCPDF Blue');
     $starty += 24;
     $pdf->SetFillSpotColor('My TCPDF Yellow', 100);
     $pdf->Rect(30, $starty, 40, 20, 'DF');
     $pdf->Text(73, $starty + 8, 'My TCPDF Yellow');
     $this->comparePdfs($pdf);
 }
Example #20
0
 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 022');
     $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 . ' 022', 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);
     // ---------------------------------------------------------
     // check also the following methods:
     // SetDrawColorArray()
     // SetFillColorArray()
     // SetTextColorArray()
     // set font
     $pdf->SetFont('helvetica', 'B', 18);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Example of CMYK, RGB and Grayscale colours', '', 0, 'L', true, 0, false, false, 0);
     // define style for border
     $border_style = array('all' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0));
     // --- CMYK ------------------------------------------------
     $pdf->SetDrawColor(50, 0, 0, 0);
     $pdf->SetFillColor(100, 0, 0, 0);
     $pdf->SetTextColor(100, 0, 0, 0);
     $pdf->Rect(30, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(30, 92, 'Cyan');
     $pdf->SetDrawColor(0, 50, 0, 0);
     $pdf->SetFillColor(0, 100, 0, 0);
     $pdf->SetTextColor(0, 100, 0, 0);
     $pdf->Rect(70, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(70, 92, 'Magenta');
     $pdf->SetDrawColor(0, 0, 50, 0);
     $pdf->SetFillColor(0, 0, 100, 0);
     $pdf->SetTextColor(0, 0, 100, 0);
     $pdf->Rect(110, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(110, 92, 'Yellow');
     $pdf->SetDrawColor(0, 0, 0, 50);
     $pdf->SetFillColor(0, 0, 0, 100);
     $pdf->SetTextColor(0, 0, 0, 100);
     $pdf->Rect(150, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(150, 92, 'Black');
     // --- RGB -------------------------------------------------
     $pdf->SetDrawColor(255, 127, 127);
     $pdf->SetFillColor(255, 0, 0);
     $pdf->SetTextColor(255, 0, 0);
     $pdf->Rect(30, 110, 30, 30, 'DF', $border_style);
     $pdf->Text(30, 142, 'Red');
     $pdf->SetDrawColor(127, 255, 127);
     $pdf->SetFillColor(0, 255, 0);
     $pdf->SetTextColor(0, 255, 0);
     $pdf->Rect(70, 110, 30, 30, 'DF', $border_style);
     $pdf->Text(70, 142, 'Green');
     $pdf->SetDrawColor(127, 127, 255);
     $pdf->SetFillColor(0, 0, 255);
     $pdf->SetTextColor(0, 0, 255);
     $pdf->Rect(110, 110, 30, 30, 'DF', $border_style);
     $pdf->Text(110, 142, 'Blue');
     // --- GRAY ------------------------------------------------
     $pdf->SetDrawColor(191);
     $pdf->SetFillColor(127);
     $pdf->SetTextColor(127);
     $pdf->Rect(30, 160, 30, 30, 'DF', $border_style);
     $pdf->Text(30, 192, 'Gray');
     $this->comparePdfs($pdf);
 }
Example #21
0
 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 013');
     $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 . ' 013', 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', 'B', 20);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Graphic Transformations', '', 0, 'C', 1, 0, false, false, 0);
     // set font
     $pdf->SetFont('helvetica', '', 10);
     // --- Scaling ---------------------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(50, 70, 40, 10, 'D');
     $pdf->Text(50, 66, 'Scale');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // Scale by 150% centered by (50,80) which is the lower left corner of the rectangle
     $pdf->ScaleXY(150, 50, 80);
     $pdf->Rect(50, 70, 40, 10, 'D');
     $pdf->Text(50, 66, 'Scale');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Translation -----------------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(125, 70, 40, 10, 'D');
     $pdf->Text(125, 66, 'Translate');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // Translate 7 to the right, 5 to the bottom
     $pdf->Translate(7, 5);
     $pdf->Rect(125, 70, 40, 10, 'D');
     $pdf->Text(125, 66, 'Translate');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Rotation --------------------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(70, 100, 40, 10, 'D');
     $pdf->Text(70, 96, 'Rotate');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // Rotate 20 degrees counter-clockwise centered by (70,110) which is the lower left corner of the rectangle
     $pdf->Rotate(20, 70, 110);
     $pdf->Rect(70, 100, 40, 10, 'D');
     $pdf->Text(70, 96, 'Rotate');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Skewing ---------------------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(125, 100, 40, 10, 'D');
     $pdf->Text(125, 96, 'Skew');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // skew 30 degrees along the x-axis centered by (125,110) which is the lower left corner of the rectangle
     $pdf->SkewX(30, 125, 110);
     $pdf->Rect(125, 100, 40, 10, 'D');
     $pdf->Text(125, 96, 'Skew');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Mirroring horizontally ------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(70, 130, 40, 10, 'D');
     $pdf->Text(70, 126, 'MirrorH');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // mirror horizontally with axis of reflection at x-position 70 (left side of the rectangle)
     $pdf->MirrorH(70);
     $pdf->Rect(70, 130, 40, 10, 'D');
     $pdf->Text(70, 126, 'MirrorH');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Mirroring vertically --------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(125, 130, 40, 10, 'D');
     $pdf->Text(125, 126, 'MirrorV');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // mirror vertically with axis of reflection at y-position 140 (bottom side of the rectangle)
     $pdf->MirrorV(140);
     $pdf->Rect(125, 130, 40, 10, 'D');
     $pdf->Text(125, 126, 'MirrorV');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Point reflection ------------------------------------
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(70, 160, 40, 10, 'D');
     $pdf->Text(70, 156, 'MirrorP');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     // Start Transformation
     $pdf->StartTransform();
     // point reflection at the lower left point of rectangle
     $pdf->MirrorP(70, 170);
     $pdf->Rect(70, 160, 40, 10, 'D');
     $pdf->Text(70, 156, 'MirrorP');
     // Stop Transformation
     $pdf->StopTransform();
     // --- Mirroring against a straigth line described by a point (120, 120) and an angle -20°
     $angle = -20;
     $px = 120;
     $py = 170;
     // just for visualisation: the straight line to mirror against
     $pdf->SetDrawColor(200);
     $pdf->Line($px - 1, $py - 1, $px + 1, $py + 1);
     $pdf->Line($px - 1, $py + 1, $px + 1, $py - 1);
     $pdf->StartTransform();
     $pdf->Rotate($angle, $px, $py);
     $pdf->Line($px - 5, $py, $px + 60, $py);
     $pdf->StopTransform();
     $pdf->SetDrawColor(200);
     $pdf->SetTextColor(200);
     $pdf->Rect(125, 160, 40, 10, 'D');
     $pdf->Text(125, 156, 'MirrorL');
     $pdf->SetDrawColor(0);
     $pdf->SetTextColor(0);
     //Start Transformation
     $pdf->StartTransform();
     //mirror against the straight line
     $pdf->MirrorL($angle, $px, $py);
     $pdf->Rect(125, 160, 40, 10, 'D');
     $pdf->Text(125, 156, 'MirrorL');
     //Stop Transformation
     $pdf->StopTransform();
     $this->comparePdfs($pdf);
 }
Example #22
0
$pdf->AddSpotColor('Pantone 567 C', 100, 50, 80, 45);
$pdf->AddSpotColor('Pantone 9060 C', 0, 0, 7, 0);
$pdf->AddSpotColor('Pantone 420 C', 22, 14, 22, 0);
$pdf->AddSpotColor('Pantone 422 C', 39, 24, 34, 0);
$pdf->AddSpotColor('Pantone 433 C', 34, 0, 0, 94);
$pdf->AddSpotColor('NovaSpace-Black', 50, 0, 0, 100);
$pdf->AddSpotColor('Pantone 601 C', 0, 0, 55, 0);
$pdf->AddSpotColor('Pantone 659 C', 50, 20, 0, 10);
// select the spot color
// where tint (the second parameter) is the intensity of the color (full intensity by default).
$pdf->SetTextSpotColor('NovaSpace-Black', 100);
$pdf->SetDrawSpotColor('NovaSpace-Black', 100);
$starty = 30;
// print some spot colors
$pdf->SetFillSpotColor('Pantone 116 C', 100);
$pdf->Rect(30, $starty, 20, 6, 'DF');
$pdf->Text(53, $starty + 4, 'Pantone 116 C');
$starty += 8;
$pdf->SetFillSpotColor('HKS 16 K', 100);
$pdf->Rect(30, $starty, 20, 6, 'DF');
$pdf->Text(53, $starty + 4, 'HKS 16 K');
$starty += 8;
$pdf->SetFillSpotColor('Pantone 505 C', 100);
$pdf->Rect(30, $starty, 20, 6, 'DF');
$pdf->Text(53, $starty + 4, 'Pantone 505 C');
$starty += 8;
$pdf->SetFillSpotColor('Pantone 440 C', 100);
$pdf->Rect(30, $starty, 20, 6, 'DF');
$pdf->Text(53, $starty + 4, 'Pantone 440 C');
$starty += 8;
$pdf->SetFillSpotColor('Pantone 288 C', 100);
Example #23
0
    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");

        $pdf->SetX(25);
        $pdf->SetFont($fontFace, '', 10);
        $pdf->Write(5, 'Total Candidates ');
        $pdf->SetTextColor(0, 125, 0);
        $pdf->Write(5, 'Submitted');
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Write(5, ' to ' . $companyName . ": \n\n");

        $pdf->SetX(25);
        $pdf->SetFont($fontFace, '', 10);
        $pdf->Write(5, 'Total Candidates ');
        $pdf->SetTextColor(0, 0, 255);
        $pdf->Write(5, 'Interviewed');
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Write(5, ' by ' . $companyName . ": \n\n");

        $pdf->SetX(25);
        $pdf->SetFont($fontFace, '', 10);
        $pdf->Write(5, 'Total Candidates ');
        $pdf->SetTextColor(255, 75, 0);
        $pdf->Write(5, 'Placed');
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Write(5, ' at ' . $companyName . ": \n\n\n");

        if ($notes != '')
        {
            $pdf->SetX(25);
            $pdf->SetFont($fontFace, '', 10);
            $pdf->Write(5, "Notes:\n");

            $len = strlen($notes);
            $maxChars = 70;

            $pdf->SetLeftMargin(25);
            $pdf->SetRightMargin(25);
            $pdf->SetX(25);
            $pdf->Write(5, $notes . "\n");
        }

        $pdf->SetXY(165, 180);
        $pdf->SetFont($fontFace, 'B', 10);
        $pdf->Write(5, $dataSet[0] . "\n\n");
        $pdf->SetX(165);
        $pdf->Write(5, $dataSet[1] . "\n\n");
        $pdf->SetX(165);
        $pdf->Write(5, $dataSet[2] . "\n\n");
        $pdf->SetX(165);
        $pdf->Write(5, $dataSet[3] . "\n\n");

        $pdf->Rect(3, 6, 204, 285);

        if (!eval(Hooks::get('REPORTS_CUSTOMIZE_JO_REPORT_POST'))) return;

        $pdf->Output();
        die();
    }
Example #24
0
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
$txt = 'You can set the transparency of PDF objects using the setAlpha() method.';
$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
/*
 * setAlpha() gives transparency support. You can set the
 * alpha channel from 0 (fully transparent) to 1 (fully
 * opaque). It applies to all elements (text, drawings,
 * images).
 */
$pdf->SetLineWidth(2);
// draw opaque red square
$pdf->SetFillColor(255, 0, 0);
$pdf->SetDrawColor(127, 0, 0);
$pdf->Rect(30, 40, 60, 60, 'DF');
// set alpha to semi-transparency
$pdf->SetAlpha(0.5);
// draw green square
$pdf->SetFillColor(0, 255, 0);
$pdf->SetDrawColor(0, 127, 0);
$pdf->Rect(50, 60, 60, 60, 'DF');
// draw blue square
$pdf->SetFillColor(0, 0, 255);
$pdf->SetDrawColor(0, 0, 127);
$pdf->Rect(70, 80, 60, 60, 'DF');
// draw jpeg image
$pdf->Image('images/image_demo.jpg', 90, 100, 60, 60, '', 'http://www.tcpdf.org', '', true, 72);
// restore full opacity
$pdf->SetAlpha(1);
// ---------------------------------------------------------
Example #25
0
 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 025');
     $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 . ' 025', 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', '', 12);
     // add a page
     $pdf->AddPage();
     $txt = 'You can set the transparency of PDF objects using the setAlpha() method.';
     $pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
     /*
      * setAlpha() gives transparency support. You can set the
      * alpha channel from 0 (fully transparent) to 1 (fully
      * opaque). It applies to all elements (text, drawings,
      * images).
      */
     $pdf->SetLineWidth(2);
     // draw opaque red square
     $pdf->SetFillColor(255, 0, 0);
     $pdf->SetDrawColor(127, 0, 0);
     $pdf->Rect(30, 40, 60, 60, 'DF');
     // set alpha to semi-transparency
     $pdf->SetAlpha(0.5);
     // draw green square
     $pdf->SetFillColor(0, 255, 0);
     $pdf->SetDrawColor(0, 127, 0);
     $pdf->Rect(50, 60, 60, 60, 'DF');
     // draw blue square
     $pdf->SetFillColor(0, 0, 255);
     $pdf->SetDrawColor(0, 0, 127);
     $pdf->Rect(70, 80, 60, 60, 'DF');
     // draw jpeg image
     $pdf->Image('tests/images/image_demo.jpg', 90, 100, 60, 60, '', 'http://www.tcpdf.org', '', true, 72);
     // restore full opacity
     $pdf->SetAlpha(1);
     $this->comparePdfs($pdf);
 }
Example #26
0
$pdf->Image('images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// test fitbox with all alignment combinations
$horizontal_alignments = array('L', 'C', 'R');
$vertical_alignments = array('T', 'M', 'B');
$x = 15;
$y = 35;
$w = 30;
$h = 30;
// test all combinations of alignments
for ($i = 0; $i < 3; ++$i) {
    $fitbox = $horizontal_alignments[$i] . ' ';
    $x = 15;
    for ($j = 0; $j < 3; ++$j) {
        $fitbox[1] = $vertical_alignments[$j];
        $pdf->Rect($x, $y, $w, $h, 'F', array(), array(128, 255, 128));
        $pdf->Image('images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
        $x += 32;
        // new column
    }
    $y += 32;
    // new row
}
$x = 115;
$y = 35;
$w = 25;
$h = 50;
for ($i = 0; $i < 3; ++$i) {
    $fitbox = $horizontal_alignments[$i] . ' ';
    $x = 115;
    for ($j = 0; $j < 3; ++$j) {
Example #27
0
$pdf->AddPage();
$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.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));
$style3 = array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 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));
// Line
$pdf->Text(5, 7, 'Line examples');
$pdf->Line(5, 10, 80, 30, $style);
$pdf->Line(5, 10, 5, 30, $style2);
$pdf->Line(5, 10, 80, 10, $style3);
// Rect
$pdf->Text(100, 7, 'Rectangle examples');
$pdf->Rect(100, 10, 40, 20, 'DF', $style4, array(220, 220, 200));
$pdf->Rect(145, 10, 40, 20, 'D', array('all' => $style3));
// Curve
$pdf->Text(5, 37, 'Curve examples');
$pdf->Curve(5, 40, 30, 55, 70, 45, 60, 75, null, $style6);
$pdf->Curve(80, 40, 70, 75, 150, 45, 100, 75, 'F', $style6);
$pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, 'DF', $style6, array(200, 220, 200));
// Circle and ellipse
$pdf->Text(5, 82, 'Circle and ellipse examples');
$pdf->SetLineStyle($style5);
$pdf->Circle(25, 105, 20);
$pdf->Circle(25, 105, 10, 90, 180, null, $style6);
$pdf->Circle(25, 105, 10, 270, 360, 'F');
$pdf->Circle(25, 105, 10, 270, 360, 'C', $style6);
$pdf->SetLineStyle($style5);
$pdf->Ellipse(100, 105, 40, 20);
Example #28
-1
 /**
  * @param float|string $x
  * @param float|string $y
  * @param float|string $width
  * @param float|string $height
  * @param array $attrs {
  *      @option string|null "stroke_width" required
  *      @option string|null "stroke_color" required
  *      @option string "stroke_dash" required
  *      @option string "fill" required
  *      @option float|string "radius" required
  * }
  * @see http://www.tcpdf.org/doc/code/classTCPDF.html
  */
 public function drawRect($x, $y, $width, $height, array $attrs = array())
 {
     $style = $this->buildGraphicStyles($attrs);
     if (empty($attrs['radius'])) {
         $this->pdf->Rect($x, $y, $width, $height, null, array('all' => $style['stroke']), $style['fill']);
     } else {
         $this->pdf->RoundedRect($x, $y, $width, $height, $attrs['radius'], '1111', null, $style['stroke'], $style['fill']);
     }
 }
 /**
  * Renders (in PDF) the key (legend) of the graphics vertically to the left of the specified zone (xmin,ymin, xmax,ymax),
  * and the comment (if any) at the bottom of the page. Returns the position of remaining area.
  * @param TCPDF $oPdf
  * @param string $sComments
  * @param float $xMin
  * @param float $yMin
  * @param float $xMax
  * @param float $yMax
  * @param hash $aContextDefs
  * @return hash An array ('xmin' => , 'xmax' => ,'ymin' => , 'ymax' => ) of the remaining available area to paint the graph
  */
 protected function RenderKey(TCPDF $oPdf, $sComments, $xMin, $yMin, $xMax, $yMax, $aContextDefs)
 {
     $fFontSize = 7;
     // in mm
     $fIconSize = 6;
     // in mm
     $fPadding = 1;
     // in mm
     $oIterator = new RelationTypeIterator($this, 'Node');
     $fMaxWidth = max($oPdf->GetStringWidth(Dict::S('UI:Relation:Key')) - $fIconSize, $oPdf->GetStringWidth(Dict::S('UI:Relation:Comments')) - $fIconSize);
     $aClasses = array();
     $aIcons = array();
     $aContexts = array();
     $aContextIcons = array();
     $oPdf->SetFont('dejavusans', '', $fFontSize, '', true);
     foreach ($oIterator as $sId => $oNode) {
         if ($sClass = $oNode->GetObjectClass()) {
             if (!array_key_exists($sClass, $aClasses)) {
                 $sClassLabel = MetaModel::GetName($sClass);
                 $width = $oPdf->GetStringWidth($sClassLabel);
                 $fMaxWidth = max($width, $fMaxWidth);
                 $aClasses[$sClass] = $sClassLabel;
                 $sIconUrl = $oNode->GetProperty('icon_url');
                 $sIconPath = str_replace(utils::GetAbsoluteUrlModulesRoot(), APPROOT . 'env-' . utils::GetCurrentEnvironment() . '/', $sIconUrl);
                 $aIcons[$sClass] = $sIconPath;
             }
         }
         $aContextRootCauses = $oNode->GetProperty('context_root_causes');
         if (!is_null($aContextRootCauses)) {
             foreach ($aContextRootCauses as $key => $aObjects) {
                 $aContexts[$key] = Dict::S($aContextDefs[$key]['dict']);
                 $aContextIcons[$key] = APPROOT . 'env-' . utils::GetCurrentEnvironment() . '/' . $aContextDefs[$key]['icon'];
             }
         }
     }
     $oPdf->SetXY($xMin + $fPadding, $yMin + $fPadding);
     $yPos = $yMin + $fPadding;
     $oPdf->SetFillColor(225, 225, 225);
     $oPdf->Cell($fIconSize + $fPadding + $fMaxWidth, $fIconSize + $fPadding, Dict::S('UI:Relation:Key'), 0, 1, 'C', true);
     $yPos += $fIconSize + 2 * $fPadding;
     foreach ($aClasses as $sClass => $sLabel) {
         $oPdf->SetX($xMin + $fIconSize + $fPadding);
         $oPdf->Cell(0, $fIconSize + 2 * $fPadding, $sLabel, 0, 1);
         $oPdf->Image($aIcons[$sClass], $xMin + 1, $yPos, $fIconSize, $fIconSize);
         $yPos += $fIconSize + 2 * $fPadding;
     }
     foreach ($aContexts as $key => $sLabel) {
         $oPdf->SetX($xMin + $fIconSize + $fPadding);
         $oPdf->Cell(0, $fIconSize + 2 * $fPadding, $sLabel, 0, 1);
         $oPdf->Image($aContextIcons[$key], $xMin + 1 + $fIconSize * 0.125, $yPos + $fIconSize * 0.125, $fIconSize * 0.75, $fIconSize * 0.75);
         $yPos += $fIconSize + 2 * $fPadding;
     }
     $oPdf->Rect($xMin, $yMin, $fMaxWidth + $fIconSize + 3 * $fPadding, $yMax - $yMin, 'D');
     if ($sComments != '') {
         // Draw the comment text (surrounded by a rectangle)
         $xPos = $xMin + $fMaxWidth + $fIconSize + 4 * $fPadding;
         $w = $xMax - $xPos - 2 * $fPadding;
         $iNbLines = 1;
         $sText = '<p>' . str_replace("\n", '<br/>', htmlentities($sComments, ENT_QUOTES, 'UTF-8'), $iNbLines) . '</p>';
         $fLineHeight = $oPdf->getStringHeight($w, $sText);
         $h = (1 + $iNbLines) * $fLineHeight;
         $yPos = $yMax - 2 * $fPadding - $h;
         $oPdf->writeHTMLCell($w, $h, $xPos + $fPadding, $yPos + $fPadding, $sText, 0, 1);
         $oPdf->Rect($xPos, $yPos, $w + 2 * $fPadding, $h + 2 * $fPadding, 'D');
         $yMax = $yPos - $fPadding;
     }
     return array('xmin' => $xMin + $fMaxWidth + $fIconSize + 4 * $fPadding, 'xmax' => $xMax, 'ymin' => $yMin, 'ymax' => $yMax);
 }
 /**
  *   Show table for lines
  *
  *   @param		TCPDF			$pdf     		Object PDF
  *   @param		string		$tab_top		Top position of table
  *   @param		string		$tab_height		Height of table (rectangle)
  *   @param		int			$nexY			Y (not used)
  *   @param		Translate	$outputlangs	Langs object
  *   @param		int			$hidetop		1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
  *   @param		int			$hidebottom		Hide bottom bar of array
  *   @return	void
  */
 function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
 {
     global $conf;
     // Force to disable hidetop and hidebottom
     $hidebottom = 0;
     if ($hidetop) {
         $hidetop = -1;
     }
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     // Amount in (at tab_top - 1)
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('', '', $default_font_size - 2);
     if (empty($hidetop)) {
         $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency" . $conf->currency));
         $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
         $pdf->MultiCell($pdf->GetStringWidth($titre) + 3, 2, $titre);
         //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
         if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
             $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
         }
     }
     $pdf->SetDrawColor(128, 128, 128);
     $pdf->SetFont('', '', $default_font_size - 1);
     // Output Rect
     $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
     // Rect prend une longueur en 3eme param et 4eme param
     if (empty($hidetop)) {
         $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
         // line prend une position y en 2eme param et 4eme param
         $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
         $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L');
     }
     if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
         $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             $pdf->SetXY($this->posxtva - 3, $tab_top + 1);
             $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities("VAT"), '', 'C');
         }
     }
     $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         $pdf->SetXY($this->posxup - 1, $tab_top + 1);
         $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C');
     }
     $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
         if ($conf->global->PRODUCT_USE_UNITS) {
             $pdf->MultiCell($this->posxunit - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
         } else {
             $pdf->MultiCell($this->posxdiscount - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
         }
     }
     if ($conf->global->PRODUCT_USE_UNITS) {
         $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
             $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
         }
     }
     $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         if ($this->atleastonediscount) {
             $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
             $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
         }
     }
     if ($this->atleastonediscount) {
         $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
     }
     if (empty($hidetop)) {
         $pdf->SetXY($this->postotalht - 1, $tab_top + 1);
         $pdf->MultiCell(30, 2, $outputlangs->transnoentities("TotalHT"), '', 'C');
     }
 }