本文整理汇总了PHP中TCPDF::SetFontSize方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::SetFontSize方法的具体用法?PHP TCPDF::SetFontSize怎么用?PHP TCPDF::SetFontSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::SetFontSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareRowAsPdf
/**
* Adds to the TCPDF instance, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS MULTILINESTRING object
* @param string $label Label for the GIS MULTILINESTRING object
* @param string $line_color Color for the GIS MULTILINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param TCPDF $pdf TCPDF instance
*
* @return TCPDF the modified TCPDF instance
* @access public
*/
public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
// allocate colors
$red = hexdec($pmaString->substr($line_color, 1, 2));
$green = hexdec($pmaString->substr($line_color, 3, 2));
$blue = hexdec($pmaString->substr($line_color, 4, 2));
$line = array('width' => 1.5, 'color' => array($red, $green, $blue));
// Trim to remove leading 'MULTILINESTRING((' and trailing '))'
$multilinestirng = $pmaString->substr($spatial, 17, $pmaString->strlen($spatial) - 19);
// Separate each linestring
$linestirngs = explode("),(", $multilinestirng);
$first_line = true;
foreach ($linestirngs as $linestring) {
$points_arr = $this->extractPoints($linestring, $scale_data);
foreach ($points_arr as $point) {
if (!isset($temp_point)) {
$temp_point = $point;
} else {
// draw line section
$pdf->Line($temp_point[0], $temp_point[1], $point[0], $point[1], $line);
$temp_point = $point;
}
}
unset($temp_point);
// print label
if (isset($label) && trim($label) != '' && $first_line) {
$pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
$pdf->SetFontSize(5);
$pdf->Cell(0, 0, trim($label));
}
$first_line = false;
}
return $pdf;
}
示例2: prepareRowAsPdf
/**
* Adds to the TCPDF instance, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS POLYGON object
* @param string $label Label for the GIS POLYGON object
* @param string $fill_color Color for the GIS POLYGON object
* @param array $scale_data Array containing data related to scaling
* @param TCPDF $pdf TCPDF instance
*
* @return TCPDF the modified TCPDF instance
* @access public
*/
public function prepareRowAsPdf($spatial, $label, $fill_color, $scale_data, $pdf)
{
// allocate colors
$red = hexdec(mb_substr($fill_color, 1, 2));
$green = hexdec(mb_substr($fill_color, 3, 2));
$blue = hexdec(mb_substr($fill_color, 4, 2));
$color = array($red, $green, $blue);
// Trim to remove leading 'POLYGON((' and trailing '))'
$polygon = mb_substr($spatial, 9, mb_strlen($spatial) - 11);
// If the polygon doesn't have an inner polygon
if (mb_strpos($polygon, "),(") === false) {
$points_arr = $this->extractPoints($polygon, $scale_data, true);
} else {
// Separate outer and inner polygons
$parts = explode("),(", $polygon);
$outer = $parts[0];
$inner = array_slice($parts, 1);
$points_arr = $this->extractPoints($outer, $scale_data, true);
foreach ($inner as $inner_poly) {
$points_arr = array_merge($points_arr, $this->extractPoints($inner_poly, $scale_data, true));
}
}
// draw polygon
$pdf->Polygon($points_arr, 'F*', array(), $color, true);
// print label if applicable
if (isset($label) && trim($label) != '') {
$pdf->SetXY($points_arr[2], $points_arr[3]);
$pdf->SetFontSize(5);
$pdf->Cell(0, 0, trim($label));
}
return $pdf;
}
示例3: prepareRowAsPdf
/**
* Adds to the TCPDF instance, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS MULTIPOINT object
* @param string $label Label for the GIS MULTIPOINT object
* @param string $point_color Color for the GIS MULTIPOINT object
* @param array $scale_data Array containing data related to scaling
* @param TCPDF $pdf TCPDF instance
*
* @return TCPDF the modified TCPDF instance
* @access public
*/
public function prepareRowAsPdf($spatial, $label, $point_color, $scale_data, $pdf)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
// allocate colors
$red = hexdec($pmaString->substr($point_color, 1, 2));
$green = hexdec($pmaString->substr($point_color, 3, 2));
$blue = hexdec($pmaString->substr($point_color, 4, 2));
$line = array('width' => 1.25, 'color' => array($red, $green, $blue));
// Trim to remove leading 'MULTIPOINT(' and trailing ')'
$multipoint = $pmaString->substr($spatial, 11, $pmaString->strlen($spatial) - 12);
$points_arr = $this->extractPoints($multipoint, $scale_data);
foreach ($points_arr as $point) {
// draw a small circle to mark the point
if ($point[0] != '' && $point[1] != '') {
$pdf->Circle($point[0], $point[1], 2, 0, 360, 'D', $line);
}
}
// print label for each point
if (isset($label) && trim($label) != '' && ($points_arr[0][0] != '' && $points_arr[0][1] != '')) {
$pdf->SetXY($points_arr[0][0], $points_arr[0][1]);
$pdf->SetFontSize(5);
$pdf->Cell(0, 0, trim($label));
}
return $pdf;
}
示例4:
$lg['a_meta_dir'] = 'rtl';
$lg['a_meta_language'] = 'fa';
$lg['w_page'] = 'page';
// set some language-dependent strings (optional)
$pdf->setLanguageArray($lg);
// ---------------------------------------------------------
// set font
$pdf->SetFont('dejavusans', '', 12);
// add a page
$pdf->AddPage();
// Persian and English content
$htmlpersian = '<span color="#660000">Persian example:</span><br />سلام بالاخره مشکل PDF فارسی به طور کامل حل شد. اینم یک نمونش.<br />مشکل حرف \\"ژ\\" در بعضی کلمات مانند کلمه ویژه نیز بر طرف شد.<br />نگارش حروف لام و الف پشت سر هم نیز تصحیح شد.<br />با تشکر از "Asuni Nicola" و محمد علی گل کار برای پشتیبانی زبان فارسی.';
$pdf->WriteHTML($htmlpersian, true, 0, true, 0);
// set LTR direction for english translation
$pdf->setRTL(false);
$pdf->SetFontSize(10);
// print newline
$pdf->Ln();
// Persian and English content
$htmlpersiantranslation = '<span color="#0000ff">Hi, At last Problem of Persian PDF Solved completely. This is a example for it.<br />Problem of "jeh" letter in some word like "ویژه" (=special) fix too.<br />The joining of laa and alf letter fix now.<br />Special thanks to "Nicola Asuni" and "Mohamad Ali Golkar" for Persian support.</span>';
$pdf->WriteHTML($htmlpersiantranslation, true, 0, true, 0);
// Restore RTL direction
$pdf->setRTL(true);
// set font
$pdf->SetFont('aefurat', '', 18);
// print newline
$pdf->Ln();
// Arabic and English content
$pdf->Cell(0, 12, 'بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ', 0, 1, 'C');
$htmlcontent = 'تمَّ بِحمد الله حلّ مشكلة الكتابة باللغة العربية في ملفات الـ<span color="#FF0000">PDF</span> مع دعم الكتابة <span color="#0000FF">من اليمين إلى اليسار</span> و<span color="#009900">الحركَات</span> .<br />تم الحل بواسطة <span color="#993399">صالح المطرفي و Asuni Nicola</span> . ';
$pdf->WriteHTML($htmlcontent, true, 0, true, 0);
示例5: writeDetalles
function writeDetalles(DataSource $dataSource, TCPDF $pdf, $tipo)
{
$blackAll = array('LTRB' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
$widthMarginLeft = 1;
$width1 = 20;
$width2 = 85;
$pdf->Ln();
$pdf->SetFontSize(7.5);
$pdf->SetFont('', 'B');
$height = 5;
$pdf->SetFillColor(255, 255, 255, true);
$pdf->setTextColor(0, 0, 0);
if ($tipo == 'adjudicado') {
$pdf->Cell($width2 - $width1 * 2, $height, 'Item', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
} else {
$pdf->Cell($width2, $height, 'Item', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
}
$pdf->Cell($width1, $height, 'Cantidad Ref.', $blackAll, 0, 'L', true, '', 1, false, 'T', 'C');
if ($tipo != 'borrador') {
$pdf->Cell($width1, $height, 'Precio Unitario Ref.', $blackAll, 0, 'C', true, '', 1, false, 'T', 'C');
}
$pdf->Cell($width1, $height, 'Cantidad Ofert.', $blackAll, 0, 'L', true, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, 'Precio Unitario Ofert.', $blackAll, 0, 'C', true, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, 'Total Ofert.', $blackAll, 0, 'C', true, '', 1, false, 'T', 'C');
if ($tipo == 'adjudicado') {
$pdf->Cell($width1, $height, 'Cantidad Adj.', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, 'Total', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
}
$pdf->Ln();
$pdf->SetFontSize(6.5);
foreach ($dataSource->getDataset() as $row) {
$pdf->SetFont('', '');
$xAntesMultiCell = $pdf->getX();
$yAntesMultiCell = $pdf->getY();
//$totalItem
if ($tipo == 'borrador') {
$pdf->MultiCell($width2, $height, $row['desc_solicitud_det'] . "\r\n" . ' - ' . $row['descripcion_sol'], 1, 'L', false, 1);
$yDespuesMultiCell = $pdf->getY();
$height = $yDespuesMultiCell - $yAntesMultiCell;
$pdf->setXY($xAntesMultiCell + $width2, $yAntesMultiCell);
$pdf->Cell($width1, $height, $row['cantidad_sol'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, '', 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, '', 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, '', 1, 0, 'R', false, '', 1, false, 'T', 'C');
} else {
if ($tipo == 'cotizado') {
$pdf->MultiCell($width2, $height, $row['desc_solicitud_det'] . "\r\n" . ' - ' . $row['descripcion_sol'], 1, 'L', false, 1);
$yDespuesMultiCell = $pdf->getY();
$height = $yDespuesMultiCell - $yAntesMultiCell;
$pdf->setXY($xAntesMultiCell + $width2, $yAntesMultiCell);
$pdf->Cell($width1, $height, $row['cantidad_sol'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, number_format($row['precio_unitario_sol'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, $row['cantidad_coti'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, number_format($row['precio_unitario'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
$totalItem = number_format($row['cantidad_coti'] * $row['precio_unitario'], 2);
$pdf->Cell($width1, $height, $totalItem, 1, 0, 'R', false, '', 1, false, 'T', 'C');
} else {
$pdf->MultiCell($width2 - $width1 * 2, $height, $row['desc_solicitud_det'] . "\r\n" . ' - ' . $row['descripcion_sol'], 1, 'L', false, 1);
$yDespuesMultiCell = $pdf->getY();
$height = $yDespuesMultiCell - $yAntesMultiCell;
$pdf->setXY($xAntesMultiCell + $width2 - $width1 * 2, $yAntesMultiCell);
$pdf->Cell($width1, $height, $row['cantidad_sol'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, number_format($row['precio_unitario_sol'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, $row['cantidad_coti'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, number_format($row['precio_unitario'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
$totalItem = number_format($row['cantidad_coti'] * $row['precio_unitario'], 2);
$pdf->Cell($width1, $height, $totalItem, 1, 0, 'R', false, '', 1, false, 'T', 'C');
$pdf->Cell($width1, $height, $row['cantidad_adju'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
$totalAdj = number_format($row['cantidad_adju'] * $row['precio_unitario'], 2);
$pdf->Cell($width1, $height, $totalAdj, 1, 0, 'R', false, '', 1, false, 'T', 'C');
}
}
$pdf->Ln();
}
}
示例6: setVisibility
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', '', 18);
// add a page
$pdf->AddPage();
/*
* setVisibility() allows to restrict the rendering of some
* elements to screen or printout. This can be useful, for
* instance, to put a background image or color that will
* show on screen but won't print.
*/
$txt = 'You can limit the visibility of PDF objects to screen or printer by using the setVisibility() method.
Check the print preview of this document to display the alternative text.';
$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
// change font size
$pdf->SetFontSize(40);
// change text color
$pdf->SetTextColor(0, 63, 127);
// set visibility only for screen
$pdf->setVisibility('screen');
// write something only for screen
$pdf->Write(0, '[This line is for display]', '', 0, 'C', true, 0, false, false, 0);
// set visibility only for print
$pdf->setVisibility('print');
// change text color
$pdf->SetTextColor(127, 0, 0);
// write something only for print
$pdf->Write(0, '[This line is for printout]', '', 0, 'C', true, 0, false, false, 0);
// restore visibility
$pdf->setVisibility('all');
// ---------------------------------------------------------
示例7: testPdfOutput
public function testPdfOutput()
{
$this->markTestIncomplete('Ae fonts are not part of this repository.');
// 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 018');
$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 . ' 018', 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 data:
$lg = array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['a_meta_dir'] = 'rtl';
$lg['a_meta_language'] = 'fa';
$lg['w_page'] = 'page';
// set some language-dependent strings (optional)
$pdf->setLanguageArray($lg);
// ---------------------------------------------------------
// set font
$pdf->SetFont('dejavusans', '', 12);
// add a page
$pdf->AddPage();
// Persian and English content
$htmlpersian = '<span color="#660000">Persian example:</span><br />سلام بالاخره مشکل PDF Ùارسی به طور کامل ØÙ„ شد. اینم یک نمونش.<br />مشکل Øر٠\\"Ú˜\\" در بعضی کلمات مانند کلمه ویژه نیز بر طر٠شد.<br />نگارش Øرو٠لام Ùˆ ال٠پشت سر هم نیز تصØÛŒØ Ø´Ø¯.<br />با تشکر از "Asuni Nicola" Ùˆ Ù…Øمد علی Ú¯Ù„ کار برای پشتیبانی زبان Ùارسی.';
$pdf->WriteHTML($htmlpersian, true, 0, true, 0);
// set LTR direction for english translation
$pdf->setRTL(false);
$pdf->SetFontSize(10);
// print newline
$pdf->Ln();
// Persian and English content
$htmlpersiantranslation = '<span color="#0000ff">Hi, At last Problem of Persian PDF Solved completely. This is a example for it.<br />Problem of "jeh" letter in some word like "ویژه" (=special) fix too.<br />The joining of laa and alf letter fix now.<br />Special thanks to "Nicola Asuni" and "Mohamad Ali Golkar" for Persian support.</span>';
$pdf->WriteHTML($htmlpersiantranslation, true, 0, true, 0);
// Restore RTL direction
$pdf->setRTL(true);
// set font
$pdf->SetFont('aefurat', '', 18);
// print newline
$pdf->Ln();
// Arabic and English content
$pdf->Cell(0, 12, 'بÙسْم٠الله٠الرَّØْمن٠الرَّØÙيمÙ', 0, 1, 'C');
$htmlcontent = 'تمَّ بÙØمد الله Øلّ مشكلة الكتابة باللغة العربية ÙÙŠ ملÙات الـ<span color="#FF0000">PDF</span> مع دعم الكتابة <span color="#0000FF">من اليمين إلى اليسار</span> Ùˆ<span color="#009900">الØركَات</span> .<br />تم الØÙ„ بواسطة <span color="#993399">ØµØ§Ù„Ø Ø§Ù„Ù…Ø·Ø±ÙÙŠ Ùˆ Asuni Nicola</span> . ';
$pdf->WriteHTML($htmlcontent, true, 0, true, 0);
// set LTR direction for english translation
$pdf->setRTL(false);
// print newline
$pdf->Ln();
$pdf->SetFont('aealarabiya', '', 18);
// Arabic and English content
$htmlcontent2 = '<span color="#0000ff">This is Arabic "العربية" Example With TCPDF.</span>';
$pdf->WriteHTML($htmlcontent2, true, 0, true, 0);
$this->comparePdfs($pdf);
}
示例8: printAction
public function printAction()
{
$this->_helper->viewRenderer->setNoRender();
$this->_helper->getHelper("layout")->disableLayout();
require_once "../library/zkk/AppCms2/tcpdf/tcpdf.php";
$nOrderId = (int) $this->_getParam("no");
if (is_numeric($nOrderId) && $nOrderId > 0 && in_array($this->_sRoleName, array("librarian", "administrator", "superadministrator"))) {
$oModelOrderJournal = new User_Model_VOrderJournal();
$oModelOrderChangeLog = new User_Model_OrderChangeLog();
$oModelOrderJournalOrderChangeLog = new User_Model_OrderJournalOrderChangeLog();
$oOrderJournal = $oModelOrderJournal->getOne($nOrderId);
$oPdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, "UTF-8", false);
$oPdf->setFont("freesans");
$oPdf->setPrintHeader(false);
$oPdf->addPage();
$oPdf->SetFontSize(12);
$oPdf->writeHTMLCell(60, 10, "", 5, "<strong>{$oOrderJournal->call_id}</strong>", 0, 0, false, true, "L", true);
$oPdf->writeHTMLCell(120, 10, "", "", "ZAKŁADKA ZAMÓWIENIA KOPII", 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Numer zamówienia: <strong>{$oOrderJournal->id}</strong>", 0, 0, false, true, "L", true);
$oPdf->writeHTMLCell(75, 5, "", "", "Sygnatura: <strong>{$oOrderJournal->call_id}</strong><br />Sygnatura lokalna: <strong>{$oOrderJournal->csa_call_id}</strong><br />Kolekcja: <strong>{$oOrderJournal->collection}</strong>", 0, 1, false, true, "R", true);
$oPdf->writeHTMLCell(190, 5, "", "", "", 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(190, 5, "", "", "", 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 30, "", "", "Tytuł książki / czasopisma:<br /><strong>{$oOrderJournal->journal_title}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Rocznik: <strong>{$oOrderJournal->journal_year_publication}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Numeracja: <strong>{$oOrderJournal->journal_number}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Strony od: <strong>{$oOrderJournal->page_from}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Strony do: <strong>{$oOrderJournal->page_until}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Autor: <strong>{$oOrderJournal->article_author}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 30, "", "", "Nazwa rozdziału / artykułu:<br /><strong>{$oOrderJournal->article_title}</strong>", 1, 1, false, true, "L", true);
$sCurrTime = date("Y-m-d H:i:s", time());
$sHtml1 = "\n Data zamówienia: <strong>{$sCurrTime}</strong><br /><br />\n Zamówione dla: <br /><strong>{$oOrderJournal->user_first_name} {$oOrderJournal->user_last_name}</strong><br /><br />\n Przekazać do: <br /><strong></strong>\n ";
$oPdf->writeHTMLCell(95, 5, 110, 75, $sHtml1, 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(60, 10, "", 150, "<strong>{$oOrderJournal->call_id}</strong>", 0, 0, false, true, "L", true);
$oPdf->writeHTMLCell(120, 10, "", "", "ZAKŁADKA ZAMÓWIENIA KOPII", 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Numer zamówienia: <strong>{$oOrderJournal->id}</strong>", 0, 0, false, true, "L", true);
$oPdf->writeHTMLCell(75, 5, "", "", "Sygnatura: <strong>{$oOrderJournal->call_id}</strong><br />Sygnatura lokalna: <strong>{$oOrderJournal->csa_call_id}</strong><br />Kolekcja: <strong>{$oOrderJournal->collection}</strong>", 0, 1, false, true, "R", true);
$oPdf->writeHTMLCell(190, 5, "", "", "", 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(190, 5, "", "", "", 0, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 30, "", "", "Tytuł książki / czasopisma:<br /><strong>{$oOrderJournal->journal_title}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Rocznik: <strong>{$oOrderJournal->journal_year_publication}</strong>", 1, 1, false, true, "L", true);
$oPdf->writeHTMLCell(95, 5, "", "", "Numeracja: <strong>{$oOrderJournal->journal_number}</strong>", 1, 1, false, true, "L", true);
$sHtml2 = "\n Data zamówienia: <strong>{$sCurrTime}</strong><br /><br />\n Zamówione dla: <br /><strong></strong>\n ";
$oPdf->writeHTMLCell(95, 5, 110, 190, $sHtml2, 0, 1, false, true, "L", true);
$oPdf->Output($nOrderId . ".pdf", "I");
$nOrderChangeLogId = $oModelOrderChangeLog->addRow(array("order_change_type_id" => 3, "user_id" => $this->_oAuth->getStorage()->read()->user_id, "date" => time()));
$oModelOrderJournalOrderChangeLog->addRow(array("order_journal_id" => $nOrderId, "order_change_log_id" => $nOrderChangeLogId));
}
exit;
}
示例9: add_font
public function add_font()
{
require_once APPPATH . 'libraries/tcpdf/include/tcpdf_fonts.php';
require APPPATH . 'libraries/tcpdf/tcpdf.php';
error_reporting(1);
$fontMaker = new TCPDF_FONTS();
$font = $fontMaker->addTTFfont($_SERVER['DOCUMENT_ROOT'] . 'js/TEMPSITC_new.TTF');
$pdfMaker = new TCPDF('L', 'mm', 'A4', true, 'utf-8');
$pdfMaker->AddPage('L');
$pdfMaker->SetMargins(0, 0, 0, true);
$pdfMaker->SetFont($font);
$pdfMaker->SetFontSize('20');
$pdfMaker->SetTextColor(0, 0, 0);
$pdfMaker->Text(10, 10, 'Hello!');
echo '<pre>';
print_r($font);
echo ':)</pre>';
//$pdfMaker->Output();
}
示例10: blended_draw_barcode_placeholder
/**
* Draw a box to put the barcodes.
*
* @param TCPDF &$pdf
* @param $marksize
* @param &$dims
* @param $label='0'
* @param $name
* @param $fill=false
*
* @return $object with a coords and marks properties
*/
function blended_draw_barcode_placeholder(TCPDF &$pdf, $marksizew, $marksizeh, &$dims, $label = '0', $name, $fill = false)
{
$fontsize = $pdf->getFontSizePt();
$pdf->SetFontSize(4);
blended_saveXY($dims, $pdf);
$render = $fill ? 'F' : 'D';
$pdf->Cell($marksizew, $marksizeh, $label, 1, 0, 'C', $fill, '', '');
// $pdf->SetFillColor(0,0,0);
//$pdf->Rect($pdf->getX(),$pdf->getY(),$marksizew,$marksizeh,$render);
//label mark inside
$pdf->SetFontSize($fontsize);
blended_saveWH($dims, $pdf);
//store mark coords
blended_saveBarCode($dims, $name);
}
示例11: TCPDF
require_once '../../vendor/tcpdf_min/tcpdf.php';
$post = $_POST['post'];
//TODO first
// sort seats
//
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, [82, 51], true, 'UTF-8', false);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetMargins(0, 0, 0, true);
$pdf->SetAutoPageBreak(true, 0);
foreach ($post['seats'] as $k => $v) {
$pdf->AddPage('L');
//lien 1
$pdf->SetFont('courier', 'B');
$pdf->SetFontSize(8);
$pdf->Text(0, 0, $post['showtime']['shortTitle']);
$pdf->Text(0, 3, date('d m Y', strtotime($post['showtime']['date'])));
$pdf->Text(20, 3, date('H:i', mktime(0, $post['showtime']['start'])));
$pdf->Text(0, 6, 'seat: ' . $k);
$pdf->Text(18, 6, $v['type']);
$pdf->Text(0, 9, 'room: ' . $post['showtime']['room']);
$pdf->Text(0, 12, 'Adult');
$pdf->Text(0, 15, $v['price']);
$pdf->Text(0, 18, $post['profile']['fullName']);
//lien 2
$pdf->SetFontSize(14);
$pdf->Text(34, 0, $post['showtime']['shortTitle']);
$pdf->SetFontSize(10);
$pdf->Text(34, 5, date('d m Y', strtotime($post['showtime']['date'])));
$pdf->SetFontSize(14);
示例12: stripslashes
$bik = stripslashes($_POST['bik']);
$correspondent_account = stripslashes($_POST['correspondent_account']);
$banknote = stripslashes($_POST['banknote']);
$pence = stripslashes($_POST['pence']);
$order_id = stripslashes($_POST['order_id']);
$amount = stripslashes($_POST['amount']);
//set document properties
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->setPageOrientation('P');
//set font for the entire document
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage();
$pdf->SetDisplayMode('real');
$pdf->SetFontSize(8);
// ширина квитанции
$width = 190;
// Высота половинки
$height = 75;
// ширина слушебного поля
$field_width = 80;
// Начальные координаты
$x = 10;
$y = 10;
// Первая рамка
$pdf->SetLineStyle(array('dash' => 2));
$pdf->SetXY($x, $y);
$pdf->Cell($width, $height, '', 1, 0, 'C', 0);
$pdf->SetXY($field_width + $x - 40, $y + 5);
$pdf->Write(5, "Извещение" . PHP_EOL);
示例13: prepareRowAsPdf
/**
* Adds to the TCPDF instance, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS LINESTRING object
* @param string $label Label for the GIS LINESTRING object
* @param string $line_color Color for the GIS LINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param TCPDF $pdf TCPDF instance
*
* @return TCPDF the modified TCPDF instance
* @access public
*/
public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
// allocate colors
$red = hexdec($pmaString->substr($line_color, 1, 2));
$green = hexdec($pmaString->substr($line_color, 3, 2));
$blue = hexdec($pmaString->substr($line_color, 4, 2));
$line = array('width' => 1.5, 'color' => array($red, $green, $blue));
// Trim to remove leading 'LINESTRING(' and trailing ')'
$linesrting = $pmaString->substr($spatial, 11, $pmaString->strlen($spatial) - 12);
$points_arr = $this->extractPoints($linesrting, $scale_data);
foreach ($points_arr as $point) {
if (!isset($temp_point)) {
$temp_point = $point;
} else {
// draw line section
$pdf->Line($temp_point[0], $temp_point[1], $point[0], $point[1], $line);
$temp_point = $point;
}
}
// print label
if (isset($label) && trim($label) != '') {
$pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
$pdf->SetFontSize(5);
$pdf->Cell(0, 0, trim($label));
}
return $pdf;
}
示例14: nv_giapha_export_pdf
//.........这里部分代码省略.........
} else {
$array_data = $contents['ngaygio']['genealogy'];
$array_anniversary = $contents['ngaygio']['anniversary'];
// print font name
$pdf->Cell(0, 10, 'Ngày giỗ:' . $array_data['title'], 1, 1, 'C', true, '', 0, false, 'T', 'M');
$pdf->SetFillColor(168, 164, 204);
$pdf->Cell(20, 12, 'STT', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(110, 12, 'Họ tên', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(50, 12, 'Ngày giỗ', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Ln();
// set font for chars
$pdf->SetFont($font, '', 16);
$i = 0;
foreach ($array_anniversary as $row) {
$i++;
$row['number'] = $i;
$pdf->Cell(20, 12, $row['number'], 1, 0, 'C', false, '', 0, false, 'T', 'M');
$pdf->Cell(110, 12, $row['full_name'], 1, 0, 'C', false, '', 0, false, 'T', 'M');
$pdf->Cell(50, 12, $row['date'], 1, 0, 'C', false, '', 0, false, 'T', 'M');
$pdf->Ln();
}
}
$pdf->Ln(10);
}
if ($contents['thanhvien']) {
//array allow
$array_key = array('image', 'full_name', 'gender', 'status', 'code', 'name1', 'name2', 'birthday', 'dieday', 'life', 'burial');
$row_detail = $contents['thanhvien']['detail'];
$pdf->SetFillColor(221, 238, 255);
// print font name
$pdf->Cell(0, 10, 'Trưởng họ', 1, 1, 'C', true, '', 0, false, 'T', 'M');
// set font for chars
$pdf->SetFont($font, '', 13);
$pdf->SetFontSize(13);
foreach ($array_key as $key) {
if ($row_detail[$key] != "") {
if ($key == "image") {
$pdf->Cell(80, 40, $lang_module['u_' . $key], 1, 0, 'C', false, '', 0, false, 'T', 'M');
$pdf->Image($row_detail[$key], '', '', 40, 40, '', '', 'L', false, 150, '', false, false, 0, false, false, false);
$pdf->Cell(100, 40, '', 1, 0, 'R', false, '', 0, false, '', '');
} else {
$pdf->Cell(80, 12, $lang_module['u_' . $key], 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(100, 12, $row_detail[$key], 1, 0, 'L', true, '', 1, false, 'T', 'M');
}
$pdf->Ln();
}
}
if (!empty($row_detail['content'])) {
$pdf->Ln(10);
$pdf->WriteHTML("<h1><i style=\"color:#990000;\">" . $lang_module['u_content'] . "</i></h1>", true, 0, true, 0);
$pdf->Ln(2);
$pdf->WriteHTML($row_detail['content']);
}
$array_parentid = $contents['thanhvien']['parentid'];
foreach ($array_parentid as $array_parentid_i) {
$pdf->Ln(10);
$pdf->SetFillColor(221, 238, 255);
$pdf->Cell(180, 10, $array_parentid_i['caption'], 1, 1, 'C', true, '', 0, false, 'T', 'M');
$pdf->SetFillColor(168, 164, 204);
$pdf->Cell(10, 12, 'STT', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(78, 12, 'Họ tên', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(30, 12, 'Ngày sinh', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(12, 12, 'Ảnh', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(25, 12, 'Giới tính', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Cell(25, 12, 'Trạng thái', 1, 0, 'C', true, '', 0, false, 'T', 'M');
$pdf->Ln();
示例15: AktaLoader
$penduduk = new AktaLoader($id);
$penduduk->retrieve_data();
$pdf = new TCPDF("P", PDF_UNIT, "A4", true, "UTF-8", false);
$pdf->SetMargins(10, 20, 10);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->setPrintFooter(false);
$pdf->setPrintHeader(false);
$pdf->SetTitle("Akta Kelahiran");
$pdf->SetAutoPageBreak(true, 10);
$pdf->AddPage();
// --------
$pdf->SetFont("times", '', 12);
$pdf->Cell(130, 1, "Nomor Induk Kependudukan", 0, 0, 'L', 0);
$pdf->Cell(70, 1, $penduduk->nik, 0, 0, 'L', 0);
$pdf->Ln(40);
$pdf->SetFontSize(18);
$pdf->MultiCell(200, 1, "PENCATATAN SIPIL", 0, 'C', 0, 1, '', '', true);
if (strcmp($penduduk->wni, 'WNI') == 0) {
$pdf->MultiCell(200, 1, "WARGA NEGARA: INDONESIA", 0, 'C', 0, 1, '', '', true);
} else {
$pdf->MultiCell(200, 1, "WARGA NEGARA: ASING", 0, 'C', 0, 1, '', '', true);
}
$pdf->MultiCell(200, 1, "KUTIPAN AKTA KELAHIRAN", 0, 'C', 0, 1, '', '', true);
$pdf->Ln(40);
$tangal_lahir = strtotime($penduduk->tanggal_lahir);
$pdf->SetFontSize(12);
$pdf->Write(1, "Berdasarkan Akta Kelahiran Nomor ...............{$penduduk->no_akta} ........", '', 0, 'L', true);
$pdf->Write(1, "menurut stbld ..................... - ..........................", '', 0, 'L', true);
$pdf->Write(1, "bahwa di ....{$penduduk->tempat_lahir} .... pada tanggal ..." . strftime(date('d F', $tangal_lahir)) . " tahun " . strftime(date('Y', $tangal_lahir)) . " telah lahir", '', 0, 'L', true);
$pdf->MultiCell(150, 1, " ---- " . strtoupper($penduduk->nama) . " ----", 0, 'C', 0, 1, '', '', true);
$pdf->Write(1, "anak {$penduduk->jenis_kelamin}, dari suami-istri ", '', 0, 'L', true);