本文整理汇总了PHP中TCPDF::setPrintFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::setPrintFooter方法的具体用法?PHP TCPDF::setPrintFooter怎么用?PHP TCPDF::setPrintFooter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::setPrintFooter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TCPDF
function __construct()
{
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$this->pdf = $pdf;
$this->widths = new stdClass();
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(false);
$pdf->AddPage();
}
示例2: run
public function run()
{
include getcwd() . '/vendor/autoload.php';
$navStructure = (include getcwd() . '/docs/navigation.php');
echo "Loading markdown...\n";
$markdown = $this->findMarkdown($navStructure);
echo "Converting markdown to html...\n";
$Parsedown = new \Parsedown();
$html = $Parsedown->text($markdown);
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
#$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('My Documentation');
#$pdf->SetSubject('TCPDF Tutorial');
#$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetFont('helvetica', '', 20);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->AddPage();
$pdf->writeHTML($html, true, 0, true, 0);
$pdf->lastPage();
echo "Writing PDF...\n";
$pdf->Output($this->config['output'], 'F');
echo "Complete.\n";
}
示例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: __construct
/**
* 初始化
*
* @access public
* @param array $params 初始化参数
* @return void
*/
public function __construct($params)
{
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor($this->pdf_author);
$pdf->SetTitle($this->pdf_title);
$pdf->SetSubject($this->pdf_subject);
$pdf->SetKeywords($this->pdf_keywords);
// 不显示头部和底部
$pdf->setPrintHeader(FALSE);
$pdf->setPrintFooter(FALSE);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//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
require TCPDF_BASE_PATH . 'tcpdf/config/lang/eng.php';
$pdf->setLanguageArray($l);
// set font
$pdf->SetFont('stsongstdlight', '', 10);
$pdf->AddPage();
$pdf->writeHTML($params['content'], true, false, true, false, '');
$pdf->lastPage();
// 输出方式 I:浏览器直接输出 D:文件下载 如果需要浏览器输出或者下载的同时生成文件请在前面加上F
$pdf->Output($params['filename'], $params['flag']);
}
示例5: renderRfqRequest
/**
* Render a PDF file and show in browser or save to disk
* If save to disk return file location
*/
public function renderRfqRequest($quote, $saveToDisk = false)
{
$storeid = $quote->getStoreId();
if ($storeid) {
$appEmulation = Mage::getSingleton('core/app_emulation');
$initial = $appEmulation->startEnvironmentEmulation($storeid, Mage_Core_Model_App_Area::AREA_FRONTEND, true);
}
$pdf = new TCPDF();
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->AddPage();
$pdf->SetAutoPageBreak(true, 30);
$pdf->setHeaderMargin(20);
$pdf->setFooterMargin(20);
$pdf->setImageScale(1.5);
$emailtext = Mage::helper('request4quote/email')->sendRequestProposalNotification($quote, false, true);
$pdf->writeHTML(Mage::helper('cms')->getBlockTemplateProcessor()->filter($emailtext), false);
$pdf->endPage();
if ($storeid) {
$appEmulation->stopEnvironmentEmulation($initial);
}
$rfqfilename = 'rfq_' . $quote->getId() . '.pdf';
if (!$saveToDisk) {
return $pdf->Output($rfqfilename);
} else {
if ($saveToDisk) {
$filePath = $this->getFilePath() . $rfqfilename;
$pdf->Output($filePath, 'F');
return $filePath;
}
}
exit;
}
示例6: pdf
/**
* @param string $html 要转为pdf的内容
* @param string $filename 文件名
* @param string $type 'I'在页面中显示;'D'直接下载
*/
public static function pdf($html, $filename = 'hzd.pdf', $type = 'I')
{
import("Tools.TCPDF.TCPDF");
import("Tools.TCPDF.config.tcpdf_config.php");
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('HZD');
$pdf->SetTitle('HZD');
$pdf->SetSubject('HZD');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$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);
$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 font
$pdf->SetFont('stsongstdlight', '', 20);
// add a page
$pdf->AddPage();
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output($filename, $type);
}
示例7: convertHtmlToPdf
function convertHtmlToPdf($html)
{
if (!$html) {
throw new \Exception("Html Not Given");
}
$pagelayout = array($this->options['width'], $this->options['height']);
// or array($width,$height)
$pdf = new \TCPDF('l', 'px', $pagelayout, true, 'UTF-8', false);
$pdf->SetMargins(0, 0, 0);
$pdf->SetHeaderMargin(0);
$pdf->SetFooterMargin(0);
// $pdf = new \TCPDF_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(false);
if ($this->options['header_font_family']) {
$pdf->SetFont($this->options['header_font_family']);
}
// add a page
$pdf->AddPage();
$pdf->WriteHTML($html, true, false, true, false);
$this->pdf = $pdf->Output(null, 'S');
//for test
// $this->pdf = $pdf->Output(null);
// echo $this->pdf;
// exit;
}
示例8: list
/**
* Class constructor
*
* @param mixed $paper The size of paper to use either a string (see {@link CPDF_Adapter::$PAPER_SIZES}) or
* an array(xmin,ymin,xmax,ymax)
* @param string $orientation The orientation of the document (either 'landscape' or 'portrait')
* @param DOMPDF $dompdf
*/
function __construct($paper = "letter", $orientation = "portrait", DOMPDF $dompdf)
{
//***
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
$ori = 'P';
// ***
if (mb_strtolower($orientation) === "landscape") {
list($size[2], $size[3]) = array($size[3], $size[2]);
$ori = 'L';
// ***
}
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_dompdf = $dompdf;
//***$this->_pdf = new My_TCPDF('P', 'pt', $paper, true, 'UTF-8', false);
$this->_pdf = new My_TCPDF($ori, 'pt', $paper, true, 'UTF-8', false);
// ***
$this->_pdf->SetCreator("DOMPDF Converter");
// CreationDate and ModDate info are added by TCPDF itself
// don't use TCPDF page defaults
$this->_pdf->SetAutoPageBreak(false);
$this->_pdf->SetMargins(0, 0, 0, true);
$this->_pdf->setPrintHeader(false);
// remove default header/footer
$this->_pdf->setPrintFooter(false);
$this->_pdf->setHeaderMargin(0);
$this->_pdf->setFooterMargin(0);
$this->_pdf->SetCellPadding(0);
$this->_pdf->AddPage();
$this->_pdf->SetDisplayMode('fullpage', 'continuous');
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->PageNo());
$this->_image_cache = array();
// other TCPDF stuff...
$this->_objs = array();
// for templating support
$this->_nameddest = array();
// for internal link support
$this->_internal_links = array();
// " " "
$this->_pdf->setAlpha(1.0);
$this->_currentLineTransparency = array("mode" => "Normal", "opacity" => 1.0);
$this->_currentFillTransparency = array("mode" => "Normal", "opacity" => 1.0);
$this->_last_fill_color = $this->_last_stroke_color = null;
//dompdf_debug("trace", "Exit");
}
示例9: getPdfData
private function getPdfData()
{
$pdf = new \TCPDF();
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetFont('times', 'BI', 12);
$pdf->AddPage();
$pdf->Write(0, 'Fichier pdf', '', 0, 'C', true, 0, false, false, 0);
return $pdf->Output('fichier.pdf', 'S');
}
示例10: Adresaro
function Adresaro()
{
$pdf = new TCPDF();
$tiparo = "freesans";
$pdf->AddFont($tiparo, '', $tiparo . ".php");
$pdf->AddFont($tiparo, 'B', $tiparo . "b.php");
$pdf->setFont($tiparo);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->setAutoPageBreak(false);
$pdf->Open();
$this->pdf =& $pdf;
}
示例11: orderViewPDF
function orderViewPDF()
{
$l = null;
require_once OSEMSC_F_PATH . DS . 'libraries' . DS . 'tcpdf' . DS . 'tcpdf.php';
require_once OSEMSC_F_PATH . DS . 'libraries' . DS . 'tcpdf' . DS . 'config' . DS . 'lang' . DS . 'eng.php';
$order_id = JRequest::getInt('order_id', 0);
//$my = JFactory::getUser();
$member_id = JRequest::getInt('member_id', 0);
$where = array();
$where[] = " `order_id` = {$order_id}";
$where[] = " `user_id` = {$member_id}";
$orderInfo = oseRegistry::call('payment')->getOrder($where, 'obj');
if (empty($orderInfo)) {
$result = array();
$result['title'] = 'Error';
$result['content'] = 'Error';
oseExit('Error');
}
$receipt = oseRegistry::call('member')->getReceipt($orderInfo);
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('OSEMSC');
$pdf->SetTitle('Invoice #' . $order_id);
$pdf->SetSubject('Invoice');
$pdf->SetKeywords('invoice');
// set default header data
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->SetMargins(30, 18, 30);
//set some language-dependent strings
$pdf->setLanguageArray($l);
$pdf->SetAutoPageBreak(TRUE, 10);
$pdf->AddPage();
//ob_get_clean();
$pdf->WriteHTML($receipt->body, true);
$pdf->Output("Invoice-#{$order_id}.pdf", "I");
oseExit();
/*
//$receipt = self::orderView();
$order_id = JRequest::getInt('order_id');
$app = JFactory::getApplication('SITE');
//oseExit('dfdf');
$app->redirect( JRoute::_('index.php?option=com_osemsc&view=member&format=pdf&memberTask=generateOrderView&order_id='.$order_id));
*/
}
示例12: __construct
public function __construct()
{
// $orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false
$pdf = new \TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont('courier');
$pdf->SetMargins(10, 10, 7, true);
$pdf->SetAutoPageBreak(true, 5);
$pdf->setImageScale(1);
$pdf->SetFont('freeserif', '', 12, '', false);
$pdf->SetLineWidth(0.05);
$this->pdf = $pdf;
$this->cell = new cell($this->pdf);
}
示例13: initializePdf
/**
*
* @param string $orientation P / L
* @param string $size paper size
* @param string $title document title
* @return \TCPDF model
*/
public function initializePdf($orientation, $size, $title)
{
Yii::createComponent('ext.tcpdf.TcPdf', 'P', 'cm', 'A4', true, 'UTF-8');
spl_autoload_unregister(array('YiiBase', 'autoload'));
$pdf = new TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
spl_autoload_register(array('YiiBase', 'autoload'));
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetTitle($title);
//no headers and footers
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
//automatically insert page break bottom
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->addPage($orientation, $size);
return $pdf;
}
示例14: create_pdf_from_eml
public function create_pdf_from_eml($piler_id = '', $text = '', $images = array())
{
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetAuthor('Yourcompany Ltd');
$pdf->SetTitle('EML email title');
$pdf->SetSubject('EML email subject');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,190,255), array(0,64,128));
//$pdf->setFooterData($tc=array(0,64,0), $lc=array(0,64,128));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
//$pdf->SetMargins(10, 25, 10);
$pdf->SetMargins(10, 5, 10);
//$pdf->SetHeaderMargin(120);
//$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
//set auto page breaks
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->SetAutoPageBreak(TRUE, 20);
//set image scale factor
//$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
//$pdf->setLanguageArray($l);
// set default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
$pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->AddPage();
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $text, $border = 0, $ln = 1, $fill = 0, $reseth = true, 'L', $autopadding = true);
$i = 0;
foreach ($images as $img) {
if ($i > 0) {
$pdf->AddPage();
}
$pdf->Image(DIR_BASE . 'tmp/' . $img['id']);
$i++;
}
$pdf->Output(DIR_BASE . 'tmp/' . $piler_id . '.pdf', 'F');
}
示例15: exportDataToPDF
function exportDataToPDF($content)
{
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Matija Lovreković');
$pdf->SetTitle('Rezultati pretrage');
$pdf->SetSubject('DWA Lab 4');
$pdf->SetKeywords('DWA');
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->SetFont('dejavusans', '', 20, '', true);
$pdf->AddPage();
$pdf->writeHTML($content);
ob_end_clean();
$pdf->Output('rezultati_pretrage.pdf', 'I');
}