Set $tool to the correct path for Ghostscript and set $input_path and $output_path accordingly.
$tool = 'C:\Program Files (x86)\gs\gs9.02\bin\gswin32c.exe' $input_path = 'C:\input\' $output_path = 'C:\output\' $pdfs = get-childitem $input_path -recurse | where {$_.Extension -match "pdf"} foreach($pdf in $pdfs) { $tiff = $output_path + $pdf.PSChildName.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 Remove-Item $pdf.FullName } }
1 comment:
Thanks for sharing knowledgeable blog which provide the information about the conversion of Batch convert PDFs to multipage TIFFs. Great blog!!
Multipage Tiff Convert
Post a Comment