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 - Problem with SetTextSize
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem with SetTextSize

 Post Reply Post Reply
Author
Message
Phil View Drop Down
Beginner
Beginner
Avatar

Joined: 21 Jan 10
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phil Quote  Post ReplyReply Direct Link To This Post Topic: Problem with SetTextSize
    Posted: 21 Jan 10 at 7:05AM
Hello,
 
I want to insert footer text (page numbers) in a existing pdf document. But I'm not able to set the text size. Here's my VB code (sample):
 
Sub DemoSetTextSize()
  ClassName = "QuickPDFAX0717.PDFLibrary"
  LicenseKey = "..."
  Set QP = CreateObject(ClassName)
  Result = QP.UnlockKey(LicenseKey)
  If Result = 1 Then
    Call QP.LoadFromFile("C:\MyPDF.pdf")
    lngFontID = QP.AddTrueTypeFont("Arial", 1)
    Call QP.SelectFont(lngFontID)
    Call QP.SetTextSize(50)       '<- HAS NO EFFECT!
    Call QP.SelectPage(1)
    Call QP.SetOrigin(0)
    strPageText = "My Footer Text"
    dblTextWidth = QP.GetTextWidth(strPageText)
    Call QP.DrawText((QP.PageWidth() / 2) - dblTextWidth / 2, 30, strPageText)
    Call QP.SaveToFile("C:\MyPDF.pdf")
  End If
End Sub
Everything works, except setting the text size. Regardless of which font I use. When I don't select the font, the Helvetica 12pt is used, as mentioned in the manual. Even then, I can't set the size. Any idea?
 
Kind regards,
Phil
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 10 at 9:11AM
Hi Phil!

Call QP.SelectPage(1) and Call QP.SetOrigin(0) should be inserted before SelectFont...
If the AddTrueType returns with a zero then the function already fails - check this please.
What was the returning value from SelectFont... success or not?
Perhaps you should do few samples with the standard-fonts already installed. Does it works with the standard-fonts?

Cheers and welcome here,
Ingo
Back to Top
Phil View Drop Down
Beginner
Beginner
Avatar

Joined: 21 Jan 10
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phil Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 10 at 10:16AM
Hi Ingo
 
You are right! I moved SelectPage and SetOrigin. Now it works!
Thanks very much!
 
Phil
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