getType() == Zend_Pdf_Element::TYPE_DICTIONARY) { if (($resource->Type === null || $resource->Type->value =='Action') && $resource->S !== null) { // It's a well-formed action, load it #require_once 'Zend/Pdf/Action.php'; return Zend_Pdf_Action::load($resource); } else if ($resource->D !== null) { // It's a destination $resource = $resource->D; } else { #require_once 'Zend/Pdf/Exception.php'; throw new Zend_Pdf_Exception('Wrong resource type.'); } } if ($resource->getType() == Zend_Pdf_Element::TYPE_ARRAY || $resource->getType() == Zend_Pdf_Element::TYPE_NAME || $resource->getType() == Zend_Pdf_Element::TYPE_STRING) { // Resource is an array, just treat it as an explicit destination array #require_once 'Zend/Pdf/Destination.php'; return Zend_Pdf_Destination::load($resource); } else { #require_once 'Zend/Pdf/Exception.php'; throw new Zend_Pdf_Exception( 'Wrong resource type.' ); } } /** * Get resource * * @internal * @return Zend_Pdf_Element */ abstract public function getResource(); }