Zend Framework
1.12
|
Public Member Functions | |
save ($filename, $updateOnly=false) | |
Render PDF document and save it. | |
__construct ($source=null, $revision=null, $load=false) | |
Creates or loads PDF document. | |
revisions () | |
Retrive number of revisions. | |
rollback ($steps) | |
Rollback document $steps number of revisions. | |
newPage ($param1, $param2=null) | |
Create page object, attached to the PDF document. | |
getMetadata () | |
Return the document-level Metadata or null Metadata stream is not presented. | |
setMetadata ($metadata) | |
Sets the document-level Metadata (mast be valid XMP document) | |
getJavaScript () | |
Return the document-level JavaScript or null if there is no JavaScript for this document. | |
getOpenAction () | |
Get open Action Returns Zend_Pdf_Target (Zend_Pdf_Destination or Zend_Pdf_Action object) | |
setOpenAction (Zend_Pdf_Target $openAction=null) | |
Set open Action which is actually Zend_Pdf_Destination or Zend_Pdf_Action object. | |
getNamedDestinations () | |
Return an associative array containing all the named destinations (or GoTo actions) in the PDF. | |
getNamedDestination ($name) | |
Return specified named destination. | |
setNamedDestination ($name, $destination=null) | |
Set specified named destination. | |
resolveDestination (Zend_Pdf_Destination $destination, $refreshPageCollectionHashes=true) | |
Resolve destination. | |
extractFonts () | |
Extract fonts attached to the document. | |
extractFont ($fontName) | |
Extract font attached to the page by specific font name. | |
render ($newSegmentOnly=false, $outputStream=null) | |
Render the completed PDF to a string. | |
setJavaScript ($javascript) | |
Set the document-level JavaScript. | |
Static Public Member Functions | |
static | getMemoryManager () |
Request used memory manager. | |
static | setMemoryManager (Zend_Memory_Manager $memoryManager) |
Set user defined memory manager. | |
static | parse (&$source=null, $revision=null) |
Create new PDF document from a $source string. | |
static | load ($source=null, $revision=null) |
Load PDF document from a file. | |
static | pdfDate ($timestamp=null) |
Convert date to PDF format (it's close to ASN.1 (Abstract Syntax Notation One) defined in ISO/IEC 8824). | |
Public Attributes | |
const | PDF_VERSION = '1.4' |
Version number of generated PDF documents. | |
const | PDF_HEADER = "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n" |
PDF file header. | |
$pages = array() | |
$properties = array() | |
$outlines = array() | |
Protected Member Functions | |
_loadPages (Zend_Pdf_Element_Reference $pages, $attributes=array()) | |
Load pages recursively. | |
_loadNamedDestinations (Zend_Pdf_Element_Reference $root, $pdfHeaderVersion) | |
Load named destinations recursively. | |
_loadOutlines (Zend_Pdf_Element_Reference $root) | |
Load outlines recursively. | |
_dumpPages () | |
Orginize pages to tha pages tree structure. | |
_dumpNamedDestinations () | |
Dump named destinations. | |
_dumpOutlines () | |
Dump outlines recursively. | |
_refreshPagesHash () | |
Refresh page collection hashes. | |
_cleanUpAction (Zend_Pdf_Action $action, $refreshPageCollectionHashes=true) | |
Walk through action and its chained actions tree and remove nodes if they are GoTo actions with an unresolved target. | |
Protected Attributes | |
$_originalProperties = array() | |
$_javaScript = null | |
$_namedTargets = array() | |
$_originalOutlines = array() | |
$_originalOpenOutlinesCount = 0 | |
$_trailer = null | |
$_objFactory = null | |
$_parser | |
$_isNewDocument = true | |
$_pageReferences = null | |
$_pageNumbers = null | |
Static Protected Attributes | |
static | $_memoryManager = null |
static | $_inheritableAttributes = array('Resources', 'MediaBox', 'CropBox', 'Rotate') |
__construct | ( | $source = null , |
|
$revision = null , |
|||
$load = false |
|||
) |
Creates or loads PDF document.
If $source is null, then it creates a new document.
If $source is a string and $load is false, then it loads document from a binary string.
If $source is a string and $load is true, then it loads document from a file.
$revision used to roll back document to specified version (0 - current version, 1 - previous version, 2 - ...)
string | $source | - PDF file to load |
integer | $revision |
Zend_Pdf_Exception |
Document id
Document catalog indirect object.
Pages container
|
protected |
Walk through action and its chained actions tree and remove nodes if they are GoTo actions with an unresolved target.
Returns null if root node is deleted or updated action overwise.
Zend_Pdf_Action | $action | |
boolean | $refreshPagesHash | Refresh page collection hashes before processing |
|
protected |
Dump named destinations.
|
protected |
Dump outlines recursively.
|
protected |
|
protected |
Load named destinations recursively.
Zend_Pdf_Element_Reference | $root | Document catalog entry |
string | $pdfHeaderVersion |
Zend_Pdf_Exception |
|
protected |
Load outlines recursively.
Zend_Pdf_Element_Reference | $root | Document catalog entry |
|
protected |
Load pages recursively.
Zend_Pdf_Element_Reference | $pages | |
array | null | $attributes |
Important note. If any attribute or dependant object is an indirect object, then it's still shared between pages.
|
protected |
Refresh page collection hashes.
extractFont | ( | $fontName | ) |
Extract font attached to the page by specific font name.
$fontName should be specified in UTF-8 encoding
Zend_Pdf_Exception |
extractFonts | ( | ) |
Extract fonts attached to the document.
returns array of Zend_Pdf_Resource_Font_Extracted objects
Zend_Pdf_Exception |
getJavaScript | ( | ) |
Return the document-level JavaScript or null if there is no JavaScript for this document.
|
static |
Request used memory manager.
getMetadata | ( | ) |
Return the document-level Metadata or null Metadata stream is not presented.
getNamedDestination | ( | $name | ) |
Return specified named destination.
string | $name |
getNamedDestinations | ( | ) |
Return an associative array containing all the named destinations (or GoTo actions) in the PDF.
Named targets can be used to reference from outside the PDF, ex: 'http://www.something.com/mydocument.pdf#MyAction'
getOpenAction | ( | ) |
Get open Action Returns Zend_Pdf_Target (Zend_Pdf_Destination or Zend_Pdf_Action object)
|
static |
newPage | ( | $param1, | |
$param2 = null |
|||
) |
Create page object, attached to the PDF document.
Method signatures:
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); ---------------------------------------------------------
2. 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); ---------------------------------------------------------
mixed | $param1 | |
mixed | $param2 |
|
static |
Create new PDF document from a $source string.
string | $source | |
integer | $revision |
|
static |
Convert date to PDF format (it's close to ASN.1 (Abstract Syntax Notation One) defined in ISO/IEC 8824).
integer | $timestamp | (optional) If omitted, uses the current time. |
render | ( | $newSegmentOnly = false , |
|
$outputStream = null |
|||
) |
Render the completed PDF to a string.
If $newSegmentOnly is true and it's not a new document, then only appended part of PDF is returned.
boolean | $newSegmentOnly | |
resource | $outputStream |
Zend_Pdf_Exception |
resolveDestination | ( | Zend_Pdf_Destination | $destination, |
$refreshPageCollectionHashes = true |
|||
) |
Resolve destination.
Returns Zend_Pdf_Page page object or null if destination is not found within PDF document.
Zend_Pdf_Destination | $destination | Destination to resolve |
boolean | $refreshPagesHash | Refresh page collection hashes before processing |
Zend_Pdf_Exception |
revisions | ( | ) |
Retrive number of revisions.
rollback | ( | $steps | ) |
Rollback document $steps number of revisions.
This method must be invoked before any changes, applied to the document. Otherwise behavior is undefined.
integer | $steps |
save | ( | $filename, | |
$updateOnly = false |
|||
) |
Render PDF document and save it.
If $updateOnly is true and it's not a new document, then it only appends new section to the end of file.
string | $filename | |
boolean | $updateOnly |
Zend_Pdf_Exception |
setJavaScript | ( | $javascript | ) |
Set the document-level JavaScript.
string | $javascript |
|
static |
Set user defined memory manager.
Zend_Memory_Manager | $memoryManager |
setMetadata | ( | $metadata | ) |
Sets the document-level Metadata (mast be valid XMP document)
string | $metadata |
setNamedDestination | ( | $name, | |
$destination = null |
|||
) |
Set specified named destination.
string | $name | |
Zend_Pdf_Destination_Explicit | Zend_Pdf_Action_GoTo | $target |
setOpenAction | ( | Zend_Pdf_Target | $openAction = null | ) |
Set open Action which is actually Zend_Pdf_Destination or Zend_Pdf_Action object.
Zend_Pdf_Target | $openAction |
|
staticprotected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
$outlines = array() |
$pages = array() |
$properties = array() |
const PDF_HEADER = "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n" |
PDF file header.
const PDF_VERSION = '1.4' |
Version number of generated PDF documents.