Search code examples
javascriptpythonimage-processingadobepdf-manipulation

how to batch process every single image in a PDF file?


I'm more of an artist/Illustrator than a coder. I want to print several pdfs double sided on an inkjet printer. Those PDFs are image heavy, partly entire pages are in full color. Since the paper gets wet of the ink the double sided printing is a problem. I want to 1) process each image in a pdf 2) to only 1 color in halftone I did a lot of research and found scripts that apparently worked 10 years ago but do not today. Also I not that good to understand all of that, but I really like to make it happen. I more than grateful if anyone could point me in the right direction. I m familiar with javascript (scripting for adobe programs) and with python. I have access to the adobe suite.


Solution

  • The Problem with images inside a PDF is they are either one or two "Bitmaps" of many densities and colour gamut's. So simply blanket converting the contents using Halftone Dithers is most likely going to degrade the images noticeably. View these images at normal size. The one on the right was "printed" PDFtoPNG as RGB halftone dithers.

    enter image description here

    The best way will be to find a programmable graphics app and experiment with eco print resolution in the Printer Driver (Ink droplet size etc.) not the source images.

    To get a good reduction in ink coverage you would need to extract the images at highest resolution possible then separate their primary ink colours into CMYK then halftone those "Separations" before re blending into a brighter output. Even that is more likely to produce a "Washed-Out" effect.

    Image Magick or any other graphics editing program like Gimp can be easily command line driven on images (For CMYK separations or as a whole). Then the imaged pages printed in sequences. However I suspect the quality will be poor unless you vary settings for potentially different variable source pages.

    Overall consider

    • "DRY" printing with lasers (not jets of ink)

    • Thicker paper stock to reduce bleed through

    • Eco setting in printer, and or print driver

    • A PDF Print processor that is ink usage aware like Adobe products.

    • Then perhaps reduce the size of ink pixels by altering resolution of images and introducing a "white" grid between source pixels but that is why you need dithering to overcome the "Moire" effects