Pre-flight program for PDF files using PoDoFo or something else open source?

I need to automate the verification of a preflight document in PDF documents. The pre-flight panel consists of:

  • Detect the resolution of images in an existing document and change them to 300 dpi if they are not already in that resolution.
  • Detect the color space of images, and if not in CMYK, then convert them to CMYK using color profiles.
  • Detect whether fonts are embedded in an existing PDF document and fix this problem by replacing the fonts. (or draw font outlines - I'm not sure about this part).

It's just interesting if this can be done using PoDoFo or any other open source projects. Or, if I really need to order some addiction from $ 2K to $ 6K. My hosting environment is on Linux and supports PHP, Perl, Python, Ruby, Java.

Any ideas?

+5
source share
3 answers

I do not know about open source software that meets your requirements.

Only part of it can be solved by writing your own shell script (or other program).

  • Detect image resolution.

    pdfimages -list some.pdf, , PDF, ... . : ( PDF). 720x720 . , 10x10- , 72 DPI . 1x1 , 720 DPI. "" PDF , " ", . , DPI , , PDF...

    Ghostscript 300 dpi "". (Ghostscript "" , , . - ​​ .)

  • CMYK ICC.

    Ghostscript . . Ghostscript, ICC.

  • .

    ( ) pdffonts some.pdf , .

    Ghostscript .

, Ghostscript, , :

gs                                     \
  -o cmyk.pdf                          \
  -sDEVICE=pdfwrite                    \
  -sColorConversionStrategy=CMYK       \
  -sProcessColorModel=DeviceCMYK       \
  -sOutputICCProfile=/path/to/your.icc \
  -sColorImageDownsampleThreshold=2    \
  -sColorImageDownsampleType=Bicubic   \
  -sColorImageResolution=300           \
  -sGrayImageDownsampleThreshold=2     \
  -sGrayImageDownsampleType=Bicubic    \
  -sGrayImageResolution=300            \
  -sMonoImageDownsampleThreshold=2     \
  -sMonoImageDownsampleType=Bicubic    \
  -sMonoImageResolution=1200           \
  -dSubsetFonts=true                   \
  -dEmbedAllFonts=true                 \
  -sCannotEmbedFontPolicy=Error        \
  -c ".setpdfwrite<</NeverEmbed[ ]>> setdistillerparams" \
  -f some.pdf

, , (*ImageDownSampleThreshold=2). , ( PDF, "" "" ).

, , , $2 . $6 . , . ( - callas pdfToolbox6 ( , CLI Linux) - 500 .)

+5

, , , . , , , , , .

:

  • 300 , ( ) .

  • . RGB, . , - , cmyk .

  • - . , , . , . .

- . . , Unix . Windows Mac. Callas linux cl, . .

?

+3

Have you tried Enfocus PitStop Pro ? Contact support at your specific request. They have tons of PDF preflight examples and will be happy to help you.

+2
source

All Articles