32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-29 23:53:54 +00:00
This commit is contained in:
nicolaasuni 2011-06-01 10:45:43 +02:00
parent ad4f8613ba
commit 60b4752dcb
4 changed files with 57 additions and 9 deletions

View File

@ -1,3 +1,7 @@
5.9.088 (2011-06-01)
- Method getAutoPageBreak() was added (see example n. 51).
- Example n. 51 (full page background) was updated.
5.9.087 (2011-06-01) 5.9.087 (2011-06-01)
- Method sendOutputData() was improved to include deflate encoding. - Method sendOutputData() was improved to include deflate encoding.
- Barcode classes on PHP 4 version were fixed. - Barcode classes on PHP 4 version were fixed.

View File

@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.087 Version: 5.9.088
Release date: 2011-06-01 Release date: 2011-06-01
Author: Nicola Asuni Author: Nicola Asuni

View File

@ -2,7 +2,7 @@
//============================================================+ //============================================================+
// File name : example_051.php // File name : example_051.php
// Begin : 2009-04-16 // Begin : 2009-04-16
// Last Update : 2010-08-08 // Last Update : 2011-06-01
// //
// Description : Example 051 for TCPDF class // Description : Example 051 for TCPDF class
// Full page background // Full page background
@ -35,15 +35,19 @@ require_once('../tcpdf.php');
class MYPDF extends TCPDF { class MYPDF extends TCPDF {
//Page header //Page header
public function Header() { public function Header() {
// full background image // get the current page break margin
// store current auto-page-break status
$bMargin = $this->getBreakMargin(); $bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak; $auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0); $this->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = K_PATH_IMAGES.'image_demo.jpg'; $img_file = K_PATH_IMAGES.'image_demo.jpg';
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0); $this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status // restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin); $this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
} }
} }
@ -101,6 +105,36 @@ $pdf->AddPage();
$html = '<span style="background-color:yellow;color:blue;">&nbsp;PAGE 2&nbsp;</span>'; $html = '<span style="background-color:yellow;color:blue;">&nbsp;PAGE 2&nbsp;</span>';
$pdf->writeHTML($html, true, false, true, false, ''); $pdf->writeHTML($html, true, false, true, false, '');
// --- example with background set on page ---
// remove default header
$pdf->setPrintHeader(false);
// add a page
$pdf->AddPage();
// -- set new background ---
// get the current page break margin
$bMargin = $pdf->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $pdf->getAutoPageBreak();
// disable auto-page-break
$pdf->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = K_PATH_IMAGES.'image_demo.jpg';
$pdf->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$pdf->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$pdf->setPageMark();
// Print a text
$html = '<span style="color:white;text-align:center;font-weight:bold;font-size:80pt;">PAGE 3</span>';
$pdf->writeHTML($html, true, false, true, false, '');
// --------------------------------------------------------- // ---------------------------------------------------------
//Close and output PDF document //Close and output PDF document

View File

@ -1,7 +1,7 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.087 // Version : 5.9.088
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-06-01 // Last Update : 2011-06-01
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 5.9.087 * @version 5.9.088
*/ */
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -146,7 +146,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php');
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions. * @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.087 * @version 5.9.088
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.087'; private $tcpdf_version = '5.9.088';
// Protected properties // Protected properties
@ -3442,6 +3442,16 @@ class TCPDF {
$this->PageBreakTrigger = $this->h - $margin; $this->PageBreakTrigger = $this->h - $margin;
} }
/**
* Return the auto-page-break mode (true or false).
* @return boolean auto-page-break mode
* @public
* @since 5.9.088
*/
public function getAutoPageBreak() {
return $this->AutoPageBreak;
}
/** /**
* Defines the way the document is to be displayed by the viewer. * Defines the way the document is to be displayed by the viewer.
* @param $zoom (mixed) The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. <ul><li>fullpage: displays the entire page on screen </li><li>fullwidth: uses maximum width of window</li><li>real: uses real size (equivalent to 100% zoom)</li><li>default: uses viewer default mode</li></ul> * @param $zoom (mixed) The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. <ul><li>fullpage: displays the entire page on screen </li><li>fullwidth: uses maximum width of window</li><li>real: uses real size (equivalent to 100% zoom)</li><li>default: uses viewer default mode</li></ul>