Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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 (Archbishop) 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

    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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1056651]
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2018-06-23 23:09 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.