<p>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. </p>

[{'answer_id': 75524, 'author': 'JBB', 'author_id': 12332, 'author_profile': 'https://Stackoverflow.com/users/12332', 'pm_score': 2, 'selected': False, 'text': '<p>How about pdf2tiff? <a href="http://python.net/~gherman/pdf2tiff.html" rel="nofollow noreferrer">http://python.net/~gherman/pdf2tiff.html</a></p>\n'}, {'answer_id': 75567, 'author': 'Aeon', 'author_id': 13289, 'author_profile': 'https://Stackoverflow.com/users/13289', 'pm_score': 7, 'selected': True, 'text': '<p>Use Imagemagick, or better yet, Ghostscript.</p>\n\n<p><a href="http://www.ibm.com/developerworks/library/l-graf2/#N101C2" rel="noreferrer">http://www.ibm.com/developerworks/library/l-graf2/#N101C2</a> has an example for imagemagick:</p>\n\n<pre><code>convert foo.pdf pages-%03d.tiff\n</code></pre>\n\n<p><a href="http://www.asmail.be/msg0055376363.html" rel="noreferrer">http://www.asmail.be/msg0055376363.html</a> has an example for ghostscript:</p>\n\n<pre><code>gs -q -dNOPAUSE -sDEVICE=tiffg4 -sOutputFile=a.tif foo.pdf -c quit\n</code></pre>\n\n<p>I would install ghostscript and read the man page for gs to see what exact options are needed and experiment.</p>\n'}, {'answer_id': 75590, 'author': 'INS', 'author_id': 13136, 'author_profile': 'https://Stackoverflow.com/users/13136', 'pm_score': 2, 'selected': False, 'text': '<p><a href="https://pypi.org/project/pdf2tiff/" rel="nofollow noreferrer">https://pypi.org/project/pdf2tiff/</a></p>\n\n<p>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.])</p>\n'}, {'answer_id': 75593, 'author': 'Danimal', 'author_id': 2757, 'author_profile': 'https://Stackoverflow.com/users/2757', 'pm_score': 2, 'selected': False, 'text': '<p>ABCPDF can do so as well -- check out <a href="http://www.websupergoo.com/helppdf6net/default.html" rel="nofollow noreferrer"><a href="http://www.websupergoo.com/helppdf6net/default.html" rel="nofollow noreferrer">http://www.websupergoo.com/helppdf6net/default.html</a></a></p>\n'}, {'answer_id': 98191, 'author': 'Lou Franco', 'author_id': 3937, 'author_profile': 'https://Stackoverflow.com/users/3937', 'pm_score': 2, 'selected': False, 'text': '<p>Disclaimer: work for product I am recommending</p>\n\n<p>Atalasoft has a .NET library that can <a href="http://www.atalasoft.com/products/dotimage/net-tiff-pdf-sdk.aspx" rel="nofollow noreferrer">convert PDF to TIFF</a> -- we are a partner of FOXIT, so the PDF rendering is very good.</p>\n'}, {'answer_id': 113276, 'author': 'tomasso', 'author_id': 15043, 'author_profile': 'https://Stackoverflow.com/users/15043', 'pm_score': 6, 'selected': False, 'text': "<p>Using GhostScript from the command line, I've used the following in the past:</p>\n\n<p>on Windows:</p>\n\n<p><code>gswin32c -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf</code></p>\n\n<p>on *nix:</p>\n\n<p><code>gs -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf</code></p>\n\n<p>For a large number of files, a simple batch/shell script could be used to convert an arbitrary number of files...</p>\n"}, {'answer_id': 120316, 'author': 'gyurisc', 'author_id': 260, 'author_profile': 'https://Stackoverflow.com/users/260', 'pm_score': 4, 'selected': False, 'text': '<p>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: </p>\n\n<pre><code>$tool = \'C:\\Program Files\\gs\\gs8.63\\bin\\gswin32c.exe\'\n$pdfs = get-childitem . -recurse | where {$_.Extension -match "pdf"}\n\nforeach($pdf in $pdfs)\n{\n\n    $tiff = $pdf.FullName.split(\'.\')[0] + \'.tiff\'\n    if(test-path $tiff)\n    {\n        "tiff file already exists " + $tiff\n    }\n    else        \n    {   \n        \'Processing \' + $pdf.Name        \n        $param = "-sOutputFile=$tiff"\n        &amp; $tool -q -dNOPAUSE -sDEVICE=tiffg4 $param -r300 $pdf.FullName -c quit\n    }\n}\n</code></pre>\n'}, {'answer_id': 221341, 'author': 'Setori', 'author_id': 21537, 'author_profile': 'https://Stackoverflow.com/users/21537', 'pm_score': 3, 'selected': False, 'text': '<p>using python this is what I ended up with</p>\n<pre class="lang-py prettyprint-override"><code>import os\nos.popen(\' \'.join([\n                   self._ghostscriptPath + \'gswin32c.exe\', \n                   \'-q\',\n                   \'-dNOPAUSE\',\n                   \'-dBATCH\',\n                   \'-r300\',\n                   \'-sDEVICE=tiff12nc\',\n                   \'-sPAPERSIZE=a4\',\n                   \'-sOutputFile=%s %s\' % (tifDest, pdfSource),\n                   ]))\n</code></pre>\n'}, {'answer_id': 2428473, 'author': 'John', 'author_id': 291872, 'author_profile': 'https://Stackoverflow.com/users/291872', 'pm_score': 1, 'selected': False, 'text': '<p>I like PDFTIFF.com   to <a href="http://www.pdftiff.com" rel="nofollow noreferrer">convert PDF to TIFF</a>, it can handle unlimited pages</p>\n'}, {'answer_id': 3790112, 'author': 'Tyler', 'author_id': 457635, 'author_profile': 'https://Stackoverflow.com/users/457635', 'pm_score': 3, 'selected': False, 'text': '<p>1) Install GhostScript</p>\n\n<p>2) Install ImageMagick</p>\n\n<p>3) Create "Convert-to-TIFF.bat" (Windows XP, Vista, 7) and use the following line:</p>\n\n<pre><code>for %%f in (%*) DO "C:\\Program Files\\ImageMagick-6.6.4-Q16\\convert.exe" -density 300 -compress lzw %%f %%f.tiff\n</code></pre>\n\n<p>Dragging any number of single-page PDF files onto this file will convert them to compressed TIFFs, at 300 DPI. </p>\n'}, {'answer_id': 7511450, 'author': 'Russell Wong', 'author_id': 360257, 'author_profile': 'https://Stackoverflow.com/users/360257', 'pm_score': 2, 'selected': False, 'text': "<p>Required ghostscript &amp; tiffcp\nTested in Ubuntu</p>\n\n<pre><code>import os\n\ndef pdf2tiff(source, destination):\n    idx = destination.rindex('.')\n    destination = destination[:idx]\n    args = [\n    '-q', '-dNOPAUSE', '-dBATCH',\n    '-sDEVICE=tiffg4',\n    '-r600', '-sPAPERSIZE=a4',\n    '-sOutputFile=' + destination + '__%03d.tiff'\n    ]\n    gs_cmd = 'gs ' + ' '.join(args) +' '+ source\n    os.system(gs_cmd)\n    args = [destination + '__*.tiff', destination + '.tiff' ]\n    tiffcp_cmd = 'tiffcp  ' + ' '.join(args)\n    os.system(tiffcp_cmd)\n    args = [destination + '__*.tiff']\n    rm_cmd = 'rm  ' + ' '.join(args)\n    os.system(rm_cmd)    \npdf2tiff('abc.pdf', 'abc.tiff')\n</code></pre>\n"}, {'answer_id': 8065301, 'author': 'Sally', 'author_id': 1037695, 'author_profile': 'https://Stackoverflow.com/users/1037695', 'pm_score': 2, 'selected': False, 'text': '<p>Maybe also try this? <a href="http://www.sautinsoft.com/products/pdf-focus/index.php" rel="nofollow">PDF Focus</a></p>\n\n<p>This .Net library allows you to solve the problem :)</p>\n\n<p>This code will help (Convert 1000 PDF files to 300-dpi TIFF files in C#):</p>\n\n<pre><code>    SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();\n\n    string[] pdfFiles = Directory.GetFiles(@"d:\\Folder with 1000 pdfs\\", "*.pdf");\n    string folderWithTiffs = @"d:\\Folder with TIFFs\\";\n\n    foreach (string pdffile in pdfFiles)\n    {\n        f.OpenPdf(pdffile);\n\n        if (f.PageCount &gt; 0)\n        {\n            //save all pages to tiff files with 300 dpi\n            f.ToImage(folderWithTiffs, Path.GetFileNameWithoutExtension(pdffile), System.Drawing.Imaging.ImageFormat.Tiff, 300);\n        }\n        f.ClosePdf();\n    }\n</code></pre>\n'}, {'answer_id': 8353467, 'author': 'k venkat', 'author_id': 1076963, 'author_profile': 'https://Stackoverflow.com/users/1076963', 'pm_score': 2, 'selected': False, 'text': '<p>The PDF Focus .Net can do it in such way:</p>\n\n<p><strong>1.</strong> <em><strong>PDF to TIFF</em></strong></p>\n\n<pre><code>SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();    \n\nstring pdfPath = @"c:\\My.pdf";\n\nstring imageFolder = @"c:\\images\\";\n\nf.OpenPdf(pdfPath);\n\nif (f.PageCount &gt; 0)\n{\n    //Save all PDF pages to image folder as tiff images, 200 dpi\n    int result = f.ToImage(imageFolder, "page",System.Drawing.Imaging.ImageFormat.Tiff, 200);\n}\n</code></pre>\n\n<p><strong>2.</strong> <em><strong>PDF to Multipage-TIFF</em></strong></p>\n\n<pre><code>//Convert PDF file to Multipage TIFF file\n\nSautinSoft.PdfFocus f = new SautinSoft.PdfFocus();\n\nstring pdfPath = @"c:\\Document.pdf";\nstring tiffPath = @"c:\\Result.tiff";\n\nf.OpenPdf(pdfPath);\n\nif (f.PageCount &gt; 0)\n{\n    f.ToMultipageTiff(tiffPath, 120) == 0)\n    {\n        System.Diagnostics.Process.Start(tiffPath);\n    }\n}   \n</code></pre>\n'}]
['https://Stackoverflow.com/questions/75500', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/260/']