Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Add TIFF image to PDF

Question

I create a new PDF and add a scanned TIFF image.

LID := LPDF.AddImageFromStream(ImgStream, 1);
LPDF.FitImage(0, LPDF.PageHeight, LPDF.PageWidth, LPDF.PageHeight, 1, 1, 0)

The image is split into two separate images. Please open the Example PDF in Acrobat and click on the image. Is this a bug or a feature? For OCR processing it is a problem.

Thanks, Harald

Answer

It is not a bug as such. It is a feature of QPL to keep the overall file size down by copying the compression data in the tiff directly into the PDF with decompressing and recompressing the Group3/4 streams in the TIFF image.

The TIFF that you imported is a multistrip tiff. ie. It contains 2 strips(blocks) that are automatically joined together by a TIFF or PDF viewer. Multistrip PDF files can contain an number of strips, even 1 strip per raster line.

Quick PDF 7.25 imports G3 and G4 Tiff images and keeps the compression and strips intact. QPL does not contain any G3/G3 compression codecs and many customers wanted G3/G4 compression in their TIFF's to reduce the overall PDF size. The best solution we found was to just copy the G3/G4 data directly into the TIFF. Other solutions do this also.

The problem is that when you want to extract the image to perform the OCR then each strip will be extracted as a separate image.

In order to extract multistrip images from such PDF's you would need to use something like RenderPageToFile() to generate a single strip TIF or PNG image. From there you can covert it back to a Group3/4 tiff using something like the LibTIFF library.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum