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
    May 19, 2015 at 17:29
  • Yes, you a right, I edited my original message and added the code.
    – Andras
    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
    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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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