TIFF and LibTiff Mail List Archive


1998.05.15 15:00 "TIFF to PDF", by Bernhard Herzog
1998.05.15 15:03 "Re: TIFF to PDF", by Alberto Accomazzi
1998.05.20 17:49 "Re: TIFF to PDF", by Helge Blischke

1998.05.15 15:03 "Re: TIFF to PDF", by Alberto Accomazzi

I want to do direct conversion from TIFF to PDF using my own code. I thought I just needed to convert the raw tiff data into a stream of the new PDF (using the function TIFFReadRawStrip from the tifflib - like in the sample-program tiff2ps).

But I can't get it working. My program produces a stream which *begins* like the stream in a PDF generated with tiff2ps + distiller but has more and different bytes (the TIFFReadRawStrip returns exactly 1 strip which is longer than the stream in the PDF-File).


I have written my own tiff2pdf and tiff2ps programs to convert G4 files (see if you're curious) and have found that I can only get them to work if the input TIFF file consists of exactly 1 strip (i.e. Image Length == Rows/Strip). As a test, I took your test file singlepage.tif, converted it to be a single strip TIFF file, ran it through my converter and obtained a valid PDF file. Without the extra conversion step, the PDF file that gets generated is wrong (I think this has something to do with the fact that there is some kind of EOL sequence in the compressed G4 stream at the end of each strip).

Since all the files I need to convert are stored as single-strip TIFFs, I haven't worried too much about the problem in the past, but I would like to find out how to handle the situation. Presumably creating a sequence of smaller PDF image objects, one for each strip of compressed data in the TIFF file would work. If you ever get around to figuring this out, I would appreciate finding out.

-- Alberto

Alberto Accomazzi                 NASA Astrophysics Data System / SIMBAD USA             Smithsonian Astrophysical Observatory
v/f: 617-495-7076/617-496-7577                60 Garden Street, Mail Stop 83                 Cambridge, MA 02138  USA