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!
![]() |
Problem with SetTextSize |
Post Reply
|
| Author | |
Phil
Beginner
Joined: 21 Jan 10 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: Problem with SetTextSizePosted: 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
|
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Phil
Beginner
Joined: 21 Jan 10 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 Jan 10 at 10:16AM |
|
Hi Ingo
You are right! I moved SelectPage and SetOrigin. Now it works!
Thanks very much!
Phil
|
|
![]() |
|
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