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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Multipage TIFF to PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Multipage TIFF to PDF

 Post Reply Post Reply
Author
Message
Squid View Drop Down
Beginner
Beginner


Joined: 04 Jun 06
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Squid Quote  Post ReplyReply Direct Link To This Post Topic: Multipage TIFF to PDF
    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
Back to Top
JanN View Drop Down
Senior Member
Senior Member


Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote JanN Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jun 06 at 8:12AM
Originally posted by Squid Squid wrote:

2. The return value from the function is high and inconsistent.

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?
Back to Top
Squid View Drop Down
Beginner
Beginner


Joined: 04 Jun 06
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Squid Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jun 06 at 11:27AM

The function GetImagePageCount returns 5 (the correct number of pages for the TIFF file).

Here is some sample code. 

procedure TfmControl.btnPDF1Click(Sender: TObject);
  var
   QP : TiSEDQuickPDF;
   i,j  : Integer;
  begin
   QP := TiSEDQuickPDF.Create;
   try
     QP.UnlockKey('eval_code_key_here');
     QP.SetOrigin(1);
     QP.SetMeasurementUnits(1);
     QP.SetPageDimensions(210, 297);
     QP.NewPages(5);

     for i := 1 to QP.PageCount do begin
       QP.SelectPage(i);
       j := QP.AddTIFFImageFromFile('5pageTIFF.tif',i);
       ShowMessage('Image Added '+ IntToStr(j));

//       QP.SelectImage(i);  ....... see note below
//       QP.SelectImage(j);  ....... see note below
       j := QP.SelectedImage;
       ShowMessage('Selected Image '+ IntToStr(j));

       j := QP.DrawImage(0, 0, 210, 297);
       ShowMessage('Image Drawn '+ IntToStr(j));

       j := QP.ImageCount;
       ShowMessage('Image Count '+ IntToStr(j));
     end;

     QP.SaveToFile('test.pdf');
   finally
     QP.Free;
   end;
  end;

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

 

 

 

Back to Top
DELBEKE View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert
Avatar

Joined: 31 Oct 05
Location: France
Status: Offline
Points: 151
Post Options Post Options   Thanks (0) Thanks(0)   Quote DELBEKE Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jun 06 at 1:36AM

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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store