tags:

views:

27

answers:

1

We trying to set up automated regression testing our generated PDFs by converting our them to images and then using Python Imaging library to test the difference, pixel by pixel, between new and old versions. Right now, the only step that isn't automated is converting the PDFs to images. I know there are ways to convert PDFs to images with other rendering engines (e.g. postscript), but since we're doing precise pixel by pixel comparisons we want to make sure that we are using Adobe's PDF renderer to generate the image. Is there a way to do this with Adobe's renderer?

+1  A: 

Have a look at GhostScript - http://www.ghostscript.com/

Also have a look at the PDF tools from tall components - http://www.tallcomponents.com/

You can use Acrobat programatically, however this may be against their licensing and as far as I remember it was much slower than GhostScript.

Mark Redman
It's fairly clear that you don't want to use Ghostscript, but, GS will give you pixel perfect renderings... I.e. It will always render a PDF the same way, and it is easy to use. The following line will do what you have requested:gs -dNOPAUSE -dBATCH -r300 -sDEVICE=pngalpha -sOutputFile=prefix%03d.png file.pdf
Bear