Pdf/Page.php
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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Pdf
- Version
- $Id$
\Zend_Pdf_Page
Package: Zend_Pdf
Throws
Returns
Returns
Throws
Throws
PDF Page
- Parent(s)
- \Zend_Pdf_Canvas_Abstract
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
SIZE_LETTER_LANDSCAPE
= '792:612:'
Size representing a US Letter page in landscape (wide) orientation.
Properties
boolean $_attached
Flag which signals, that page is created separately from any PDF document or
attached to anyone.
Details
- Type
- boolean
\Zend_Pdf_Element_Reference|\Zend_Pdf_Element_Object $_dictionary
Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).
Details
Methods
__clone() : void
Clone page, extract it and dependent objects from the current document, so it can be used within other docs.
__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);
---------------------------------------------------------
2. 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);
---------------------------------------------------------
3. 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);
---------------------------------------------------------
4. 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);
---------------------------------------------------------
ParametersName | Type | Description |
---|---|---|
$param1 | mixed | |
$param2 | mixed | |
$param3 | mixed |
Exception | Description |
---|---|
\Zend_Pdf_Exception |
_addProcSet(string $procSetName) : void
Add procedureSet to the Page description
Parameters
Name | Type | Description |
---|---|---|
$procSetName | string |
_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'
ParametersName | Type | Description |
---|---|---|
$type | string | |
$resource | \Zend_Pdf_Resource |
Type | Description |
---|---|
string |
attachAnnotation(\Zend_Pdf_Annotation $annotation) : \Zend_Pdf_Page
Parameters
Returns
Name | Type | Description |
---|---|---|
$annotation | \Zend_Pdf_Annotation |
Type | Description |
---|---|
\Zend_Pdf_Page |
extractFont( $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
ParametersName | Type | Description |
---|---|---|
$fontName |
Type | Description |
---|---|
\Zend_Pdf_Resource_Font_Extracted | null |
Exception | Description |
---|---|
\Zend_Pdf_Exception |
extractFonts() : array
Extract fonts attached to the page
returns array of Zend_Pdf_Resource_Font_Extracted objects
ReturnsType | Description |
---|---|
array |
Exception | Description |
---|---|
\Zend_Pdf_Exception |
flush() : void
Dump current drawing instructions into the content stream.
Throws
Details
Exception | Description |
---|---|
\Zend_Pdf_Exception |
- Todo
- Don't forget to close all current graphics operations (like path drawing)
render(\Zend_Pdf_ElementFactory_Interface $objFactory) : void
Prepare page to be rendered into PDF.
Parameters
Throws
Details
Name | Type | Description |
---|---|---|
$objFactory | \Zend_Pdf_ElementFactory_Interface |
Exception | Description |
---|---|
\Zend_Pdf_Exception |
- Todo
- Don't forget to close all current graphics operations (like path drawing)