Pdf/ElementFactory.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_ElementFactory
Package: Zend_Pdf














Returns






PDF element factory.
Responsibility is to log PDF changes
- Implements
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

array $_attachedFactories = array()List of the attached object factories.
Array of Zend_Pdf_ElementFactory_Interface objects
Default valuearray()Details- Type
- array

integer $_identity = 0static
Identity, used for factory id generation
Default value
0Details- Type
- integer

array $_modifiedObjects = array()List of the modified objects.
Also contains new and removed objects
Array: ojbectNumber => Zend_Pdf_Element_Object
Default valuearray()Details- Type
- array

integer $_objectCountPDF object counter.
Actually it's an object number for new PDF object
Details- Type
- integer

array $_registeredObjects = array()List of registered objects.
Used for resources clean up when factory is destroyed.
Array of Zend_Pdf_Element objects
Default valuearray()Details- Type
- array

\SplObjectStorage $_removedObjectsList of the removed objects
Array: ojbectNumber => Zend_Pdf_Element_Object
DetailsMethods

__construct(integer $objCount) : voidObject constructor
Parameters
| Name | Type | Description |
|---|---|---|
| $objCount | integer |

attach(\Zend_Pdf_ElementFactory_Interface $factory) : voidAttach factory to the current;
Parameters
| Name | Type | Description |
|---|---|---|
| $factory | \Zend_Pdf_ElementFactory_Interface |

calculateShift(\Zend_Pdf_ElementFactory_Interface $factory) : integerCalculate object enumeration shift.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $factory | \Zend_Pdf_ElementFactory_Interface |
| Type | Description |
|---|---|
| integer |

cleanEnumerationShiftCache() : voidClean enumeration shift cache.
Has to be used after PDF render operation to let followed updates be correct.

createFactory(integer $objCount) : \Zend_Pdf_ElementFactory_Interfacestatic
Factory generator
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $objCount | integer |
| Type | Description |
|---|---|
| \Zend_Pdf_ElementFactory_Interface |

fetchObject(string $refString) : \Zend_Pdf_Element_Object | nullFetch object specified by reference
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $refString | string |
| Type | Description |
|---|---|
| \Zend_Pdf_Element_Object | null |

getEnumerationShift(\Zend_Pdf_ElementFactory_Interface $factory) : integerRetrive object enumeration shift.
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $factory | \Zend_Pdf_ElementFactory_Interface |
| Type | Description |
|---|---|
| integer |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

getFactory() : \Zend_Pdf_ElementFactory_InterfaceGet factory
Returns
| Type | Description |
|---|---|
| \Zend_Pdf_ElementFactory_Interface |

listModifiedObjects(\Zend_Pdf_ElementFactory_Interface $rootFactory = null) : arrayEnumerate modified objects.
Returns array of Zend_Pdf_UpdateInfoContainer
Parameters| Name | Type | Description |
|---|---|---|
| $rootFactory | \Zend_Pdf_ElementFactory_Interface |
| Type | Description |
|---|---|
| array |

markAsModified(\Zend_Pdf_Element_Object $obj) : voidMark object as modified in context of current factory.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $obj | \Zend_Pdf_Element_Object |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

newObject(\Zend_Pdf_Element $objectValue) : \Zend_Pdf_Element_ObjectGenerate new Zend_Pdf_Element_Object
Parameters
Returns
Details
| Name | Type | Description |
|---|---|---|
| $objectValue | \Zend_Pdf_Element |
| Type | Description |
|---|---|
| \Zend_Pdf_Element_Object |
- Todo
- Reusage of the freed object. It's not a support of new feature, but only improvement.

newStreamObject( $streamValue) : \Zend_Pdf_Element_Object_StreamGenerate new Zend_Pdf_Element_Object_Stream
Parameters
Returns
Details
| Name | Type | Description |
|---|---|---|
| $streamValue |
| Type | Description |
|---|---|
| \Zend_Pdf_Element_Object_Stream |
- Todo
- Reusage of the freed object. It's not a support of new feature, but only improvement.

registerObject(\Zend_Pdf_Element_Object $obj, string $refString) : voidRegister object in the factory
It's used to clear "parent object" referencies when factory is closed and clean up resources
Parameters| Name | Type | Description |
|---|---|---|
| $obj | \Zend_Pdf_Element_Object | |
| $refString | string |

remove(\Zend_Pdf_Element_Object $obj) : voidRemove object in context of current factory.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $obj | \Zend_Pdf_Element_Object |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

resolve() : \Zend_Pdf_ElementFactoryGet source factory object
Returns
| Type | Description |
|---|---|
| \Zend_Pdf_ElementFactory |