30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-05 23:30:47 +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)
- Method sendOutputData() was improved to include deflate encoding.
- 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
Version: 5.9.087
Version: 5.9.088
Release date: 2011-06-01
Author: Nicola Asuni

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : example_051.php
// Begin : 2009-04-16
// Last Update : 2010-08-08
// Last Update : 2011-06-01
//
// Description : Example 051 for TCPDF class
// Full page background
@ -35,15 +35,19 @@ require_once('../tcpdf.php');
class MYPDF extends TCPDF {
//Page header
public function Header() {
// full background image
// store current auto-page-break status
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = K_PATH_IMAGES.'image_demo.jpg';
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
}
}
@ -101,11 +105,41 @@ $pdf->AddPage();
$html = '<span style="background-color:yellow;color:blue;">&nbsp;PAGE 2&nbsp;</span>';
$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
$pdf->Output('example_051.pdf', 'I');
//============================================================+
// END OF FILE
// END OF FILE
//============================================================+

View File

@ -1,7 +1,7 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.087
// Version : 5.9.088
// Begin : 2002-08-03
// 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
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @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.
@ -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>
* @package com.tecnick.tcpdf
* @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
*/
class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.087';
private $tcpdf_version = '5.9.088';
// Protected properties
@ -3442,6 +3442,16 @@ class TCPDF {
$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.
* @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>