本文整理汇总了PHP中TCPDF::Text方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::Text方法的具体用法?PHP TCPDF::Text怎么用?PHP TCPDF::Text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::Text方法的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');
}
}
}
示例2:
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'BI', 50);
// add a page
$pdf->AddPage();
// print clipping text
$pdf->Text(20, 40, 'STROKE TEXT', 1, false);
//Start Transformation
$pdf->StartTransform();
// print clipping text
$pdf->Text(20, 70, 'CLIPPING TEXT', 2, true);
// draw jpeg image
$pdf->Image('../images/image_demo.jpg', 20, 45, 170, 40, '', 'http://www.tcpdf.org', '', true, 72);
//Stop Transformation
$pdf->StopTransform();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_026.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
示例3: processing
function processing($contextData, $options)
{
$prodId = $contextData[0]['id'];
$prodName = $contextData[0]['name'];
$unitPrice = $contextData[0]['unitprice'];
$pFile = $contextData[0]['photofile'];
$timestamp = new DateTime();
$tsString = $timestamp->format("Y-m-d H:i:s");
$fileName = "{$prodId}.pdf";
require_once './tcpdf/tcpdf.php';
$pdf = new TCPDF("P", "mm", "A4", true, "UTF-8");
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetMargins(0, 0, 0, 0);
$pdf->AddPage();
$pdf->setTextColor(100, 100, 100);
$pdf->SetFont('', '', 14);
$pdf->Text(40, 40, "Product ID: {$prodId}");
$pdf->Text(40, 50, "Product Name: {$prodName}");
$pdf->Text(40, 60, "Unit Price: {$unitPrice}");
$pdf->Text(40, 70, "Today: {$tsString}");
$pdf->Image("../Sample_products/images/{$pFile}", 40, 80, 100);
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=\"{$fileName}\"");
header('X-Frame-Options: SAMEORIGIN');
$pdf->Output();
}
示例4: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 031');
$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 . ' 031', 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, '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->SetTextColor(255, 255, 255);
$pdf->Text(105, 65, 'BLUE');
$pdf->Text(60, 95, 'GREEN');
$pdf->Text(120, 115, 'RED');
$this->comparePdfs($pdf);
}
示例5: postAdicionar
public function postAdicionar()
{
$pdf = new TCPDF();
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('GestBiblio - Sistema de Gestão de Bibliotecas');
$pdf->SetTitle('Comprovante de Imprestimo');
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$html = '';
$pdf->Text(90, 140, 'This is a test');
$filename = storage_path() . '/test.pdf';
$pdf->output($filename, 'F');
return Response::view($filename);
}
示例6: dirname
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
// 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->SetTextColor(255, 255, 255);
$pdf->Text(105, 65, 'BLUE');
$pdf->Text(60, 95, 'GREEN');
$pdf->Text(120, 115, 'RED');
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_031.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
示例7:
//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');
$pdf->Text(125, 19, 'Translate');
示例8: pdf
function pdf($html = null, $logo = null, $nombre = null, $estadistica, $itiniere, $transporte)
{
//$html= utf8_decode($html);
// $html="OOOJHKJHKJH JLH KJH KH KJH";
ob_clean();
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, array(210, 272), true, 'UTF-8', false);
// $pdf = new TCPDF('P', 'IN', array (8.5,11),true, 'UTF-8', false);
// set document information
//$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor('Nicola Asuni');
//$pdf->SetTitle('TCPDF Example 001');
//$pdf->SetSubject('TCPDF Tutorial');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
//$pdf->SetHeaderData($logo, '20', PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
if (!empty($logo)) {
$pdf->SetHeaderData($logo, '20', '', ' PLAN ESTRATEGICO DE SEGURIDAD VÍAL ' . date('d/m/Y'), array(0, 64, 128), array(0, 64, 128));
}
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// set header and footer fonts
// $pdf->SetMargins(23, 35, 13);
$pdf->SetMargins(32, 35, 20);
$pdf->SetHeaderMargin(14);
$pdf->SetFooterMargin(21);
$pdf->SetAutoPageBreak(TRUE, 20);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//$pdf->setLanguageArray($l);
$pdf->setFontSubsetting(false);
$pdf->SetFont('dejavusans', '', 10, '', true);
//$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', '6'));
$pdf->AddPage();
$pdf->writeHTML($html, true, false, true, false, '');
// $pdf->AddPage();
$pdf->SetFillColor(0, 0, 0);
$pdf->Write(10, ' ARL');
// echo $estadistica[0]->arlnula;die;
// GRAFICA No 1
$xc = $estadistica[0]->arlnula;
$yc = $estadistica[0]->arlsi;
$r = $estadistica[0]->arlno;
//echo "<pre>";
// var_dump($estadistica);die();
$total = $xc + $yc + $r;
$r1 = $xc * 360 / $total;
$r2 = $yc * 360 / $total;
$r3 = $r * 360 / $total;
$r1 = round($r1);
$r2 = round($r2);
$r3 = round($r3);
$xc1 = 105;
$yc1 = 120;
$r11 = 50;
$pdf->SetFillColor(0, 0, 255);
$pdf->PieSector($xc1, $yc1, $r11, 0, $r1, 'FD', false, 0, 2);
$pdf->SetFillColor(0, 255, 0);
$pdf->PieSector($xc1, $yc1, $r11, $r1, $r2 + $r1, 'FD', false, 0, 2);
$pdf->SetFillColor(255, 0, 0);
$pdf->PieSector($xc1, $yc1, $r11, $r2 + $r1, 0, 'FD', false, 0, 2);
$pdf->SetTextColor(0, 0, 255);
$pdf->Text(150, 150, 'NO CONTESTADAS: ' . $xc);
$pdf->SetTextColor(0, 255, 0);
$pdf->Text(150, 155, 'SI: ' . $yc);
$pdf->SetTextColor(255, 0, 0);
$pdf->Text(150, 160, 'NO: ' . $r);
$pdf->AddPage();
//----------------------------------------------------------------
// GRAFICA No 2
$pdf->SetTextColor(0, 0, 0);
$pdf->Write(10, ' PENSION');
$xc = $estadistica[0]->pensionnula;
$yc = $estadistica[0]->pensionsi;
$r = $estadistica[0]->pensionno;
$total = $xc + $yc + $r;
$r1 = $xc * 360 / $total;
$r2 = $yc * 360 / $total;
$r3 = $r * 360 / $total;
$r1 = round($r1);
$r2 = round($r2);
$r3 = round($r3);
$xc1 = 105;
$yc1 = 100;
$r11 = 50;
$pdf->SetFillColor(0, 0, 255);
$pdf->PieSector($xc1, $yc1, $r11, 0, $r1, 'FD', false, 0, 2);
$pdf->SetFillColor(0, 255, 0);
$pdf->PieSector($xc1, $yc1, $r11, $r1, $r2 + $r1, 'FD', false, 0, 2);
$pdf->SetFillColor(255, 0, 0);
$pdf->PieSector($xc1, $yc1, $r11, $r2 + $r1, 0, 'FD', false, 0, 2);
$pdf->SetTextColor(0, 0, 255);
$pdf->Text(150, 150, 'NO CONTESTADAS: ' . $xc);
$pdf->SetTextColor(0, 255, 0);
$pdf->Text(150, 155, 'SI: ' . $yc);
$pdf->SetTextColor(255, 0, 0);
$pdf->Text(150, 160, 'NO: ' . $r);
$pdf->AddPage();
//----------------------------------------------------------------
// GRAFICA No 3
$pdf->SetTextColor(0, 0, 0);
//.........这里部分代码省略.........
示例9: RenderAsPDF
public function RenderAsPDF(TCPDF $oPdf, DisplayableGraph $oGraph, $fScale, $aContextDefs)
{
$bReached = $this->GetProperty('is_reached');
$oPdf->SetFillColor(255, 255, 255);
if ($bReached) {
$aBorderColor = array(100, 100, 100);
} else {
$aBorderColor = array(200, 200, 200);
}
$oPdf->SetLineStyle(array('width' => 2 * $fScale, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => $aBorderColor));
$sIconUrl = $this->GetProperty('icon_url');
$sIconPath = str_replace(utils::GetAbsoluteUrlModulesRoot(), APPROOT . 'env-' . utils::GetCurrentEnvironment() . '/', $sIconUrl);
$oPdf->SetAlpha(1);
$oPdf->Circle($this->x * $fScale, $this->y * $fScale, $this->GetWidth() / 2 * $fScale, 0, 360, 'DF');
if ($bReached) {
$oPdf->SetAlpha(1);
} else {
$oPdf->SetAlpha(0.4);
}
$oPdf->Image($sIconPath, ($this->x - 17) * $fScale, ($this->y - 17) * $fScale, 16 * $fScale, 16 * $fScale);
$oPdf->Image($sIconPath, ($this->x + 1) * $fScale, ($this->y - 17) * $fScale, 16 * $fScale, 16 * $fScale);
$oPdf->Image($sIconPath, ($this->x - 8) * $fScale, ($this->y + 1) * $fScale, 16 * $fScale, 16 * $fScale);
$oPdf->SetFont('dejavusans', '', 24 * $fScale, '', true);
$width = $oPdf->GetStringWidth($this->GetProperty('label'));
$oPdf->SetTextColor(0, 0, 0);
$oPdf->Text($this->x * $fScale - $width / 2, ($this->y + 25) * $fScale, $this->GetProperty('label'));
}
示例10: dirname
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of PieSector() method.');
$xc = 105;
$yc = 100;
$r = 50;
$pdf->SetFillColor(0, 0, 100);
$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);
$pdf->SetFillColor(255, 0, 0);
$pdf->PieSector($xc, $yc, $r, 250, 20, 'FD', false, 0, 2);
// write labels
$pdf->SetTextColor(255, 255, 255);
$pdf->Text(105, 65, 'Pinacho');
$pdf->Text(60, 95, 'Marcelo');
$pdf->Text(120, 115, 'CNC');
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_031.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
示例11: Text
public function Text($x, $y, $txt, $stroke = 0, $clip = false)
{
parent::Text($x, $y, to_utf8($txt), $stroke, $clip);
}
示例12:
$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');
$pdf->Text(125, 66, 'Translate');
示例13: array
// 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');
示例14: Text
/**
* Prints a character string.
* The origin is on the left of the first charcter, on the baseline.
* This method allows to place a string precisely on the page.
*
* @param float $x Abscissa of the origin
* @param float $y Ordinate of the origin
* @param string $txt String to print
* @param int $stroke outline size in points (0 = disable)
* @param boolean $clip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation).
*
* @access public
* @return null
* @since 1.0
* @deprecated deprecated since version 4.3.005 (2008-11-25)
* @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell()
*/
public function Text($x, $y, $txt, $stroke = 0, $clip = false)
{
// replaces some special code to chars
$txt = str_replace(" ", " ", $txt);
$txt = str_replace("ä", "ä", $txt);
$txt = str_replace("ö", "ö", $txt);
$txt = str_replace("ü", "ü", $txt);
$txt = str_replace("Ä", "Ä", $txt);
$txt = str_replace("Ö", "Ö", $txt);
$txt = str_replace("Ü", "Ü", $txt);
$txt = str_replace("ß", "ß", $txt);
// replacing html specific codes
// if this doesn't help, we should create own entity table
// and replace codes to symbols
$txt = html_entity_decode($txt);
// cleaning up possible html code
$txt = strip_tags($txt);
//parent::Text($x,$y,$txt, $stroke, $clip);
parent::Text($x, $y, $txt);
}
示例15: array
$pdf->SetFont('helvetica', '', 10);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 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('www.tcpdf.org', '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'