本文整理匯總了PHP中TCPDF::Cell方法的典型用法代碼示例。如果您正苦於以下問題:PHP TCPDF::Cell方法的具體用法?PHP TCPDF::Cell怎麽用?PHP TCPDF::Cell使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TCPDF
的用法示例。
在下文中一共展示了TCPDF::Cell方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: student_kolizijapdf
//.........這裏部分代碼省略.........
}
// Ako čovjek upisuje prvu godinu nečeka (mastera), broj indexa je netačan!
if ($godina == 1) {
$brindexa = "";
}
// ----- Pravljenje PDF dokumenta
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator("Zamger");
$pdf->SetTitle('Domestic Learning Agreement / Ugovor o ucenju');
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(0, 0, 0);
//set auto page breaks
$pdf->SetAutoPageBreak(false);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO*2.083333);
$pdf->setJPEGQuality(100);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('freesans', 'B', 9);
$pdf->SetHeaderData("", 0, "", "");
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
// add a page
$pdf->AddPage();
// $pdf->Image("images/content/150dpi/ETF-Domestic-contract-PGS-ALL-0.png",210,297,0,0,'','','',true,150);
$pdf->Image("images/content/150dpi/domestic-contract{$mscfile}-0.png", 0, 0, 210, 0, '', '', '', true, 150);
$pdf->SetXY(175, 34);
$pdf->Cell(23, 0, $agnaziv, 0, 0, 'C');
$pdf->SetXY(175, 42);
$pdf->Cell(23, 0, $godina . ".", 0, 0, 'C');
$pdf->SetXY(175, 50);
$pdf->Cell(23, 0, $sem1 . ". & " . $sem2, 0, 0, 'C');
$pdf->SetXY(70, 48);
$pdf->Cell(100, 0, $studijeng, 0, 0);
$pdf->SetXY(70, 52);
$pdf->Cell(100, 0, $studijbos, 0, 0);
$pdf->SetXY(70, 62);
$pdf->Cell(100, 0, $imeprezime);
$pdf->SetXY(70, 69);
$pdf->Cell(100, 0, $brindexa);
// PRVI SEMESTAR
$pdf->AddPage();
$pdf->Image("images/content/150dpi/domestic-contract{$mscfile}-1.png", 0, 0, 210);
$pdf->SetXY(175, 34);
$pdf->Cell(23, 0, $agnaziv, 0, 0, 'C');
$pdf->SetXY(175, 42);
$pdf->Cell(23, 0, $godina . ".", 0, 0, 'C');
$pdf->SetXY(175, 50);
$pdf->Cell(23, 0, $sem1 . ".", 0, 0, 'C');
$pdf->SetXY(70, 48);
$pdf->Cell(100, 0, $studijeng, 0, 0);
$pdf->SetXY(70, 52);
$pdf->Cell(100, 0, $studijbos, 0, 0);
$pdf->SetXY(70, 62);
$pdf->Cell(100, 0, $imeprezime);
$pdf->SetXY(70, 69);
$pdf->Cell(100, 0, $brindexa);
// Spisak obaveznih predmeta na neparnom semestru
// Ako je ponovac, ne prikazujemo predmete koje je polozio
if ($ponovac == 1) {
示例2: 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;
}
示例3: 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;
}
示例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 023');
$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 . ' 023', 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('times', 'BI', 14);
// Start First Page Group
$pdf->startPageGroup();
// add a page
$pdf->AddPage();
// set some text to print
$txt = <<<EOD
Example of page groups.
Check the page numbers on the page footer.
This is the first page of group 1.
EOD;
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
// add second page
$pdf->AddPage();
$pdf->Cell(0, 10, 'This is the second page of group 1', 0, 1, 'L');
// Start Second Page Group
$pdf->startPageGroup();
// add some pages
$pdf->AddPage();
$pdf->Cell(0, 10, 'This is the first page of group 2', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'This is the second page of group 2', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'This is the third page of group 2', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'This is the fourth page of group 2', 0, 1, 'L');
$this->comparePdfs($pdf);
}
示例5: 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 029');
$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 . ' 029', 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 array for viewer preferences
$preferences = array('HideToolbar' => true, 'HideMenubar' => true, 'HideWindowUI' => true, 'FitWindow' => true, 'CenterWindow' => true, 'DisplayDocTitle' => true, 'NonFullScreenPageMode' => 'UseNone', 'ViewArea' => 'CropBox', 'ViewClip' => 'CropBox', 'PrintArea' => 'CropBox', 'PrintClip' => 'CropBox', 'PrintScaling' => 'AppDefault', 'Duplex' => 'DuplexFlipLongEdge', 'PickTrayByPDFSize' => true, 'PrintPageRange' => array(1, 1, 2, 3), 'NumCopies' => 2);
// Check the example n. 60 for advanced page settings
// set pdf viewer preferences
$pdf->setViewerPreferences($preferences);
// set font
$pdf->SetFont('times', '', 14);
// add a page
$pdf->AddPage();
// print a line
$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 1', 1, 1, 'C');
$pdf->Ln(5);
$pdf->Write(0, 'You can use the setViewerPreferences() method to change viewer preferences.', '', 0, 'L', true, 0, false, false, 0);
// add a page
$pdf->AddPage();
// print a line
$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 2', 0, 0, 'C');
// add a page
$pdf->AddPage();
// print a line
$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 3', 0, 0, 'C');
$this->comparePdfs($pdf);
}
示例6: buildLabel_Barcodes
/**
* @param $lInfo
* @param $newLine
*/
private function buildLabel_Barcodes($lInfo, $newLine)
{
$labelContent = array();
if ($lInfo['barcode'] != '') {
if ($lInfo['barcode_type'] != '') {
$labelContent[] = $this->getTcpdfBarcode($lInfo);
} else {
$labelContent[] = 'Image Not Available';
}
}
$first = 0;
$labelText = '';
foreach ($labelContent as $iLabel) {
if ($first == 1) {
$labelText .= "\n" . ltrim(str_replace('<br>', "\n", str_replace('<br />', "\n", str_replace('<br/>', "\n", preg_replace("/(?:\\s\\s+|\n|\t)/", " ", $iLabel)))));
} else {
$labelText .= ltrim(str_replace('<br>', "\n", str_replace('<br />', "\n", str_replace('<br/>', "\n", preg_replace("/(?:\\s\\s+|\n|\t)/", " ", $iLabel)))));
}
$first++;
}
$this->pdf->MultiCell($this->layoutInfo['labelWidth'], $this->layoutInfo['labelHeight'], $labelText, 0, 'C', 0, $newLine, '', '', true, 0, true, true, $this->layoutInfo['labelHeight'], 'M', true);
if ($newLine == 0) {
$this->pdf->Cell($this->layoutInfo['labelSpacerWidth'], $this->layoutInfo['labelHeight'], '');
}
}
示例7: 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 060');
$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 . ' 060', 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', '', 20);
// ---------------------------------------------------------
// set page format (read source code documentation for further information)
$page_format = array('MediaBox' => array('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297), 'CropBox' => array('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297), 'BleedBox' => array('llx' => 5, 'lly' => 5, 'urx' => 205, 'ury' => 292), 'TrimBox' => array('llx' => 10, 'lly' => 10, 'urx' => 200, 'ury' => 287), 'ArtBox' => array('llx' => 15, 'lly' => 15, 'urx' => 195, 'ury' => 282), 'Dur' => 3, 'trans' => array('D' => 1.5, 'S' => 'Split', 'Dm' => 'V', 'M' => 'O'), 'Rotate' => 90, 'PZ' => 1);
// Check the example n. 29 for viewer preferences
// add first page ---
$pdf->AddPage('P', $page_format, false, false);
$pdf->Cell(0, 12, 'First Page', 1, 1, 'C');
// add second page ---
$page_format['Rotate'] = 270;
$pdf->AddPage('P', $page_format, false, false);
$pdf->Cell(0, 12, 'Second Page', 1, 1, 'C');
// ---------------------------------------------------------
$this->comparePdfs($pdf);
}
示例8: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 035');
$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 . ' 035', 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('times', 'BI', 16);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of SetLineStyle() method', '', 0, 'L', true, 0, false, false, 0);
$pdf->Ln();
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => array(255, 0, 0)));
$pdf->SetFillColor(255, 255, 128);
$pdf->SetTextColor(0, 0, 128);
$text = "DUMMY";
$pdf->Cell(0, 0, $text, 1, 1, 'L', 1, 0);
$pdf->Ln();
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 255)));
$pdf->SetFillColor(255, 255, 0);
$pdf->SetTextColor(0, 0, 255);
$pdf->MultiCell(60, 4, $text, 1, 'C', 1, 0);
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 255, 0)));
$pdf->SetFillColor(0, 0, 255);
$pdf->SetTextColor(255, 255, 0);
$pdf->MultiCell(60, 4, $text, 'TB', 'C', 1, 0);
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 255)));
$pdf->SetFillColor(0, 255, 0);
$pdf->SetTextColor(255, 0, 255);
$pdf->MultiCell(60, 4, $text, 1, 'C', 1, 1);
$this->comparePdfs($pdf);
}
示例9: pdf
function pdf($kul)
{
require "/opt/tcpdf/tcpdf.php";
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetTitle('OMU UZEM 2010-2011 ÖN KAYIT FORMU');
$pdf->SetAuthor('Anonim');
$pdf->SetFont('dejavusans', '', 12);
$pdf->SetMargins(20, 60, 20);
$pdf->SetHeaderMargin(10);
$pdf->SetFooterMargin(10);
$pdf->SetHeaderData('uzem-head.jpg', 170, '', '');
$pdf->AddPage();
$pdf->SetFont('dejavusans', 'B', 18);
$pdf->Cell(0, 5, "2010-2011 Ebelik Lisans Tamamlama", 0, 1, 'C');
$pdf->Cell(0, 5, "Ön Kayıt Başvurusu", 0, 1, 'C');
$pdf->Ln(5);
$bilgiler = array('Kişisel Bilgiler' => array('tc' => 'TC Kimlik No', 'ad' => 'Ad', 'soyad' => 'Soyad', 'kizliksoyad' => 'Kızlık Soyadı', 'babaad' => 'Baba Adı', 'anaad' => 'Ana Adı', 'dogumil' => 'Doğum Yeri', 'dogumyil' => 'Doğum Yılı'), 'İletişim Bilgileri' => array('ceptel' => 'Cep Tel', 'evtel' => 'Ev Tel', 'email' => 'Email', 'evadres' => 'Ev Adres', 'il' => 'İl', 'ilce' => 'İlçe', 'uni' => 'Üniversite'), 'İş Bilgileri' => array('calismakurum' => 'Kurum', 'calismabirim' => 'Birim', 'isil' => 'İl', 'isilce' => 'İlçe'), 'Diğer Bilgiler' => array('tarih' => 'Ön Kayıt Tarihi'));
foreach ($bilgiler as $kesim => $bilgi) {
$pdf->SetFont('dejavusans', 'B', 14);
$pdf->Cell(0, 5, $kesim, 0, 1, 'L');
$pdf->SetFont('dejavusans', '', 10);
foreach ($bilgi as $alan => $baslik) {
$deger = $kul->{$alan};
$pdf->MultiCell(30, 1, $baslik . ':', 0, 'L', 0, 0, '25', '', true);
$pdf->MultiCell(180, 1, $deger, 0, 'L', 0, 0, '', '', true);
$pdf->Ln(5);
}
$pdf->Ln(5);
}
$pdf->Ln(15);
$pdf->Cell(0, 5, "Yukarıda vermiş olduğum bilgilerin doğruluğunu kabul ediyorum.", 0, 1, 'T');
$pdf->Ln(5);
$pdf->MultiCell(50, 1, 'Tarih:', 0, 'L', 0, 1, '120', '', true);
$pdf->MultiCell(50, 1, 'Ad Soyad:', 0, 'L', 0, 1, '120', '', true);
$pdf->MultiCell(50, 1, 'İmza:', 0, 'L', 0, 1, '120', '', true);
$pdf->Output();
}
示例10: checkoverflow
public function checkoverflow($arraydata, $txt = "")
{
$this->print_expression($arraydata);
if ($this->print_expression_result == true) {
if ($arraydata["link"]) {
$arraydata["link"] = $this->analyse_expression($arraydata["link"], "");
}
if ($arraydata["writeHTML"] == 1 && $this->pdflib == "TCPDF") {
$this->pdf->writeHTML($txt);
} elseif ($arraydata["poverflow"] == "true" && $arraydata["soverflow"] == "false") {
$this->pdf->Cell($arraydata["width"], $arraydata["height"], $this->formatText($txt, $arraydata["pattern"]), $arraydata["border"], "", $arraydata["align"], $arraydata["fill"], $arraydata["link"]);
} elseif ($arraydata["poverflow"] == "false" && $arraydata["soverflow"] == "false") {
while ($this->pdf->GetStringWidth($txt) > $arraydata["width"]) {
$txt = substr_replace($txt, "", -1);
}
$this->pdf->Cell($arraydata["width"], $arraydata["height"], $this->formatText($txt, $arraydata["pattern"]), $arraydata["border"], "", $arraydata["align"], $arraydata["fill"], $arraydata["link"]);
} elseif ($arraydata["poverflow"] == "false" && $arraydata["soverflow"] == "true") {
$this->pdf->MultiCell($arraydata["width"], $arraydata["height"], $this->formatText($txt, $arraydata["pattern"]), $arraydata["border"], $arraydata["align"], $arraydata["fill"]);
} else {
$this->pdf->MultiCell($arraydata["width"], $arraydata["height"], $this->formatText($txt, $arraydata["pattern"]), $arraydata["border"], $arraydata["align"], $arraydata["fill"]);
}
}
$this->print_expression_result = false;
}
示例11: list
fileSelect: Text file selection format.
password: Text password format.
alignment: Text layout in text fields.
buttonAlignX: X alignment of icon on button face.
buttonAlignY: Y alignment of icon on button face.
buttonFitBounds: Relative scaling of an icon to fit inside a button face.
buttonScaleHow: Relative scaling of an icon to fit inside a button face.
buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
highlight: Appearance of a button when pushed.
style: Glyph style for checkbox and radio buttons.
numItems: Number of items in a combo box or list box.
editable: Whether the user can type in a combo box.
multipleSelection: Whether multiple list box items may be selected.
Colors can be chosen in the following list (case sensitive): black white red green blue cyan magenta yellow dkGray gray ltGray or be in the form #RRGGBB.
*/
$pdf->Cell(0, 5, 'Subscription form', 0, 1, 'C');
$pdf->Ln(10);
$pdf->SetFont('', '', 12);
//First name
$pdf->Cell(35, 5, 'First name:');
$pdf->TextField('firstname', 50, 5, array('strokeColor' => 'ltGray'));
$pdf->Ln(6);
//Last name
$pdf->Cell(35, 5, 'Last name:');
$pdf->TextField('lastname', 50, 5, array('strokeColor' => 'ltGray'));
$pdf->Ln(6);
//Gender
$pdf->Cell(35, 5, 'Gender:');
$pdf->ComboBox('gender', 10, 5, array('', 'M', 'F'), array('strokeColor' => 'ltGray'));
$pdf->Ln(6);
//Drink
示例12:
//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', '', 18);
// print a line using Cell()
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE A', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE B', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE D', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE E', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE E-2', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE F', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE C', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE G', 0, 1, 'L');
// Move page 7 to page 3
示例13:
//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', 'B', 40);
// print a line using Cell()
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE: A', 0, 1, 'L');
// add some vertical space
$pdf->Ln(10);
// print some text
$pdf->SetFont('times', 'I', 16);
$txt = 'TCPDF allows you to Copy, Move and Delete pages.';
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('helvetica', 'B', 40);
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE: B', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE: D', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE: E', 0, 1, 'L');
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE: E-2', 0, 1, 'L');
示例14: getReportPDF
function getReportPDF($filterlist = false)
{
require_once 'libraries/tcpdf/tcpdf.php';
$reportData = $this->GenerateReport("PDF", $filterlist);
$arr_val = $reportData['data'];
if (isset($arr_val)) {
foreach ($arr_val as $wkey => $warray_value) {
foreach ($warray_value as $whd => $wvalue) {
if (strlen($wvalue) < strlen($whd)) {
$w_inner_array[] = strlen($whd);
} else {
$w_inner_array[] = strlen($wvalue);
}
}
$warr_val[] = $w_inner_array;
unset($w_inner_array);
}
foreach ($warr_val[0] as $fkey => $fvalue) {
foreach ($warr_val as $wkey => $wvalue) {
$f_inner_array[] = $warr_val[$wkey][$fkey];
}
sort($f_inner_array, 1);
$farr_val[] = $f_inner_array;
unset($f_inner_array);
}
foreach ($farr_val as $skkey => $skvalue) {
if ($skvalue[count($arr_val) - 1] == 1) {
$col_width[] = $skvalue[count($arr_val) - 1] * 50;
} else {
$col_width[] = $skvalue[count($arr_val) - 1] * 10 + 10;
}
}
$count = 0;
foreach ($arr_val[0] as $key => $value) {
$headerHTML .= '<td width="' . $col_width[$count] . '" bgcolor="#DDDDDD"><b>' . $this->getLstringforReportHeaders($key) . '</b></td>';
$count = $count + 1;
}
foreach ($arr_val as $key => $array_value) {
$valueHTML = "";
$count = 0;
foreach ($array_value as $hd => $value) {
$valueHTML .= '<td width="' . $col_width[$count] . '">' . $value . '</td>';
$count = $count + 1;
}
$dataHTML .= '<tr>' . $valueHTML . '</tr>';
}
}
$totalpdf = $this->GenerateReport("PRINT_TOTAL", $filterlist);
$html = '<table border="0.5"><tr>' . $headerHTML . '</tr>' . $dataHTML . '<tr><td>' . $totalpdf . '</td></tr>' . '</table>';
$columnlength = array_sum($col_width);
if ($columnlength > 14400) {
die("<br><br><center>" . $app_strings['LBL_PDF'] . " <a href='javascript:window.history.back()'>" . $app_strings['LBL_GO_BACK'] . ".</a></center>");
}
if ($columnlength <= 420) {
$pdf = new TCPDF('P', 'mm', 'A5', true);
} elseif ($columnlength >= 421 && $columnlength <= 1120) {
$pdf = new TCPDF('L', 'mm', 'A3', true);
} elseif ($columnlength >= 1121 && $columnlength <= 1600) {
$pdf = new TCPDF('L', 'mm', 'A2', true);
} elseif ($columnlength >= 1601 && $columnlength <= 2200) {
$pdf = new TCPDF('L', 'mm', 'A1', true);
} elseif ($columnlength >= 2201 && $columnlength <= 3370) {
$pdf = new TCPDF('L', 'mm', 'A0', true);
} elseif ($columnlength >= 3371 && $columnlength <= 4690) {
$pdf = new TCPDF('L', 'mm', '2A0', true);
} elseif ($columnlength >= 4691 && $columnlength <= 6490) {
$pdf = new TCPDF('L', 'mm', '4A0', true);
} else {
$columnhight = count($arr_val) * 15;
$format = array($columnhight, $columnlength);
$pdf = new TCPDF('L', 'mm', $format, true);
}
$pdf->SetMargins(10, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->setLanguageArray($l);
$pdf->AddPage();
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetFont('FreeSerif', 'B', 14);
$pdf->Cell($pdf->columnlength * 50, 10, getTranslatedString($oReport->reportname), 0, 0, 'C', 0);
//$pdf->writeHTML($oReport->reportname);
$pdf->Ln();
$pdf->SetFont('FreeSerif', '', 10);
$pdf->writeHTML($html);
return $pdf;
}
示例15: Cell
public function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '', $stretch = 0)
{
return parent::Cell($w, $h, to_utf8($txt), $border, $ln, $align, $fill, $link, $stretch);
}