Johny
Johny

Reputation: 779

Zend_PDF template Zend_Pdf::load

I am trying to create a PDF with a template using Zend_Framework.

$pdf = Zend_Pdf::load('/..../pdf-template.pdf');

This creates the following error: Fatal error: Call to undefined method Zend_Pdf_ElementFactory::fetch() in /.../Zend/Pdf/Element/Reference.php on line 164

this is in the _dereference Method : line 164:

if (($obj = $this->_factory->fetch($this->_objNum . ' ' . $this->_genNum)) === null) {
            $obj = $this->_context->getParser()->getObject(
                           $this->_context->getRefTable()->getOffset($this->_objNum . ' ' . $this->_genNum . ' R'),
                           $this->_context
                                                          );
        }

Upvotes: 0

Views: 325

Answers (1)

dKen
dKen

Reputation: 3127

Weird - are you sure you haven't changed the Zend class? My _dereference uses fetchObject, and I confirmed there is a method called fetchObject in ElementFactory.php:

if (($obj = $this->_factory->fetchObject($this->_objNum . ' ' . $this->_genNum)) === null)

If you haven't changed it, it might be worth upgrading your Zend version.

Upvotes: 1

Related Questions