Public Member Functions |
| save ($filename, $updateOnly=false) |
| __construct ($source=null, $revision=null, $load=false) |
| revisions () |
| rollback ($steps) |
| newPage ($param1, $param2=null) |
| getMetadata () |
| setMetadata ($metadata) |
| getJavaScript () |
| getOpenAction () |
| setOpenAction (Zend_Pdf_Target $openAction=null) |
| getNamedDestinations () |
| getNamedDestination ($name) |
| setNamedDestination ($name, $destination=null) |
| resolveDestination (Zend_Pdf_Destination $destination, $refreshPageCollectionHashes=true) |
| extractFonts () |
| extractFont ($fontName) |
| render ($newSegmentOnly=false, $outputStream=null) |
| setJavaScript ($javascript) |
Static Public Member Functions |
static | getMemoryManager () |
static | setMemoryManager (Zend_Memory_Manager $memoryManager) |
static | parse (&$source=null, $revision=null) |
static | load ($source=null, $revision=null) |
static | pdfDate ($timestamp=null) |
Data Fields |
const | PDF_VERSION = '1.4' |
const | PDF_HEADER = "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n" |
| $pages = array() |
| $properties = array() |
| $outlines = array() |
Protected Member Functions |
| _loadPages (Zend_Pdf_Element_Reference $pages, $attributes=array()) |
| _loadNamedDestinations (Zend_Pdf_Element_Reference $root, $pdfHeaderVersion) |
| _loadOutlines (Zend_Pdf_Element_Reference $root) |
| _dumpPages () |
| _dumpNamedDestinations () |
| _dumpOutlines () |
| _refreshPagesHash () |
| _cleanUpAction (Zend_Pdf_Action $action, $refreshPageCollectionHashes=true) |
Protected Attributes |
| $_originalProperties = array() |
| $_javaScript = null |
| $_namedTargets = array() |
| $_originalOutlines = array() |
| $_originalOpenOutlinesCount = 0 |
| $_trailer = null |
| $_objFactory = null |
| $_parser |
| $_pageReferences = null |
| $_pageNumbers = null |
Static Protected Attributes |
static | $_memoryManager = null |
static | $_inheritableAttributes = array('Resources', 'MediaBox', 'CropBox', 'Rotate') |
Detailed Description
Definition at line 78 of file Pdf.php.
Constructor & Destructor Documentation
__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 - currtent version, 1 - previous version, 2 - ...)
- Parameters:
-
string | $source | - PDF file to load |
integer | $revision | |
- Exceptions:
-
- Returns:
- Zend_Pdf
Document id
Document catalog indirect object.
Pages container
Definition at line 296 of file Pdf.php.
Member Function Documentation
_cleanUpAction |
( |
Zend_Pdf_Action $ |
action, |
|
|
$ |
refreshPageCollectionHashes = true |
|
) |
| [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.
- Todo:
- Give appropriate name and make method public
- Parameters:
-
Zend_Pdf_Action | $action | |
boolean | $refreshPagesHash | Refresh page collection hashes before processing |
- Returns:
- Zend_Pdf_Action|null
Definition at line 1023 of file Pdf.php.
_dumpNamedDestinations |
( |
) |
[protected] |
Dump named destinations
- Todo:
- Create a balanced tree instead of plain structure.
Definition at line 662 of file Pdf.php.
_dumpOutlines |
( |
) |
[protected] |
Dump outlines recursively
Definition at line 696 of file Pdf.php.
_dumpPages |
( |
) |
[protected] |
Orginize pages to tha pages tree structure.
- Todo:
atomatically attach page to the document, if it's not done yet.
check, that page is attached to the current document
- Todo:
- Dump pages as a balanced tree instead of a plain set.
Definition at line 569 of file Pdf.php.
_loadNamedDestinations |
( |
Zend_Pdf_Element_Reference $ |
root, |
|
|
$ |
pdfHeaderVersion |
|
) |
| [protected] |
Load named destinations recursively
- Parameters:
-
Zend_Pdf_Element_Reference | $root | Document catalog entry |
string | $pdfHeaderVersion | |
- Exceptions:
-
Definition at line 483 of file Pdf.php.
_loadOutlines |
( |
Zend_Pdf_Element_Reference $ |
root ) |
[protected] |
Load outlines recursively
- Parameters:
-
Zend_Pdf_Element_Reference | $root | Document catalog entry |
Definition at line 523 of file Pdf.php.
_loadPages |
( |
Zend_Pdf_Element_Reference $ |
pages, |
|
|
$ |
attributes = array() |
|
) |
| [protected] |
Load pages recursively
- Parameters:
-
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.
Definition at line 435 of file Pdf.php.
_refreshPagesHash |
( |
) |
[protected] |
extractFont |
( |
$ |
fontName ) |
|
Extract font attached to the page by specific font name
$fontName should be specified in UTF-8 encoding
- Returns:
- Zend_Pdf_Resource_Font_Extracted|null
- Exceptions:
-
Definition at line 1118 of file Pdf.php.
Extract fonts attached to the document
returns array of Zend_Pdf_Resource_Font_Extracted objects
- Returns:
- array
- Exceptions:
-
Definition at line 1065 of file Pdf.php.
Return the document-level JavaScript or null if there is no JavaScript for this document
- Returns:
- string
Definition at line 827 of file Pdf.php.
static getMemoryManager |
( |
) |
[static] |
Request used memory manager
- Returns:
- Zend_Memory_Manager
Definition at line 211 of file Pdf.php.
Return the document-level Metadata or null Metadata stream is not presented
- Returns:
- string
Definition at line 797 of file Pdf.php.
getNamedDestination |
( |
$ |
name ) |
|
Return specified named destination
- Parameters:
-
- Returns:
- Zend_Pdf_Destination_Explicit|Zend_Pdf_Action_GoTo
Definition at line 890 of file Pdf.php.
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'
- Returns:
- array
Definition at line 879 of file Pdf.php.
Get open Action Returns Zend_Pdf_Target (Zend_Pdf_Destination or Zend_Pdf_Action object)
- Returns:
- Zend_Pdf_Target
Definition at line 838 of file Pdf.php.
static load |
( |
$ |
source = null , |
|
|
$ |
revision = null |
|
) |
| [static] |
Load PDF document from a file
- Parameters:
-
string | $source | |
integer | $revision | |
- Returns:
- Zend_Pdf
Definition at line 251 of file Pdf.php.
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); ---------------------------------------------------------
- Parameters:
-
mixed | $param1 | |
mixed | $param2 | |
- Returns:
- Zend_Pdf_Page
Definition at line 781 of file Pdf.php.
static parse |
( |
&$ |
source = null , |
|
|
$ |
revision = null |
|
) |
| [static] |
Create new PDF document from a $source string
- Parameters:
-
string | $source | |
integer | $revision | |
- Returns:
- Zend_Pdf
Definition at line 239 of file Pdf.php.
static pdfDate |
( |
$ |
timestamp = null ) |
[static] |
Convert date to PDF format (it's close to ASN.1 (Abstract Syntax Notation One) defined in ISO/IEC 8824).
- Todo:
- This really isn't the best location for this method. It should probably actually exist as Zend_Pdf_Element_Date or something like that.
- Todo:
- Address the following E_STRICT issue: PHP Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.
- Parameters:
-
integer | $timestamp | (optional) If omitted, uses the current time. |
- Returns:
- string
Definition at line 1394 of file Pdf.php.
render |
( |
$ |
newSegmentOnly = false , |
|
|
$ |
outputStream = null |
|
) |
| |
Render the completed PDF to a string. If $newSegmentOnly is true, then only appended part of PDF is returned.
- Parameters:
-
boolean | $newSegmentOnly | |
resource | $outputStream | |
- Returns:
- string
- Exceptions:
-
Definition at line 1178 of file Pdf.php.
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.
- Parameters:
-
Zend_Pdf_Destination | $destination | Destination to resolve |
boolean | $refreshPagesHash | Refresh page collection hashes before processing |
- Returns:
- Zend_Pdf_Page|null
- Exceptions:
-
Definition at line 966 of file Pdf.php.
Retrive number of revisions.
- Returns:
- integer
Definition at line 390 of file Pdf.php.
Rollback document $steps number of revisions. This method must be invoked before any changes, applied to the document. Otherwise behavior is undefined.
- Parameters:
-
Definition at line 410 of file Pdf.php.
save |
( |
$ |
filename, |
|
|
$ |
updateOnly = false |
|
) |
| |
Render PDF document and save it.
If $updateOnly is true, then it only appends new section to the end of file.
- Parameters:
-
string | $filename | |
boolean | $updateOnly | |
- Exceptions:
-
Definition at line 265 of file Pdf.php.
setJavaScript |
( |
$ |
javascript ) |
|
Set the document-level JavaScript
- Parameters:
-
Definition at line 1371 of file Pdf.php.
static setMemoryManager |
( |
Zend_Memory_Manager $ |
memoryManager ) |
[static] |
Set user defined memory manager
- Parameters:
-
Zend_Memory_Manager | $memoryManager | |
Definition at line 226 of file Pdf.php.
setMetadata |
( |
$ |
metadata ) |
|
Sets the document-level Metadata (mast be valid XMP document)
- Parameters:
-
Definition at line 811 of file Pdf.php.
setNamedDestination |
( |
$ |
name, |
|
|
$ |
destination = null |
|
) |
| |
Set specified named destination
- Parameters:
-
string | $name | |
Zend_Pdf_Destination_Explicit | Zend_Pdf_Action_GoTo | $target | |
Definition at line 905 of file Pdf.php.
setOpenAction |
( |
Zend_Pdf_Target $ |
openAction = null ) |
|
Set open Action which is actually Zend_Pdf_Destination or Zend_Pdf_Action object
- Parameters:
-
Zend_Pdf_Target | $openAction | |
- Returns:
- Zend_Pdf
Definition at line 854 of file Pdf.php.
Field Documentation
const PDF_HEADER = "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n" |
PDF file header.
Definition at line 90 of file Pdf.php.
Version number of generated PDF documents.
Definition at line 85 of file Pdf.php.
The documentation for this class was generated from the following file:
- E:/E/GEAMP/www/openbiz/openbiz/others/Zend/Pdf.php