ssimms / pdfapi2

Create, modify, and examine PDF files in Perl
Other
15 stars 20 forks source link

pdf generated by PDF::API2 unprintable by cups #52

Closed SteveSitko closed 2 years ago

SteveSitko commented 2 years ago

I have some ten-year-old legacy code that was broken when I upgraded to the most recent version of PDF::API2. The code was opening an existing pdf file, writing some stuff into it, then saving it as a new file. (basically using the existing file as a template). The pdf that is generated can still be opened by Acrobat and various web browsers, but when CUPS tries to print it, it generates the following error: (/var/log/cups/error.log)

loadFilename failed: /var/spool/cups/d06466-001 (offset 88342): unable to find /Root dictionary

That's a really obscure error, I could only find 3 references to it in all of google.

So, i suppose its possible that the problem is with CUPS, not sure really. When I examined the pdf file that was created by API::PDF2 it did seem a bit odd looking, but I'm not expert on PDF. I was able to avoid the problem by rewriting my legacy code to not use the template pdf and instead generate a new empty pdf and write what was necessary into it.

SteveSitko commented 2 years ago

My GitHub was compromised and somebody (a bot?) posted this bizarre issue. Sorry!