You can also put the following code in a. (The double quotes around the second %%1 are necessary to allow the batch file to handle file names containing spaces.) 2.2. TIF files in the current directory to US letter size PDFs, just put the following code in a Windows batch file and execute it: for %%1 in (*.tif) do c42pdf "%%1" -p l It’s called c42pdf (which stands for “CCITT 4 TIFF” 2 (to) PDF). This is just a quick note about a useful open source tool that I recently found. When you use -sOutputFile instead of -o, you need to add -dNOPAUSE (to avoid Ghostscript pausing between pages) and -dBATCH (to exit the console when the file has been converted. The third line performs the conversion.įor black and white fax conversions, use: gswin32c.exe -sDEVICE=tiffg4 -r300x300 -dNOPAUSE -dBATCH -sOutputFile=%1.tif %1įor full colour TIFF files, use: gswin32c.exe -sDEVICE=tiff24nc -sCompression=lzw -r300x300 -dNOPAUSE -dBATCH -sOutputFile=%1.tif %1.The second line (“cd %~dp1”) ensures that the output TIFF file is put in the same directory as the input PDF file.The first line ensures that gswin32.exe is in your path (but only for the purpose of this batch file).You can then right click a PDF and select “Send To”, in order to convert that PDF file to TIFF. Then add a shortcut to this batch file to your Windows user’s Send To directory. To make GhostScript more useful, put the following in a batch file. (Note that gswin32c.exe must be in your path for this to work.) 1.2. In this example we are converting from PDF to CCITTv4 black and white TIFF files (-sDEVICE=tiffg4) at 300 dpi (-r300x300). Where “input.pdf” and “output.tif” are the names of the input and output files respectively. To convert from PDF to TIFF gswin32c.exe -sDEVICE=tiffg4 -r300x300 -o output.tif input.pdf In my case, I use it to convert from PDF to TIFF. GhostScript is an excellent open source PDF multi-tool – able to do most anything with PDF files. I’ve summarized my findings, and the batch files I’ve written to make these tools more useful, in this post, which I’ll update periodically. I’m always in need of free or open source tools that convert TIFF files to PDF, and vice versa, because I’m always converting back and forth for some reason.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |