本文整理汇总了PHP中Zend_Pdf_Element_Reference::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Element_Reference::getType方法的具体用法?PHP Zend_Pdf_Element_Reference::getType怎么用?PHP Zend_Pdf_Element_Reference::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Pdf_Element_Reference
的用法示例。
在下文中一共展示了Zend_Pdf_Element_Reference::getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _loadPages
/**
* Load pages recursively
*
* @param Zend_Pdf_Element_Reference $pages
* @param array|null $attributes
*/
protected function _loadPages(Zend_Pdf_Element_Reference $pages, $attributes = array())
{
if ($pages->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
throw new Zend_Pdf_Exception('Wrong argument');
}
foreach ($pages->getKeys() as $property) {
if (in_array($property, self::$_inheritableAttributes)) {
$attributes[$property] = $pages->{$property};
$pages->{$property} = null;
}
}
foreach ($pages->Kids->items as $child) {
if ($child->Type->value == 'Pages') {
$this->_loadPages($child, $attributes);
} else {
if ($child->Type->value == 'Page') {
foreach (self::$_inheritableAttributes as $property) {
if ($child->{$property} === null && array_key_exists($property, $attributes)) {
/**
* Important note.
* If any attribute or dependant object is an indirect object, then it's still
* shared between pages.
*/
if ($attributes[$property] instanceof Zend_Pdf_Element_Object || $attributes[$property] instanceof Zend_Pdf_Element_Reference) {
$child->{$property} = $attributes[$property];
} else {
$child->{$property} = $this->_objFactory->newObject($attributes[$property]);
}
}
}
$this->pages[] = new Core_Pdf_Page($child, $this->_objFactory);
}
}
}
}
示例2: _loadPages
/**
* Load pages recursively
*
* @param Zend_Pdf_Element_Reference $pages
*/
private function _loadPages(Zend_Pdf_Element_Reference $pages)
{
if ($pages->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
throw new Zend_Pdf_Exception('Wrong argument');
}
foreach ($pages->Kids->items as $child) {
if ($child->Type->value == 'Pages') {
$this->_loadPages($child);
} else {
if ($child->Type->value == 'Page') {
$this->pages[] = new Zend_Pdf_Page($child, $this->_objFactory);
}
}
}
}