Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Extracting Font/Transparency info from PDF

by pdxperl (Sexton)
on Oct 02, 2013 at 17:03 UTC ( #1056651=perlquestion: print w/ replies, xml ) Need Help??
pdxperl has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to be able to check PDF files for some common issues prior to them being printed. A perl solution would be nice but any CLI type of solution that runs under Linux would also be fine. Specifically, I need to know: 1) Are transparencies being used? 2) Are all fonts either embedded or outlined? 3) For embedded images: a) color space (CMYK, RGB ) b) DPI ( I realize this is probably requires a couple of steps, since it depends on the printed image size) Thanks

Comment on Extracting Font/Transparency info from PDF
Replies are listed 'Best First'.
Re: Extracting Font/Transparency info from PDF
by ww (Bishop) on Oct 02, 2013 at 17:57 UTC
    Did you read whatever specs are available for .pdfs? Have you checked any source of help at Adobe or other producers of .pdf-software?

    Have you read the docs in the multitudinous lode of modules related to .pdf at cpan.org?


     
    Lazy is reputed to be a virtue for Perlistae, but not this kind of lazy.

      I have searched through CPAN and I didn't see anything that specifically mentioned transparencies, embedded / outlined fonts, image characteristics for PDFs. Lots of stuff for creating, editing, extracting basic metadata, but nothing at the level I'm looking for ( at least, not identified specifically). Adobe of course has solutions, but they're GUI-based and part of an overall design suite. I'm looking for a way to do some basic automation. And no, I didn't read through the PDF specs! That is quite vast and complex. I thought maybe a common sense approach, as opposed to reinventing the wheel, might be to see if someone else has solved a similar problem.
Re: Extracting Font/Transparency info from PDF
by Anonymous Monk on Oct 04, 2013 at 00:25 UTC

    That I know of directly with Perl, no. You would have to use JavaScript and possibly Adobe's ExtendScript GUI. However, I believe you can execute Perl (or other languages) and possibly process the properties you receive then send it back. Not very elegant but, again, I believe possible.

    http://www.adobe.com/devnet/acrobat/javascript.html

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1056651]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2015-07-30 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls