1

I am using a custom invoice and order printout, most my clients want the classical "romainan communist invoice" look. It works fine for generating the invoice and order printouts, but when I try to print out a creditmemo it returns a very long array:

Array ( [0] => Zend_Pdf_Page Object ( [_dictionary:protected] => Zend_Pdf_Element_Object Object ( [_value:protected] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [Type] => Zend_Pdf_Element_Name Object ( [value] => Page [_parentObject:Zend_Pdf_Element:private] => ) [LastModified] => Zend_Pdf_Element_String Object ( [value] => D:20150519121801+00'00' [_parentObject:Zend_Pdf_Element:private] => ) [Resources] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [ProcSet] => Zend_Pdf_Element_Array Object ( [items] => ArrayObject Object ( [storage:ArrayObject:private] => Array ( [0] => Zend_Pdf_Element_Name Object ( [value] => PDF [_parentObject:Zend_Pdf_Element:private] => ) [1] => Zend_Pdf_Element_Name Object ( [value] => Text [_parentObject:Zend_Pdf_Element:private] => ) ) ) [_parentObject:Zend_Pdf_Element:private] => ) [XObject] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [X1] => Zend_Pdf_Element_Object_Stream Object ( [_dictionary:Zend_Pdf_Element_Object_Stream:private] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [Length] => Zend_Pdf_Element_Numeric Object ( [value] => 0 [_parentObject:Zend_Pdf_Element:private] => ) [Type] => Zend_Pdf_Element_Name Object ( [value] => XObject [_parentObject:Zend_Pdf_Element:private] => ) [Subtype] => Zend_Pdf_Element_Name Object ( [value] => Image [_parentObject:Zend_Pdf_Element:private] => ) [SMask] => Zend_Pdf_Element_Object_Stream Object ( [_dictionary:Zend_Pdf_Element_Object_Stream:private] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [Length] => Zend_Pdf_Element_Numeric Object ( [value] => 10000 [_parentObject:Zend_Pdf_Element:private] => ) [Type] => Zend_Pdf_Element_Name Object ( [value] => XObject [_parentObject:Zend_Pdf_Element:private] => ) [Subtype] => Zend_Pdf_Element_Name Object ( [value] => Image [_parentObject:Zend_Pdf_Element:private] => ) [Width] => Zend_Pdf_Element_Numeric Object ( [value] => 200 [_parentObject:Zend_Pdf_Element:private] => ) [Height] => Zend_Pdf_Element_Numeric Object ( [value] => 50 [_parentObject:Zend_Pdf_Element:private] => ) [ColorSpace] => Zend_Pdf_Element_Name Object ( [value] => DeviceGray [_parentObject:Zend_Pdf_Element:private] => ) [BitsPerComponent] => Zend_Pdf_Element_Numeric Object ( [value] => 8 [_parentObject:Zend_Pdf_Element:private] => ) [DecodeParms] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [Predictor] => Zend_Pdf_Element_Numeric Object ( [value] => 15 [_parentObject:Zend_Pdf_Element:private] => ) [Columns] => Zend_Pdf_Element_Numeric Object ( [value] => 200 [_parentObject:Zend_Pdf_Element:private] => ) [Colors] => Zend_Pdf_Element_Numeric Object ( [value] => 1 [_parentObject:Zend_Pdf_Element:private] => ) [BitsPerComponent] => Zend_Pdf_Element_Numeric Object ( [value] => 8 [_parentObject:Zend_Pdf_Element:private] => ) ) [_parentObject:Zend_Pdf_Element:private] => ) [Filter] => Zend_Pdf_Element_Name Object ( [value] => FlateDecode [_parentObject:Zend_Pdf_Element:private] => ) ) [_parentObject:Zend_Pdf_Element:private] => ) [_streamDecoded:Zend_Pdf_Element_Object_Stream:private] => 1 [_initialDictionaryData:Zend_Pdf_Element_Object_Stream:private] => [_value:protected] => Zend_Pdf_Element_Stream Object ( [value] => Zend_Memory_Container_Locked Object ( [value] => Pįņį@ġˇˇˇˇ``ņ†Pˇˇū†ˇˇūŗˇˇˇūˇˇ`ŗˇˇ` ˇˇˇņġˇŗņˇˇź@ˇˇˇźūˇˇpņˇˇņPˇˇˇP`ˇˇˇ ˇˇˇņġˇˇÄūņįˇˇ–ˇˇˇņįˇˇ–0pÄp0Pūˇˇˇˇˇˇźˇˇˇņŗˇˇź` @ņˇˇˇˇˇ††ˇˇˇņ@ˇˇˇPˇˇˇÄ ˇˇˇ0 ˇˇˇP`† źˇˇˇˇˇˇˇˇį–ˇˇˇÄpˇˇˇ0ˇˇˇÄ`ˇˇŗpˇˇˇįÄūˇˇÄ–ˇˇˇˇŗˇˇˇˇˇ@ˇˇˇˇ@ġˇū@ˇˇˇÄįˇˇź@ˇˇˇ`@ˇˇˇˇÄ–ˇˇūÄġˇˇˇį@ˇˇˇˇźˇį@ˇˇˇÄūˇˇ p`ņÄ@ˇˇˇˇÄ–ˇˇ–0–ˇˇˇūpˇˇˇ–0@ˇˇˇ`Pˇˇņpūˇ–†ˇūÄ0įį@ˇˇˇˇÄ–ˇˇ–źˇˇˇˇ†ˇˇˇ†`ˇˇˇ@įˇˇP ņˇˇˇˇ–0–ˇˇˇˇˇˇū0@ˇˇˇˇ`źˇˇ–ġˇˇˇ0–ˇˇˇ`ġˇˇ@ ˇˇŗˇˇˇūŗˇˇūPˇūÄūˇˇŗ0 †ŗ`@ˇˇˇˇ@Pˇˇū ġˇˇˇˇˇˇˇ ġˇˇ@ġˇ`ź†PPįpP``†ˇˇˇ@@ˇˇˇˇPūˇˇ@†ˇˇˇˇ@ˇˇˇūġˇˇ@ūˇŗ P@ 0PūˇˇˇÄ@`ˇˇˇˇŗˇˇźņˇˇˇū p pˇˇˇį†ˇˇˇ`ˇˇ`@įˇˇ–Äņˇˇ0pŗˇÄ ņˇˇį0ˇˇˇˇˇˇˇˇū@įˇˇņÄņˇˇ0ˇˇˇˇź0†ņppŗˇÄġˇˇˇˇˇŗˇˇˇˇņPˇˇˇÄźˇˇˇÄņˇˇˇūˇŗźˇˇˇˇˇˇˇˇˇ ˇˇˇp0ūˇˇˇˇ†@ˇˇˇˇˇˇˇˇˇ0źˇˇˇˇˇˇˇˇˇįˇˇˇˇˇˇˇ–0ˇˇˇpġˇˇˇˇˇ@@ˇˇˇˇÄņˇˇˇŗņˇˇˇ@ņˇˇˇÄˇˇ`†ˇˇˇ†@įˇˇˇ–Pˇˇˇ`ūˇˇŗˇˇūPˇˇˇˇˇˇˇˇź†ˇˇū†@įˇˇˇņ0ūˇˇˇˇˇˇ`Pˇˇˇ0ņˇˇˇˇˇįġˇˇˇ0ņˇˇˇŗˇˇˇˇņˇˇˇ ūˇņġˇˇ0ˇˇˇźÄˇˇˇ–ˇū0ġˇū@@@@†ˇˇįźˇˇū0ˇˇˇÄźˇˇˇˇˇŗġˇūņˇˇˇˇˇ –ˇˇˇ–@ˇˇˇp0ˇˇˇņ–ˇˇ–įˇˇ0@ˇˇˇp@ˇˇˇPņˇˇˇˇˇ0źˇˇņ@ˇˇ–@ˇˇˇpPˇˇˇ@ūˇpġˇ`ņˇˇ†ˇˇˇˇˇ† ˇˇˇˇ`p `ˇˇˇźˇˇˇņ@ˇˇźņˇˇ–źˇˇˇŗˇˇˇˇpņˇˇÄūˇū ŗˇˇņźˇˇˇįˇū0ˇˇŗŗˇˇ`ˇˇˇˇˇ@źˇˇˇūźˇˇˇPˇˇˇņūˇŗ@ˇˇˇ`ŗˇˇņˇˇˇˇņūˇˇ@–ˇˇ@`ˇˇˇ@ŗˇˇņ`ˇˇP†ˇˇÄˇˇˇ @ˇˇˇˇŗūˇˇˇpņˇˇˇ ˇˇˇņįˇˇ@įˇˇū`ˇˇˇÄ@ˇˇˇˇ ˇˇˇ†ˇˇ`įˇˇŗ`ˇˇˇÄūˇ† ˇˇˇ @ˇˇŗpˇˇˇˇpġˇˇ–ˇˇˇŗˇˇˇįpˇˇźˇˇˇ†ŗˇˇˇ@ġˇˇ†@ˇˇņ`ˇˇ†ˇˇˇźŗˇˇˇ0 @†ˇˇ–pˇˇźźˇˇˇˇ ūˇˇˇ00ˇˇˇ†@ˇˇˇÄ@ˇˇ–0ˇˇˇ`ġˇˇˇįˇˇˇ ġˇÄ@ˇˇ–@ˇˇˇPġˇˇˇūˇˇpźˇˇPņˇˇˇ–įˇˇˇÄ`ˇˇˇp@ˇˇˇÄ0ūˇū0@ˇˇˇP@ˇˇˇˇŗPÄŗˇˇņźˇˇ`–`0ūˇū@ˇˇˇ@`ˇˇˇˇ–PÄ@ˇˇˇ0PÄņˇˇ@0ŗPˇˇˇˇź`ˇˇˇį`į pÄpźˇˇˇ0@ÄÄP@ˇˇˇņÄ [...] 

and it goes on like this for about 2 million lines (yes, that's 2.087.701 lines)

If I use the original Abstract.php the PDF is generated without any problems.

I have no idea where to start, any help is welcomed.

Here is the file content: Abstract.php

3
  • I think you have to show us the code of your PDF extension. Otherwise nobody will be able to help.
    – Simon
    Commented May 19, 2015 at 17:29
  • Yes, you a right, I edited my original message and added the code.
    – Andras
    Commented May 19, 2015 at 20:59
  • Running a file compare and going line by line I traced the source of the problem to be in first 547 lines.
    – Andras
    Commented May 19, 2015 at 21:12

1 Answer 1

1

Found the problem: function insertDocumentNumber was missing. Just copy the function from /app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php and everything is working!

Not the answer you're looking for? Browse other questions tagged or ask your own question.