2

Is there a free/open-source application that runs on Linux, where I can specify a multi-page PDF as input, then specify a page number, and then obtain a rendering of that page in color - as well as rendering of each of the cyan, magenta, yellow and black color separations? (not sure if this is called a "preflight" software for printing). Additionally, it would be great if this application could calculate the total (and which) of pages that are purely black&white (i.e. have content only on the K/black separation), and which have color content.

For a single page PDF, it is relatively easy to use ghostscript from the command line; as an example, with this Latex code, test.tex:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[fill=none,draw=black,line width=2pt] (0cm,0cm) rectangle (4cm,5cm);
\draw[fill=red] (1cm,1cm) circle (1cm) ;
\draw[fill=blue] (2cm,2.5cm) circle (1cm) ;
\draw[fill=green] (3cm,4cm) circle (1cm) ;
\end{tikzpicture}
\end{document}

... and compiling it with pdflatex test.tex, one gets test.pdf, which looks like this:

test.pdf

...and it can be split to CMYK separations using:

gs -sDEVICE=tiffsep -dNOPAUSE -dBATCH -dSAFER -r150x150 -sOutputFile=test%04d.tif test.pdf

... which generates test0001.Cyan.tif, test0001.Magenta.tif, test0001.Yellow.tif and test0001.Black.tif, which look like this (click for full res):

/tmp/test0001.Cyan.tif /tmp/test0001.Magenta.tif /tmp/test0001.Yellow.tif /tmp/test0001.Black.tif

... but clearly, this process is kinda tedious to do for a 400+ page PDF, which is why I'd prefer a GUI - even if it is just an interface to a Ghostscript command line.

Is there anything like that out there?

2

ImageMagick can split your pdf into multiple image files with the command:

convert image.pdf image_%02d.tiff

Assuming you are happy with .tiff format.

You can identify which images have colour with:

convert image_name.type -format "%[colorspace]" info:

You can separate your colour channels with the separate option of the convert command, either RGB or CMYK, and others.

convert iamge_name.ext -colorspace CMYK -separate separate_CMYK_%d.gif

I am sure that you could put them together into a script or even an image processing pipeline.

ImageMagick is a free, cross platform tool. There are ImageMagick GUIs out there but you would probably be better off with a script.

| improve this answer | |
  • Many thanks for that, @SteveBarnes - had no idea about the info: thing, great to know - also great to know the alternative convert commands (although, I think ImageMagick uses GhostScript for PDF rendering under the hood). However, I'm still looking for a GUI tool, where I'd type or go forward/back through pages, and get the separations shown on screen... Thanks again - cheers! – sdaau May 3 '15 at 10:41
  • 1
    @sdaau You could always use GIMP for that - just be sure and open the pdf with pages as images, rather than layers - you can bind keys to the commands you need for ease of use. – Steve Barnes May 3 '15 at 11:39
0

Well, I really needed something like this, so I managed to hack PDF-Shuffler, which is a Python 2.7, GTK 2 application. I posted that patch here:

... where there is a bit more info written about the patch; and with the patch, pdfshuffler looks like this:

PdfShuffler_CMYK.png

... so that every time a new page is selected in the top pane (either by clicking on a page thumbnail icon, or next/back buttons, or keyboard arrows, or by typing in the text entry field), ghostscript is called to render the separations of that page, which are eventually shown in the bottom pane - which is what I needed for "quick browsing of CMYK separations". The good thing is, seems it can handle my 400+ page document without a problem...

Well, now that it's out there, hope it helps someone...


EDIT: Check also the (Python 2.7) script checkcmykpages.py:

... which is called like:

python checkcmykpages.py [docname].pdf

... and uses the inkcov device of (newer) Ghostscript, to generate a report noting all blank pages, all B&W pages (only K colour content), and all fully CMYK pages - and respective page numbers - of the input PDF document.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.