BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tiff in pdf

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Brad White
Guest





PostPosted: Fri Oct 21, 2005 12:34 am    Post subject: tiff in pdf Reply with quote



We are trying to create a PDF containing TIFFs.

Our bitmaps work fine, but we just can't get it to work
with TIFFs. The specs are a little skimpy at this point.

Does anyone have a PDF containing TIFFs that
we could look at for an example?

--
Thanks a bunch,
Brad.


Back to top
Joris Van Damme
Guest





PostPosted: Fri Oct 21, 2005 12:39 pm    Post subject: Re: tiff in pdf Reply with quote



Brad White wrote:
Quote:
We are trying to create a PDF containing TIFFs.

Our bitmaps work fine, but we just can't get it to work
with TIFFs. The specs are a little skimpy at this point.

Does anyone have a PDF containing TIFFs that
we could look at for an example?

If you've got bitmap to PDF working, then one easy way would be to use
LibTiffDelphi (http://www.awaresystems.be/imaging/tiff/delphi.html) to
convert your TIFF images to an intermediary TBitmap state, and work from
that.

Of course, that's not the best way. Many of the compression modes available
in TIFF, are very similarly available in PDF. So, for example, you might not
want to convert G4-in-TIFF to TBitmap and then to PDF, but transcode the G4
compressed data directly into your PDF, without any decompression and
subsequent recompression. For lossy compression modes, like JPEG, this is
not just a performance issue, but also avoids badly accumulating loss. And
for color spaces other then those available in a bitmap, it also avoids some
convertion loss.

For this purpose, too, you can make convinient use of LibTiffDelphi (see man
pages on functions like TIFFReadRawStrip and TIFFReadRawTile and such,
[url]http://www.remotesensing.org/libtiff/man/index.html)[/url].

In original LibTiff (http://www.remotesensing.org/libtiff/, not
LibTiffDelphi), there is an accompanying tool, tiff2pdf, that does just
that. Of course, it is C code, but it should be reasonably easy to convert
to pascal, or at the very least a good source of documentation.

--
Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html



Back to top
Brad White
Guest





PostPosted: Fri Oct 21, 2005 1:51 pm    Post subject: Re: tiff in pdf Reply with quote



"Joris Van Damme" <PleaseReplyTo (AT) TheGroupInstead (DOT) be> wrote

Quote:
Brad White wrote:
We are trying to create a PDF containing TIFFs.

Our bitmaps work fine, but we just can't get it to work
with TIFFs. The specs are a little skimpy at this point.

Does anyone have a PDF containing TIFFs that
we could look at for an example?

If you've got bitmap to PDF working,
Actually, we have Tiff -> Bitmap -> PDF working.


When we were just printing, this worked fine.
When we wanted to make these available on the net, we
thought we could just export them to PDF. That works fine,
but because of all the conversions is terribly slow. Since
we are creating them on the fly, it needs to be fast.

Quote:

Of course, that's not the best way. Many of the compression modes
available
in TIFF, are very similarly available in PDF. So, for example, you might
not
want to convert G4-in-TIFF to TBitmap and then to PDF, but transcode the
G4
compressed data directly into your PDF, without any decompression and
subsequent recompression.
Exactly.


Quote:

For this purpose, too, you can make convinient use of LibTiffDelphi (see
man
pages on functions like TIFFReadRawStrip and TIFFReadRawTile and such,
[url]http://www.remotesensing.org/libtiff/man/index.html)[/url].

In original LibTiff (http://www.remotesensing.org/libtiff/, not
LibTiffDelphi), there is an accompanying tool, tiff2pdf, that does just
that. Of course, it is C code, but it should be reasonably easy to convert
to pascal, or at the very least a good source of documentation.

This looks like it could do what we need to create sample

PDFs that we can emulate.

--
Thanks,
Brad.

Vote for CodeRush in future versions of Delphi
http://qc.borland.com/wc/wc.exe/details?reportid=9138



Back to top
Brad White
Guest





PostPosted: Fri Oct 21, 2005 3:23 pm    Post subject: Re: tiff in pdf Reply with quote

"Joris Van Damme" <PleaseReplyTo (AT) TheGroupInstead (DOT) be> wrote

Quote:
Brad White wrote:
We are trying to create a PDF containing TIFFs.


So, for example, you might not
want to convert G4-in-TIFF to TBitmap and then to PDF, but transcode the
G4
compressed data directly into your PDF,
I don't know what "transcode" means, unless it's this:

WikiPedia: Transcoding is the act of converting digital content from one
(usually lossy) format to another.

The whole idea here is to avoid conversions as much as possible.

Quote:

In original LibTiff (http://www.remotesensing.org/libtiff/, not
LibTiffDelphi), there is an accompanying tool, tiff2pdf, that does just
that. Of course, it is C code, but it should be reasonably easy to convert
to pascal, or at the very least a good source of documentation.
This looked promising, but wasn't as much help as I'd hoped.


It used XObjects, while we are trying to do inlining.
Other than that everything seems to be the same as what we are doing.
Ours still doesn't work. 8:-(

Thanks for the links,
Brad.



Back to top
Nils Haeck
Guest





PostPosted: Fri Oct 21, 2005 9:17 pm    Post subject: Re: tiff in pdf Reply with quote

There are no Tiffs in PDF. At least not in a sense that there's a Tiff
header or Tiff tags inside the PDF.

The most usual thing that ends up being in the PDF is the CITTFAX compressed
block. So you just need CITTFax compression. Some other compression
standards that are also used are LZW and Flate. LZW and Flate can use a
"PNG" additional prediction per column.

The PDF filter dictionary contains the columns entry that defines the width
of the column, and the length of the compressed stream defines how many rows
are encoded.

To get examples, just take any PDF that seems to have scanned pages. These
are usually filters with cittfax compression. These are the "tiff"s you're
looking for.

If you want to be really fancy you can also go with the 1.5 spec and use
JBIG for bilevel compression.

Nils
www.simdesign.nl


"Brad White" <bwhite at inebraska.com> schreef in bericht
news:4358d8b8$2 (AT) newsgroups (DOT) borland.com...
Quote:
We are trying to create a PDF containing TIFFs.

Our bitmaps work fine, but we just can't get it to work
with TIFFs. The specs are a little skimpy at this point.

Does anyone have a PDF containing TIFFs that
we could look at for an example?

--
Thanks a bunch,
Brad.




Back to top
Brad White
Guest





PostPosted: Fri Oct 21, 2005 10:30 pm    Post subject: Re: tiff in pdf Reply with quote

"Nils Haeck" <bla (AT) bla (DOT) com> wrote

Quote:
There are no Tiffs in PDF. At least not in a sense that there's a Tiff
header or Tiff tags inside the PDF.

The most usual thing that ends up being in the PDF is the CITTFAX
compressed block. So you just need CITTFax compression. Some other
compression standards that are also used are LZW and Flate. LZW and Flate
can use a "PNG" additional prediction per column.

The PDF filter dictionary contains the columns entry that defines the
width of the column, and the length of the compressed stream defines how
many rows are encoded.

To get examples, just take any PDF that seems to have scanned pages. These
are usually filters with cittfax compression. These are the "tiff"s you're
looking for.


We removed the tiff headers and just stuck the image block in the PDF
and that is working.
Thanks!

Now we are working on the scaling.

And we are running into brick wall after wall with TPicture unable or
unwilling
to read anything but a bitmap from a stream.
I'll post that to QC and report back here.

Thanks,
Brad.




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.