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 - Font Size not working
  FAQ FAQ  Forum Search   Register Register  Login Login

Font Size not working

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


Joined: 01 Sep 09
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote softwaredev Quote  Post ReplyReply Direct Link To This Post Topic: Font Size not working
    Posted: 01 Sep 09 at 2:52PM
 
Hello fellow forum members,
 
Am trying to use QuickPDF API as an ActiveX via VB6. Cannot get the drawn text to be the font size I need. Am passing 9.75 but it seems to be printing at higher value more like 11.5 or something.
 
Wondering what is the smallest font size I could go to.
 
Code below ... Can anyone tell me what I am doing wrong? Thks!
 

   Const FileName As String = "c:\temp\out.pdf" 
   Dim Result
    Set QP = New QuickPDFAX0715.PDFLibrary
    Result = QP.UnlockKey(LicenseKey)
       
    If Result = 1 Then
        Call QP.SetMeasurementUnits(1)    'Change to MM
        Call QP.SetOrigin(1)                        'Start 0 at top Left
        Call QP.SetLineColor(0, 0, 0)           'black
        Call QP.AddTrueTypeFont("Arial", 1)       'Arial,  embed
        Call QP.SetTextSize(9.75)                                   'Font size 9.75
        Call QP.DrawText(20, 50, "Quick PDF Font Size Testing")  
 
        If QP.SaveToFile(FileName) = 1 Then
            'MsgBox "File " + FileName + " written successfully."
        Else
            'MsgBox "Error, file could not be written."
        End If
    End If
 
Another similar question. Earlier was using the QP.SetFontFlags to set the font to Bold but it did not work for me, so have changed to include the Bold inside the Font-Name itself like (Arial Narrow Bold Italic) and that seems to work. Is that the right way to do it?
 
 


Edited by softwaredev - 01 Sep 09 at 4:16PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 01 Sep 09 at 4:44PM
Hi!

You have to select the font after adding it and before writing.
If you want to set the textcolour you should use SetTextColor.

Cheers, Ingo

Back to Top
Shotgun Tom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 Aug 09
Location: Phoenix, AZ
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shotgun Tom Quote  Post ReplyReply Direct Link To This Post Posted: 01 Sep 09 at 5:08PM
I tested your code in VB6 and it works okay.  One thought... I assume you're viewing your out.pdf in Adobe Reader, correct?  Check your resolution preference in Reader.  You can access it from Reader by pressing Ctrl-K.  Choose Page Display.  Check your resolution.  If you are using a higher dpi resolution than your system setting the font will appear larger but is actually correct.
 
One other quick note on your code... not sure why you have SetLineColor method included.  If you want to set the color of the text you would need to use SetTextColor method.
 
Tom
Back to Top
softwaredev View Drop Down
Beginner
Beginner


Joined: 01 Sep 09
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote softwaredev Quote  Post ReplyReply Direct Link To This Post Posted: 01 Sep 09 at 8:33PM
 
Found my problem, replying here for the benefit of the forum.
 
In my code the user was able to select the Font, hence if they would select Arial it was getting set to "Arial Regular". Which in turn would cause the Font to appear funny.
 
Fixed!
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