Perl-Sensitive Sunglasses | |
PerlMonks |
Re^10: blank pdf generated using PDF::API2 (Updated)by lennelei (Acolyte) |
on Jul 21, 2017 at 14:42 UTC ( [id://1195724]=note: print w/replies, xml ) | Need Help?? |
No: it worked out of the box. I'm sorry I didn't see the file was protected before: I didn't think about that as there was no password asked and no message displayed (and obviously no errors with scripts) when I manipulated the file manually (either via Acrobat Reader or using sejda console or sejda desktop or even Perl scripts). I'm not a PDF expert but I presume that the password is an authentication mechanism more than a protection as it doesn't prevent anything to read the file. But in that case, how is the content deciphered automatically? Anyway, for CAM::PDF, the script I gave in my first message is working exactly as I wrote it without any password related stuff:
Still with CAM::PDF, getPageText method works correctly and displays the real text of the file. I also managed to modify some data with getPageContent and setPageContent but not all data (I tried to obfuscate the file with this but the resulting pdf was corrupted). And with PDF::API2, xmpMetadata method for example produces unreadable data on that file (I cannot give the result here: it doesn't parse correctly on the site). I'm now looking for a way to use PDF::API2 the same way CAM::PDF is working: ie. by copying the pdf file and then removing the undesired pages but I'm not sure this is possible Thank you again for your help: it's almost time for me to end my week at work, so I'll return on that subject on Monday. Nice weekend folks.
In Section
Seekers of Perl Wisdom
|
|