当前位置: 首页>>代码示例>>PHP>>正文


PHP TCPDF::setPrintHeader方法代码示例

本文整理汇总了PHP中TCPDF::setPrintHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::setPrintHeader方法的具体用法?PHP TCPDF::setPrintHeader怎么用?PHP TCPDF::setPrintHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCPDF的用法示例。


在下文中一共展示了TCPDF::setPrintHeader方法的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();
 }
开发者ID:RodrigoBattagliero,项目名称:Cifras,代码行数:10,代码来源:TableWriterPDF.php

示例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";
 }
开发者ID:dev-lucid,项目名称:lucid,代码行数:27,代码来源:BuildDocs.php

示例3: 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);
 }
开发者ID:hzd1989,项目名称:tcpdf,代码行数:40,代码来源:Pdf.class.php

示例4: 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;
 }
开发者ID:xepan,项目名称:commerce,代码行数:27,代码来源:RenderCalendar.php

示例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;
 }
开发者ID:VinuWebtech,项目名称:production267,代码行数:37,代码来源:Quotepdf.php

示例6: 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();
 }
开发者ID:haya-sann,项目名称:INTER-Mediator,代码行数:27,代码来源:PDFSample.php

示例7: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $loggedInUserId = $session->get('user/id');
     $pageId = $request->get('id');
     $page = $this->getRepository(Entity::class)->getById($pageId, $loggedInUserId);
     // create new PDF document
     $pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $pdf->setPrintHeader(false);
     //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('dejavusans', '', 10);
     // add a page
     $pdf->AddPage();
     $html = $page['content'];
     $pdf->writeHTML($html, true, false, true, false, '');
     // Close and output PDF document
     $pdf->Output('./../../' . $page['name'] . '.pdf', 'D');
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:EntityExportPdfController.php

示例8: __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']);
 }
开发者ID:tmlsoft,项目名称:main,代码行数:35,代码来源:pdf.php

示例9: 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");
 }
开发者ID:demian054,项目名称:APCB_WebPagePHP,代码行数:63,代码来源:tcpdf_adapter.cls.php

示例10: 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');
 }
开发者ID:famfij,项目名称:TP-BilletsDuLouvre,代码行数:11,代码来源:TicketsSenderTest.php

示例11: 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;
 }
开发者ID:BackupTheBerlios,项目名称:aligilo-svn,代码行数:13,代码来源:kreu_adresaron_plurkolumna.php

示例12: save

 /**
  *  Save PHPExcel to file
  *
  *  @param     string     $pFilename   Name of the file to save as
  *  @throws    PHPExcel_Writer_Exception
  */
 public function save($pFilename = null)
 {
     $fileHandle = parent::prepareForSave($pFilename);
     //  Default PDF paper size
     $paperSize = 'LETTER';
     //    Letter    (8.5 in. by 11 in.)
     //  Check for paper size and page orientation
     if (is_null($this->getSheetIndex())) {
         $orientation = $this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 'L' : 'P';
         $printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
         $printMargins = $this->_phpExcel->getSheet(0)->getPageMargins();
     } else {
         $orientation = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 'L' : 'P';
         $printPaperSize = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
         $printMargins = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
     }
     //  Override Page Orientation
     if (!is_null($this->getOrientation())) {
         $orientation = $this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 'L' : 'P';
     }
     //  Override Paper Size
     if (!is_null($this->getPaperSize())) {
         $printPaperSize = $this->getPaperSize();
     }
     if (isset(self::$paperSizes[$printPaperSize])) {
         $paperSize = self::$paperSizes[$printPaperSize];
     }
     //  Create PDF
     $pdf = new TCPDF($orientation, 'pt', $paperSize);
     $pdf->setFontSubsetting(false);
     //    Set margins, converting inches to points (using 72 dpi)
     $pdf->SetMargins($printMargins->getLeft() * 72, $printMargins->getTop() * 72, $printMargins->getRight() * 72);
     $pdf->SetAutoPageBreak(true, $printMargins->getBottom() * 72);
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->AddPage();
     //  Set the appropriate font
     $pdf->SetFont($this->getFont());
     $pdf->writeHTML($this->generateHTMLHeader(false) . $this->generateSheetData() . $this->generateHTMLFooter());
     //  Document info
     $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
     $pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
     $pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
     $pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
     $pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
     //  Write to file
     fwrite($fileHandle, $pdf->output($pFilename, 'S'));
     parent::restoreStateAfterSave($fileHandle);
 }
开发者ID:sisinduku,项目名称:StarTrek,代码行数:55,代码来源:tcPDF.php

示例13: 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));
     */
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:49,代码来源:member.order.php

示例14: __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);
 }
开发者ID:binaryk,项目名称:terenuripedia,代码行数:15,代码来源:topdf.php

示例15: 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;
 }
开发者ID:wanyos2005,项目名称:hsbf,代码行数:24,代码来源:Pdf.php


注:本文中的TCPDF::setPrintHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。