AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
July 2011

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



2011.07.19 18:11 "tiff2pdf page numbering", by Richard Nolde

1. Re: tiff2pdf changes tiff image order (Tim Ayres)
> Message: 1
> Date: Tue, 19 Jul 2011 07:52:35 -0500
> From: Tim Ayres<laur.olb1@gmail.com>
> Subject: Re: [Tiff] tiff2pdf changes tiff image order
> To: tiff@lists.maptools.org
> Message-ID:<4E257E13.3030304@gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Gerard,
>
> I can't help you with your tiff2pdf troubles, but an alternate solution
> may be to convert the tiffs to separate pdfs with tiff2pdf, then use
> pdftk to concatenate the separate pdfs into a single multi-page pdf.
>
> Tim
>
Other alternatives to try include converting individual TIFF files to 
Postscript with tiff2ps or pdf with tiff2pdf and then using Ghostscript 
to combine them into a single PDF file. If your TIFF files are bilevel 
Group3/4 images, you can retain the small size of a bilevel image by 
using tiff2ps -map3  TIFF-files*.tif > POSTSCRIPT-file.ps which can be 
converted to PDF format with Ghostscript using something like

  gs -q -r300x300 -sDEVICE=pdfwrite \
       -sPAPERSIZE=${GSPAPERSIZE} -sOUTPUTFILE=${PDFFILE} \
       -dCompatibility=1.4 -dNOPAUSE -dNOPROMPT -dBATCH ${PSFILE} 2>&1 
 >> ${LOGFILE}

Tiff2pdf sorts the images by page number and converts them to grayscale, 
whereas tiff2ps preserves bilevel image sizes by using the imagemask 
operator if you specify -m on the command line.  This can result in PDF 
files that are much smaller than those produced by tiff2pdf.

Also, when tiffcrop is used instead of tiffcp to concatenate files, it 
renumbers the first part of the Page Number sequence to increment 
throughout the output file.  Unfortunately, the second part of the page 
number is taken from the value specified in each input file which can 
make for some rather nonsensical output. eg:
   Page Number: 0-2
   Page Number: 1-2
   Page Number: 2-1
   Page Number: 3-1
   Page Number: 4-1
   Page Number: 5-1
   Page Number: 6-1
   Page Number: 7-19
   Page Number: 8-19
   Page Number: 9-19
   Page Number: 10-19
   Page Number: 11-19
   Page Number: 12-19
   Page Number: 13-19
   Page Number: 14-19
   Page Number: 15-19
   Page Number: 16-19
   Page Number: 17-19
   Page Number: 18-19
   Page Number: 19-19
   Page Number: 20-19
   Page Number: 21-19
   Page Number: 22-19
   Page Number: 23-19
   Page Number: 24-19
   Page Number: 25-19
   Page Number: 26-2
   Page Number: 27-2

You might try using tiff2pdf on a set of files combined with tiffcrop 
instead of tiffcp to see if the order is what you want. Since tiffcrop 
reads and writes each image sequentially, it cannot know the actual 
number of pages in the output file when it starts. One common convention 
is to substitute zero for the total pages value when it is not known.  
It there is any demand for this option, I could possibly update tiffcrop 
to use a specified total number of pages or zero.  Since most people 
just use tiffcp when all they want is to concatenate all the images in a 
set of files, I never noticed this issue.

Richard Nolde
tiffcrop author