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 - Converting Tif to PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Converting Tif to PDF

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


Joined: 10 Oct 08
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rgoodson Quote  Post ReplyReply Direct Link To This Post Topic: Converting Tif to PDF
    Posted: 10 Oct 08 at 9:07PM
Hello,
 
I am trying to convert a single-page tif to a pdf. Everytime I try it, it creates a document with a one-page blank document. I am using version 5.22.0.145 (although I have noticed than in the References section of VB6, it is listed as iSEDQuickPDF 5.20).
 
My code is as follows:
 
Dim QP As iSED.QuickPDF
Dim ImageID As Long
    
Set QP = CreateObject("iSED.QuickPDF")
Call QP.UnlockKey("my evaluation code")
Call QP.NewDocument
ImageID = QP.AddImageFromFile("c:\test.tif", 0)
Call QP.DrawImage(0, 0, 612, 792)
QP.SaveToFile ("c:\output.pdf")
 
Can you tell what I am doing wrong?
 
 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Oct 08 at 4:03PM
Hi!
 
TIFs can have more than one page - So you have to insert the pagenumber you want to add. If you want page 1 ('cause there's only page 1 then insert 1). For all other imagetypes this parameter should be always 0 - for TIFs this parameter should be 1 or any other pagenumber but not 0.
 
Best regards and welcome here,
Ingo
 
Back to Top
rgoodson View Drop Down
Beginner
Beginner


Joined: 10 Oct 08
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rgoodson Quote  Post ReplyReply Direct Link To This Post Posted: 12 Oct 08 at 12:16PM
Hello,
 
I tried changing the 0 to 1, but the resulting pdf is still blank. I did notice that if I change tif files that I am using to import, the size of the pdf file is changed, so apparently something is being done to the pdf file based on the tif file imported, its just not be displayed. Is there some finalize setting or something I need to do?
 
Here is my revised code:
 
Dim QP As iSED.QuickPDF
Dim ImageID As Long
    
Set QP = CreateObject("iSED.QuickPDF")
Call QP.UnlockKey("my eval license code")
Call QP.NewDocument
ImageID = QP.AddImageFromFile("c:\test.tif", 1)
Call QP.DrawImage(0, 0, 612, 792)
QP.SaveToFile ("c:\output.pdf")
    
Set QP = Nothing
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 13 Oct 08 at 2:09AM
Hi,

i've used the search-function (above) and found this code-part:

// . . .

  QP := TiSEDQuickPDF.Create;
  try
    QP.UnlockKey(PDF_Unlock_Key);
    DocID := QP.NewDocument ;
    QP.SelectDocument(DocID) ;
    QP.SelectPage(1) ;
    ImageID := QP.AddImageFromFile(ImageFileName, 0) ;
    QP.SelectImage(ImageID) ;
    if (QP.ImageWidth  > QP.PageWidth)  or
       (QP.ImageHeight > QP.PageHeight) then
       begin
          W := QP.PageWidth ;
          H := QP.PageHeight ;
       end
      else
       begin
          W := QP.ImageWidth ;
          H := QP.ImageHeight ;
       end ;
    QP.FitImage(1, QP.PageHeight-80, W, H, 1, 1, 0) ;
    QP.SaveToFile(ChangeFileExt(ImageFileName, '.pdf')) ;
  finally
     QP.Free ;
  end ;

// . . .

Best regards,
Ingo

Back to Top
rgoodson View Drop Down
Beginner
Beginner


Joined: 10 Oct 08
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rgoodson Quote  Post ReplyReply Direct Link To This Post Posted: 13 Oct 08 at 11:05AM

Thank you for your help. This method worked great.

By the way, is there an event handler that will let you know when the pdf creation has been finished? I can look at the functions at this link: http://web.archive.org/web/20040803091539/www.sedtech.com/isedquickpdf/?page=functions, but I do not see anything about Events or Properties.



Edited by rgoodson - 13 Oct 08 at 4:59PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 14 Oct 08 at 1:40AM
Hi!
I don't know detailed what you're meaning ...
It's a problem if pdf-creation lasts very long 'cause there are no options for showing progress. But this should be no problem if you're always using syntax like "try...finally...".
Best regards,
Ingo

Back to Top
rgoodson View Drop Down
Beginner
Beginner


Joined: 10 Oct 08
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rgoodson Quote  Post ReplyReply Direct Link To This Post Posted: 14 Oct 08 at 6:59PM
Ok. I understand now. I didn't realize that the program stopped execution until the SaveAsFile function was completed, and that the function returns a value letting you know if the file was created successfully or not. I have everything working properly now. Thank you for your help.
 
Reagan
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