views:

122

answers:

3

I need to convert PDF pages to TIF files from within my app (or using a console app we shell out to...)

I've tried some 3rd party tools/apps, but just to load one of my pages, they can take literally an order of magnitude or more than Acrobat Reader on the complex graphics (blueprints originally created by AutoCAD). Are these kinds of 3rd party libraries slow because typically they're accessing the .pdf directly rather than through the Acrobat API?)

I think I need to become an Adobe Developer so I can access their API.

Has anyone here gone down this path? I'm a Delphi developer and would prefer to stay in Delphi, guessing I'd use Adobe's IAC API (COM). However, Adobe's site (link) states that IAC can't use the Reader. Unfortunately, I can't ask my users to buy & install the full Acrobat.

But then, the site states:

You can also extend the functionality of the IAC interfaces by writing plug-ins that use core API objects not already part of the IAC support system.

What's that all about? Is that what I'll need to do?

Any suggestions what my next step would be, which Adobe API, which Developer program would suit us, how much we should expect to spend to join, whether the API is stable (and, assuming the user has the Reader installed) & dependable on a wide range of Windows machines, how to avoid learning an enormous class library just to make what we hope are three calls:

  1. Open PDF
  2. Save Page x as TIF
  3. Close PDF

I'm asking the usual general questions that one asks when making this kind of decision. Any suggestions are welcome.

Thanks.

A: 

Maybe doing this programmatically is the wrong way of looking at this problem. Instead of converting to a .TIF file, have you considered printing to one? Have you tried GhostScript? We use it at my workplace to automate printing - albeit to actual printers, but there are converters that show up as a printer. GhostScript takes a little bit to get setup, and admittedly I've never printed to an actual .TIF, but a quick Google search gave me a tutorial here. Good luck!

mattmc3
+2  A: 

You could use ImageMagick convert tool, but check its license if it allows integration with other software. It is distributed under an Apache 2.0-style license and I don't know the details of it.

http://www.imagemagick.org/script/index.php http://www.imagemagick.org/script/convert.php

If I remember correctly converting pdf to tiff is as simple as:

convert.exe file.pdf[0] file.tif 

where 0 is the number of page. You can skip the number of page and use

convert.exe file.pdf file.tif

to generate a multipage tiff file.

You can use

identify.exe file.pdf

to determine the details of the file, including number of pages.

You can use many other output formats, like gif, png and many many others.

SWilk
There is also PascalMagick - "a Pascal binding for the MagickWand API and also the low-level MagickCore library. It works with Free Pascal / Lazarus and Delphi."
mjustin
+1 for ImageMagick; I converted many PDF pages to PNG (but it does TIFF equally well). The simple steps propose will work great, but to show just a few things it can do as well: `convert -density 150x150 -scale 600 -quality 90 "source with space.pdf"[39] 600x426.50-percent-opacity.png -compose dissolve -set option:compose:args 50 -composite logo-600x426.50-percent-opacity.png -compose dissolve -set option:compose:args 50 -composite target.020.png` (embed a watermark, target a 600x426 image). DL: http://www.imagemagick.org/download/binaries/ImageMagick-6.6.3-0-Q16-windows-dll.exe
Jeroen Pluimers
A: 

I'm using Blackice monochrome print driver to convert to tiff any kind of document that can be printed, including pdf: http://www.blackice.com/Printer%20Drivers/TIFF%20Printer%20Drivers.htm

ioan