Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
save ($filename, $updateOnly=false) | |
__construct ($source=null, $revision=null, $load=false) | |
revisions () | |
rollback ($steps) | |
getTextFieldNames () | |
setTextFieldProperties ($name, $bitmask) | |
markTextFieldAsReadOnly ($name) | |
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) | |
resetJavaScript () | |
addJavaScript ($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" |
const | PDF_FORM_FIELD_READONLY = 1 |
const | PDF_FORM_FIELD_REQUIRED = 2 |
const | PDF_FORM_FIELD_NOEXPORT = 4 |
$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) | |
_loadJavaScript (Zend_Pdf_Element_Reference $root) | |
_loadFormFields (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 | |
$_formFields = array() | |
$_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 | |
bool | $load |
Zend_Pdf_Exception |
Document id
Document catalog indirect object.
Pages container
Definition at line 322 of file Pdf.php.
|
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 | |
bool | $refreshPageCollectionHashes | Refresh page collection hashes before processing |
Definition at line 1179 of file Pdf.php.
|
protected |
Dump named destinations
Definition at line 817 of file Pdf.php.
|
protected |
Dump outlines recursively
Definition at line 851 of file Pdf.php.
|
protected |
Orginize pages to tha pages tree structure.
atomatically attach page to the document, if it's not done yet.
check, that page is attached to the current document
Definition at line 724 of file Pdf.php.
|
protected |
Load form fields
Populates the _formFields array, for later lookup of fields by name
Zend_Pdf_Element_Reference | $root | Document catalog entry |
Definition at line 623 of file Pdf.php.
|
protected |
Load JavaScript
Populates the _javaScript string, for later use of getJavaScript method.
Zend_Pdf_Element_Reference | $root | Document catalog entry |
Definition at line 599 of file Pdf.php.
|
protected |
Load named destinations recursively
Zend_Pdf_Element_Reference | $root | Document catalog entry |
string | $pdfHeaderVersion |
Zend_Pdf_Exception |
Definition at line 513 of file Pdf.php.
|
protected |
Load outlines recursively
Zend_Pdf_Element_Reference | $root | Document catalog entry |
Zend_Pdf_Exception |
Definition at line 554 of file Pdf.php.
|
protected |
Load pages recursively
Zend_Pdf_Element_Reference | $pages | |
array | null | $attributes |
Zend_Pdf_Exception |
Important note. If any attribute or dependant object is an indirect object, then it's still shared between pages.
Definition at line 465 of file Pdf.php.
|
protected |
addJavaScript | ( | $javaScript | ) |
Appends JavaScript to the document-level JavaScript
string | array | $javaScript |
Zend_Pdf_Exception |
Definition at line 1563 of file Pdf.php.
extractFont | ( | $fontName | ) |
Extract font attached to the page by specific font name
$fontName should be specified in UTF-8 encoding
string | $fontName |
Zend_Pdf_Exception |
Definition at line 1275 of file Pdf.php.
extractFonts | ( | ) |
Extract fonts attached to the document
returns array of Zend_Pdf_Resource_Font_Extracted objects
Zend_Pdf_Exception |
Definition at line 1221 of file Pdf.php.
getJavaScript | ( | ) |
Return the document-level JavaScript or null if there is no JavaScript for this document
|
static |
getMetadata | ( | ) |
getNamedDestination | ( | $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'
Definition at line 1034 of file Pdf.php.
getOpenAction | ( | ) |
Get open Action Returns Zend_Pdf_Target (Zend_Pdf_Destination or Zend_Pdf_Action object)
Definition at line 993 of file Pdf.php.
getTextFieldNames | ( | ) |
|
static |
markTextFieldAsReadOnly | ( | $name | ) |
newPage | ( | $param1, | |
$param2 = null |
|||
) |
Create page object, attached to the PDF document. Method signatures:
mixed | $param1 | |
mixed | $param2 |
Definition at line 936 of file Pdf.php.
|
static |
|
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 |
Definition at line 1336 of file Pdf.php.
resetJavaScript | ( | ) |
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 |
bool | $refreshPageCollectionHashes | Refresh page collection hashes before processing |
Zend_Pdf_Exception |
Definition at line 1122 of file Pdf.php.
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 |
Definition at line 440 of file Pdf.php.
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 |
Definition at line 291 of file Pdf.php.
setJavaScript | ( | $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 |
Definition at line 966 of file Pdf.php.
setNamedDestination | ( | $name, | |
$destination = null |
|||
) |
Set specified named destination
string | $name | |
Zend_Pdf_Destination_Explicit | Zend_Pdf_Action_GoTo | $destination |
Zend_Pdf_Exception |
Definition at line 1061 of file Pdf.php.
setOpenAction | ( | Zend_Pdf_Target | $openAction = null | ) |
Set open Action which is actually Zend_Pdf_Destination or Zend_Pdf_Action object
Zend_Pdf_Target | $openAction |
Definition at line 1009 of file Pdf.php.
setTextFieldProperties | ( | $name, | |
$bitmask | |||
) |
Sets the properties for an AcroForm text field
string | $name | |
mixed | $bitmask |
Zend_Pdf_Exception |
|
staticprotected |
const PDF_HEADER = "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n" |
const PDF_VERSION = '1.4' |