1998.05.15 15:00 "TIFF to PDF", by Bernhard Herzog

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).

Bernhard,

I have written my own tiff2pdf and tiff2ps programs to convert G4 files (see http://cfa-www.harvard.edu/~alberto/tiff/ 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
aaccomazzi@cfa.harvard.edu             Smithsonian Astrophysical Observatory
v/f: 617-495-7076/617-496-7577                60 Garden Street, Mail Stop 83
http://cfa-www.harvard.edu/~alberto                 Cambridge, MA 02138  USA
****************************************************************************