API Documentation

Zend/Pdf/Page.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Pdf  
Version
$Id: Page.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Pdf_Page

Package: Zend\Pdf

PDF Page

Parent(s)
\Zend_Pdf_Canvas_Abstract
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  SIZE_A4 = '595:842:'

Size representing an A4 page in portrait (tall) orientation.

Constant  SIZE_A4_LANDSCAPE = '842:595:'

Size representing an A4 page in landscape (wide) orientation.

Constant  SIZE_LETTER = '612:792:'

Size representing a US Letter page in portrait (tall) orientation.

Constant  SIZE_LETTER_LANDSCAPE = '792:612:'

Size representing a US Letter page in landscape (wide) orientation.

Constant  SHAPE_DRAW_STROKE = 0

Stroke the path only. Do not fill.

Constant  SHAPE_DRAW_FILL = 1

Fill the path only. Do not stroke.

Constant  SHAPE_DRAW_FILL_AND_STROKE = 2

Fill and stroke the path.

Constant  FILL_METHOD_NON_ZERO_WINDING = 0

Fill the path using the non-zero winding rule.

Constant  FILL_METHOD_EVEN_ODD = 1

Fill the path using the even-odd rule.

Constant  LINE_DASHING_SOLID = 0

Solid line dash.

Properties

Propertyprotectedboolean  $_attached= ''

Flag which signals, that page is created separately from any PDF document or attached to anyone.

Details
Type
boolean
Propertyprotected\Zend_Pdf_Element_Reference|\Zend_Pdf_Element_Object  $_dictionary= ''

Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).

Propertyprotected\Zend_Pdf_ElementFactory_Interface  $_objFactory= 'null'

PDF objects factory.

Default valuenullDetails
Type
\Zend_Pdf_ElementFactory_Interface
Propertyprotectedboolean  $_safeGS= ''

Safe Graphics State semafore

If it's false, than we can't be sure Graphics State is restored withing context of previous contents stream (ex. drawing coordinate system may be rotated). We should encompass existing content with save/restore GS operators

Details
Type
boolean

Methods

methodpublic__clone( ) : void

Clone page, extract it and dependent objects from the current document, so it can be used within other docs.

methodpublic__construct( mixed $param1, mixed $param2 = null, mixed $param3 = null ) : void

Object constructor.

Constructor signatures:

  1. Load PDF page from a parsed PDF file.

Object factory is created by PDF parser.

new Zend_Pdf_Page(Zend_Pdf_Element_Dictionary $pageDict,

Zend_Pdf_ElementFactory_Interface $factory);

  1. Make a copy of the PDF page. New page is created in the same context as source page. Object factory is shared. Thus it will be attached to the document, but need to be placed into Zend_Pdf::$pages array

to be included into output.

new Zend_Pdf_Page(Zend_Pdf_Page $page);

  1. Create new page with a specified pagesize. If $factory is null then it will be created and page must be attached to the document to be

included into output.

new Zend_Pdf_Page(string $pagesize, Zend_Pdf_ElementFactory_Interface $factory = null);

  1. Create new page with a specified pagesize (in default user space units). If $factory is null then it will be created and page must be attached to the document to be

included into output.

new Zend_Pdf_Page(numeric $width, numeric $height, Zend_Pdf_ElementFactory_Interface $factory = null);

Parameters
Name Type Description
$param1 mixed
$param2 mixed
$param3 mixed
Throws
Exception Description
\Zend_Pdf_Exception
methodprotected_addProcSet( string $procSetName ) : void

Add procedureSet to the Page description

Parameters
Name Type Description
$procSetName string
methodprotected_attachResource( string $type, \Zend_Pdf_Resource $resource ) : string

Attach resource to the canvas

Method returns a name of the resource which can be used as a resource reference within drawing instructions stream Allowed types: 'ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font', 'Properties'

Parameters
Name Type Description
$type string
$resource \Zend_Pdf_Resource
Returns
Type Description
string
methodpublicattachAnnotation( \Zend_Pdf_Annotation $annotation ) : \Zend_Pdf_Page

Parameters
Name Type Description
$annotation \Zend_Pdf_Annotation
Returns
Type Description
\Zend_Pdf_Page
methodpublicextractFont(  $fontName ) : \Zend_Pdf_Resource_Font_Extracted|null

Extract font attached to the page by specific font name

$fontName should be specified in UTF-8 encoding

Parameters
Name Type Description
$fontName
Returns
Type Description
\Zend_Pdf_Resource_Font_Extracted|null
Throws
Exception Description
\Zend_Pdf_Exception
methodpublicextractFonts( ) : array

Extract fonts attached to the page

returns array of Zend_Pdf_Resource_Font_Extracted objects

Returns
Type Description
array
Throws
Exception Description
\Zend_Pdf_Exception
methodpublicflush( ) : void

Dump current drawing instructions into the content stream.

Throws
Exception Description
\Zend_Pdf_Exception
Details
Todo
Don't forget to close all current graphics operations (like path drawing)  
methodpublicgetHeight( ) : float

Return the height of this page in points.

Returns
Type Description
float
methodpublicgetWidth( ) : float

Return the width of this page in points.

Returns
Type Description
float
methodpublicrender( \Zend_Pdf_ElementFactory_Interface $objFactory ) : void

Prepare page to be rendered into PDF.

Parameters
Name Type Description
$objFactory \Zend_Pdf_ElementFactory_Interface
Throws
Exception Description
\Zend_Pdf_Exception
Details
Todo
Don't forget to close all current graphics operations (like path drawing)  
Documentation was generated by DocBlox 0.15.1.