Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Multipage TIFF to PDF |
Post Reply |
Author | |
Squid
Beginner Joined: 04 Jun 06 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 04 Jun 06 at 11:59AM |
I am trying to to use the
Function AddTIFFImageFromFile(FileName,Page); I am using Delphi 6 and 5.13 evaluation version. I have two problems: 1. No matter what value I enter for Page the first image in the TIFF file is added. 2. The return value from the function is high and inconsistent. Any help appreciated. Squid |
|
JanN
Senior Member Joined: 29 Oct 05 Location: Germany Status: Offline Points: 116 |
Post Options
Thanks(0)
|
The ImageID is returned which can be passed to functions like SelectImage and DrawImage. So the return value is OK. What does the function GetImagePageCount return? |
|
Squid
Beginner Joined: 04 Jun 06 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
The function GetImagePageCount returns 5 (the correct number of pages for the TIFF file). Here is some sample code. procedure TfmControl.btnPDF1Click(Sender: TObject); for i := 1 to QP.PageCount do begin // QP.SelectImage(i); ....... see note below j := QP.DrawImage(0, 0, 210, 297); j := QP.ImageCount; QP.SaveToFile('test.pdf'); Notes: 1. The lines that have been remmed out have no effect if they are reinstated! 2. There are 5 images in the file. I deleberately let it loop 6 times. Shouldn't AddTIFFImageFromFile return a 0 on the last loop? 3. Typical values for image added are 16439460, 17321532,16932724, 26569308, 27535904, 27254720. If you run the code again you get different values. 4. Selected Image always matches the image added value (with or without the remmed code). 5. Image drawn is always 1. 6. Image count matches the loop count. 7. There is no parameter by which I can pass ImageID to DrawImage.
Squid
|
|
DELBEKE
Debenu Quick PDF Library Expert Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
Post Options
Thanks(0)
|
The value returned bu AddImageFormFile is a handle to the loadedimage, A zero value says the laod has failed. You can use this value in the selectimage function Ex : (using VB) Qp.SelectPage(MyTiffPageNumber) hImageId=Qp.AddImageFormFile(MyTiffFileName,MyTiffPageNumber) if hImageId=0 then msgBox "Error . Ca'nt read the Tiff FIle" end if Qp.SelectImage(hImageId) Qp.DrawImage 0,0,210,297
Hope this help
Edited by DELBEKE |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store