I have around 1000 pdf filesand I need to convert them to 300 dpi tiff files. What is the best way to do this? If there is an SDK or something or a tool that can be scripted that would be ideal.
Use Imagemagick, or better yet, Ghostscript. http://www.ibm.com/developerworks/library/l-graf2/#N10284 has an example for imagemagick, http://www.asmail.be/msg0055376363.html has an example for ghostscript. I would install ghostscript and read the man page for gs to see what exact options are needed and experiment.
Good luck
http://python.net/~gherman/projects/pdf2tiff/
You could also use pdf2ps, ps2image and then convert from the resulting image to tiff with other utilities (I remember 'paul' [paul - Yet another image viewer (displays PNG, TIFF, GIF, JPG, etc.])
ABCPDF can do so as well -- check out http://www.websupergoo.com/helppdf6net/default.html
Disclaimer: work for product I am recommending
Atalasoft has a .NET library that can convert PDF to TIFF -- we are a partner of FOXIT, so the PDF rendering is very good.
Using GhostScript from the command line, I've used the following in the past:
on Windows:
gswin32c -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf
on *nix:
gs -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf
For a large number of files, a simple batch/shell script could be used to convert an arbitrary number of files...
I wrote a little powershell script to go through a directory structure and convert all pdf files to tiff files using ghostscript. Here is my script:
$tool = 'C:\Program Files\gs\gs8.63\bin\gswin32c.exe'
$pdfs = get-childitem . -recurse | where {$_.Extension -match "pdf"}
foreach($pdf in $pdfs)
{
$tiff = $pdf.FullName.split('.')[0] + '.tiff'
if(test-path $tiff)
{
"tiff file already exists " + $tiff
}
else
{
'Processing ' + $pdf.Name
$param = "-sOutputFile=$tiff"
& $tool -q -dNOPAUSE -sDEVICE=tiffg4 $param -r300 $pdf.FullName -c quit
}
}
using python this is what I ended up with
import os
os.popen(' '.join([
self._ghostscriptPath + 'gswin32c.exe',
'-q',
'-dNOPAUSE',
'-dBATCH',
'-r300',
'-sDEVICE=tiff12nc',
'-sPAPERSIZE=a4',
'-sOutputFile=%s %s' % (tifDest, pdfSource),
]))
I like PDFTIFF.com to convert PDF to TIFF, it can handle unlimited pages
1) Install GhostScript
2) Install ImageMagick
3) Create "Convert-to-TIFF.bat" (Windows XP, Vista, 7) and use the following line:
for %%f in (%*) DO "C:\Program Files\ImageMagick-6.6.4-Q16\convert.exe" -density 300 -compress lzw %%f %%f.tiff
Dragging any number of single-page PDF files onto this file will convert them to compressed TIFFs, at 300 DPI.