Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docs:pdf:tiff_workflow [2007/05/14 15:08] – billh | docs:pdf:tiff_workflow [2014/03/03 11:29] (current) – [convert pdf to tif] billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== tiff workflow ====== | ====== tiff workflow ====== | ||
+ | |||
+ | ===== Undocumented TIFF Common Workflow Issues ===== | ||
+ | * scan methods | ||
+ | * lighten/ | ||
+ | * erase borders, areas, or despeckle | ||
+ | |||
===== convert pdf to tif ===== | ===== convert pdf to tif ===== | ||
* requires [[..: | * requires [[..: | ||
* density defines resolution of output image | * density defines resolution of output image | ||
- | < | + | * units should be given, or else the file units will be undefined, and programs such as GraphicConverter will make the file 72dpi, which will cause conversion problems |
- | convert -density 150 SN-085.pdf SN-085.tif | + | * page defines the canvas size, and will crop the image as necessary |
- | </ | + | * examples:< |
+ | # full color example | ||
+ | convert -density 150 -units PixelsPerInch -page letter | ||
+ | # monochrome, small size, similar to multi page tiff (fax) sheets | ||
+ | convert -density 300 -units PixelsPerInch -page letter -monochrome -compress Group4 SN-085.pdf SN-085.tif | ||
+ | # convert color pdf from Illustrator to small grayscale 8 bit tif w/small file size, adjusting contrast to make it darker | ||
+ | convert.exe -density 200 -units PixelsPerInch -page letter -colorspace gray -compress lzw -alpha off -depth 8 -contrast-stretch .15%x60% input.pdf output.tif | ||
+ | </ | ||
+ | |||
+ | * requires Ghostscript (seems slower than imagemagick method, although imagemagick uses gs with the pnmraw output device) | ||
+ | * -q = quiet mode | ||
+ | * -dNOPAUSE = don't pause and ask questions after each page | ||
+ | * -r = custom resolution | ||
+ | * -sPAPERSIZE will force the output to be a proper papersize - this actually crops the page to this size which works well when the page is larger than represented and contains crop information | ||
+ | * example:< | ||
+ | gs -q -dNOPAUSE -sDEVICE=tiff24nc -r150 -sPAPERSIZE=letter -sOutputFile=a.tif a.pdf -c quit | ||
+ | </ | ||
===== split multi-page tiff into individual files ===== | ===== split multi-page tiff into individual files ===== | ||
* requires libtiff | * requires libtiff | ||
Line 13: | Line 35: | ||
tiffsplit input.tif | tiffsplit input.tif | ||
</ | </ | ||
+ | |||
===== edit tiff pages ===== | ===== edit tiff pages ===== | ||
- | * edit individual files (each page should be a file) as necessary using any graphics program, such as photoshop | + | * edit individual files (each page should be a file) as necessary using any graphics program, such as Adobe Photoshop, GraphicConverter etc... (GraphicConverter can edit multi-page tiff files, and keep them intact, although it changes the resolution to 72dpi so you need to run the convert -density command again to fix the file) |
* since individual tiff files are not the final work product, it would be best to not use compression, | * since individual tiff files are not the final work product, it would be best to not use compression, | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== convert tif to pdf ===== | ===== convert tif to pdf ===== | ||
+ | * **when things turn pink...** | ||
+ | * **There are versions of libtiff which improperly embed color lines in pdf files, causing pink and green pages. | ||
+ | * You may end up with output of pink or green pages when using jpeg compression. | ||
+ | (the r forces JPEG encoded RGB) | ||
+ | tiffcp -c jpeg:r:60 1.tif 1a.tif | ||
+ | tiff2pdf -j -q60 1a.tif > 1.pdf | ||
+ | </ | ||
+ | * see also: http:// | ||
+ | It looks like editing each PDF file in a text editor and changing | ||
+ | |||
+ | ColorTransform 0 | ||
+ | |||
+ | to | ||
+ | |||
+ | ColorTransform 1 | ||
+ | |||
+ | makes my PDF files display correctly, regardless of the viewing | ||
+ | application I use. So far I've tested this with acroread, kpdf and | ||
+ | ghostscript with good results. | ||
+ | do with sed. | ||
+ | </ | ||
* requires libtiff | * requires libtiff | ||
- | < | + | * single file (no compression):< |
+ | tiff2pdf -p letter -o output.pdf input.pdf | ||
+ | </ | ||
+ | * single file (zip compression):< | ||
+ | tiff2pdf -z -p letter -o output.pdf input.pdf | ||
+ | </ | ||
+ | * single file (jpeg compression, | ||
+ | tiff2pdf -j -q60 -p letter -o output.pdf input.pdf | ||
+ | </ | ||
+ | * single file (zip compression, | ||
+ | tiff2pdf -z -p letter -cprogramname -aauthorname -tdocumenttitle -sdocumentsubject -o output.pdf input.pdf | ||
+ | </ | ||
+ | * multiple files:< | ||
ls -1L *.tif | while read file;do | ls -1L *.tif | while read file;do | ||
tiff2pdf -p letter -o " | tiff2pdf -p letter -o " | ||
done | done | ||
+ | </ | ||
+ | |||
+ | * requires Ghostscript | ||
+ | *< | ||
+ | tiff2ps -2 a.tif | gs -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=a.pdf - -c quit | ||
</ | </ | ||
===== combine multiple tif files ===== | ===== combine multiple tif files ===== | ||
- | * requires libtiff | + | * requires libtiff< |
- | < | + | |
tiffutil -cat x*.tif -out test.tif | tiffutil -cat x*.tif -out test.tif | ||
</ | </ | ||
- | | + | * this example uses the -c flag, which is set to lzw compression for much smaller files< |
- | < | + | tiffcp -c lzw x*.tif output2.tif |
+ | </ | ||
+ | | ||
convert -adjoin x*.tif output.tif | convert -adjoin x*.tif output.tif | ||
</ | </ | ||
===== combine multiple pdf files ===== | ===== combine multiple pdf files ===== | ||
- | * requires libtiff | ||
- | * this example uses the -c flag, which is set to lzw compression for much smaller files | ||
- | < | ||
- | tiffcp -c lzw x*.tif output2.tif | ||
- | </ | ||
- | |||
* requires pdftk | * requires pdftk | ||
* this example does not include compression, | * this example does not include compression, | ||
Line 49: | Line 110: | ||
pdftk *.pdf cat output combined.pdf | pdftk *.pdf cat output combined.pdf | ||
</ | </ | ||
+ | |||
Line 71: | Line 133: | ||
</ | </ | ||
- | * convert a bunch of files into monochrome 1-bit images, with CCITT Group 4 compression, | + | * convert a bunch of files into monochrome 1-bit images, with CCITT Group 4 compression, |
ls -1L x*.tif|while read file; do convert -monochrome -compress Group4 " | ls -1L x*.tif|while read file; do convert -monochrome -compress Group4 " | ||
tiffutil -cat *.bw.tif -out tifoutput.tif | tiffutil -cat *.bw.tif -out tifoutput.tif | ||
- | tiff2pdf | + | tiff2pdf |
</ | </ |