Received: by smtp02.oce.nl (4.1/SMI-4.1)
	id AA01152; Fri, 15 May 98 18:10:35 +0200
Received: from sgi.sgi.com (SGI.COM [192.48.153.1])
	by oce.nl (8.9.0.Beta5/8.9.0.Ver5) with ESMTP id SAA13045
	for <rvdt@oce.nl>; Fri, 15 May 1998 18:02:43 +0200 (MET DST)
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.sgi.com (980309.SGI.8.8.8-aspam-6.2/980304.SGI-aspam) via ESMTP id IAA02756; Fri, 15 May 1998 08:58:42 -0700 (PDT)
	mail_from (owner-tiff@sgi.engr.sgi.com)
Received: (from majordomo-owner@localhost)
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	id IAA84258
	for tiff-list;
	Fri, 15 May 1998 08:04:31 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37])
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	via ESMTP id IAA84205
	for <tiff-relay@cthulhu.engr.sgi.com>;
	Fri, 15 May 1998 08:04:19 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from cfa.harvard.edu (cfa.harvard.edu [131.142.10.1]) by sgi.sgi.com (980309.SGI.8.8.8-aspam-6.2/980304.SGI-aspam) via ESMTP id IAA11159
	for <tiff@sgi.com>; Fri, 15 May 1998 08:04:18 -0700 (PDT)
	mail_from (alberto@cfa0.harvard.edu)
Received: from cfa0.harvard.edu (cfa0.harvard.edu [131.142.10.30]) by cfa.harvard.edu (8.8.5/8.7.3) with SMTP id LAA29302; Fri, 15 May 1998 11:04:14 -0400 (EDT)
Received: from cfa0 by cfa0.harvard.edu (SMI-8.6/SMI-SVR4)
	id LAA00990; Fri, 15 May 1998 11:03:59 -0400
Message-Id: <199805151503.LAA00990@cfa0.harvard.edu>
Reply-To: Alberto Accomazzi <aaccomazzi@cfa.harvard.edu>
To: "bherzog@ist.co.at" <bherzog@ist.co.at>
Cc: "'tiff@sgi.com'" <tiff@sgi.com>
Subject: Re: TIFF to PDF 
In-Reply-To: Your message of Fri, 15 May 1998 12:36:54 +0200.
             <B174F459F5D4D011B2FC0020AF2A1C000B8749@wien.ist.co.at> 
X-Uri: http://cfa-www.harvard.edu/~alberto
Date: Fri, 15 May 1998 11:03:58 -0400
From: Alberto Accomazzi <alberto@cfa0.harvard.edu>
Sender: owner-tiff@fddi-sgi.sgi.com
Precedence: bulk

In message <B174F459F5D4D011B2FC0020AF2A1C000B8749@wien.ist.co.at>, Bernhard He
rzog writes:

> Hi everyone!
> 
> 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
****************************************************************************
