{"id":1080,"date":"2022-08-30T15:12:03","date_gmt":"2022-08-30T15:12:03","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/zend_pdf-template-zend_pdfload-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:12:03","modified_gmt":"2022-08-30T15:12:03","slug":"zend_pdf-template-zend_pdfload-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/zend_pdf-template-zend_pdfload-collection-of-common-programming-errors\/","title":{"rendered":"Zend_PDF template Zend_Pdf::load-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to create a PDF with a template using Zend_Framework.<\/p>\n<pre><code>$pdf = Zend_Pdf::load('\/....\/pdf-template.pdf');\n<\/code><\/pre>\n<p>This creates the following error: <strong>Fatal error: Call to undefined method Zend_Pdf_ElementFactory::fetch() in \/&#8230;\/Zend\/Pdf\/Element\/Reference.php on line 164<\/strong><\/p>\n<p>this is in the _dereference Method : line 164:<\/p>\n<pre><code>if (($obj = $this-&gt;_factory-&gt;fetch($this-&gt;_objNum . ' ' . $this-&gt;_genNum)) === null) {\n            $obj = $this-&gt;_context-&gt;getParser()-&gt;getObject(\n                           $this-&gt;_context-&gt;getRefTable()-&gt;getOffset($this-&gt;_objNum . ' ' . $this-&gt;_genNum . ' R'),\n                           $this-&gt;_context\n                                                          );\n        }\n<\/code><\/pre>\n<ol>\n<li>\n<p>Weird &#8211; are you sure you haven&#8217;t changed the Zend class? My <code>_dereference<\/code> uses <code>fetchObject<\/code>, and I confirmed there is a method called <code>fetchObject<\/code> in <code>ElementFactory.php<\/code>:<\/p>\n<pre><code>if (($obj = $this-&gt;_factory-&gt;fetchObject($this-&gt;_objNum . ' ' . $this-&gt;_genNum)) === null)\n<\/code><\/pre>\n<p>If you haven&#8217;t changed it, it might be worth upgrading your Zend version.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:22:00. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am trying to create a PDF with a template using Zend_Framework. $pdf = Zend_Pdf::load(&#8216;\/&#8230;.\/pdf-template.pdf&#8217;); This creates the following error: Fatal error: Call to undefined method Zend_Pdf_ElementFactory::fetch() in \/&#8230;\/Zend\/Pdf\/Element\/Reference.php on line 164 this is in the _dereference Method : line 164: if (($obj = $this-&gt;_factory-&gt;fetch($this-&gt;_objNum . &#8216; &#8216; . $this-&gt;_genNum)) === null) { $obj = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"class_list":["post-1080","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-zend-framework"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1080"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1080\/revisions"}],"predecessor-version":[{"id":8902,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1080\/revisions\/8902"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}