Print Page | Close Window

Loading Multipgae Tiff with GDI+ mode

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1672
Printed Date: 04 Apr 26 at 7:50PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Loading Multipgae Tiff with GDI+ mode
Posted By: iffi
Subject: Loading Multipgae Tiff with GDI+ mode
Date Posted: 09 Dec 10 at 5:02PM
Hi all, I´m relatively new to Quick PDF, but programming for many years...
I´m working with Quick PDF 7.2.2 as DLL version in MS Visual C++.
 
I have special Tiff Imagges that are compressed CCITT T.6 (singe page and multi page)
This compression causes problems, when loading these images into a PDF with the function AddImageFromFile(<name>, param) and param is 0 or the pagenumber of a multipage Tiff.
If I use the param -1, the tiff file is loaded correctly! But I can only use this param -1 for single page tiffs and NOT for multi page tiff (as far as I understood the documentation and my tests have shown).
Is there any way to use the advanced GDI+ option for multi page Tiffs too?
Any advise would be highly appreciated!
 
Here is some sample code of the main routine:

int pageCount = QP.GetImagePageCount(fName);

for (int p=1;p<=pageCount;p++) {

if (pageCount>1)

rc = QP.AddImageFromFile(fName, p);

else

rc = QP.AddImageFromFile(fName, -1);

if (!rc) {

Msg.Format("CreateImageMerge: ERROR (%i) loading tif-file: %s into PDF\n", rc, fName.c_str());

OutputMsg(1, Msg );

}

else {

if (p>1) QP.NewPage();

int rc2 = 0;

int lWidth = QP.ImageWidth();

int lHeight = QP.ImageHeight();

rc2 = QP.CompressImages(1);

rc2 = QP.SetPageDimensions(lWidth, lHeight);

rc2 = QP.DrawImage(0, lHeight, lWidth, lHeight);

}

}

int rc2 = QP.SaveToFile(fNamePDF);

 



Replies:
Posted By: Ingo
Date Posted: 09 Dec 10 at 7:48PM
Hi!
 
As far as i know multipage is still a problem.
You should post it on the official support page.
You'll reach it via http://www.quickpdflibrary.com - www.quickpdflibrary.com
 
Cheers and welcome here,
Ingo
 


Posted By: BEvans
Date Posted: 12 Dec 10 at 8:13PM
Multipage TIFF files are just single page TIFF files placed one after another in the file. As a workaround you can use AddImageFromFileOffset() but it does require you to figure out using some other TIFF library where each page starts in the file. You could also use some other TIFF library to split the file into single pages and process those.

Ideal would be if AddImageFromStream didn't reset the stream position to zero all the time so it could be used to get multiple pages from a TIFF file. 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk