Think about Loose Coupling | |
PerlMonks |
Troubleshooting PDF::API2 overlaying text on an existing PDFby trillich (Sexton) |
on Sep 15, 2021 at 15:51 UTC ( [id://11136789]=perlquestion: print w/replies, xml ) | Need Help?? |
trillich has asked for the wisdom of the Perl Monks concerning the following question: Having trouble diagnosing an issue with PDF::API2, where I have an existing PDF to bring in as a background/watermark/letterhead, and then I programmatically overlay text on top of that. This is the code that brings in the background, before any text is overlaid on top:
This code runs fine, no errors -- and the $bg_pdf is a simple PDF v1.4 saved straight from Adobe Illustrator. But after some text is added by the script, the output is partially corrupted. That is, the imported letterhead PDF shows up to a point and then the rest is skipped/ignored until the overlaid text displays. For example, the letterhead includes several rectangles, and only a scant few show up in the generated PDF. So it appears that upon display, the data for the existing background-pdf gets corrupted somehow, but the programmatic text overlaid on top, is just fine. Early on I learned to turn off $pdf->{forcecompress} = 0; to keep the whole resulting PDF from being weirdly and randomly scrambled. So that shouldn't be pertinent here. I've tried exporting the Illustrator PDF output in a number of different formats (v1.3, 1.4, 1.5); with or without 'preserve illustrator editing capabilities'; compression turned on or off; with including embedded fonts like garamond, vs using helvetica only, vs converting all text to outlines... How does one go about troubleshooting this? Using PDF::API2 v2.038, in perl 5.30.0
Back to
Seekers of Perl Wisdom
|
|