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 - DrawText, DrawBox
  FAQ FAQ  Forum Search   Register Register  Login Login

DrawText, DrawBox

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


Joined: 13 Jan 21
Location: BE
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote PatVdv Quote  Post ReplyReply Direct Link To This Post Topic: DrawText, DrawBox
    Posted: 13 Jan 21 at 8:59AM
Hi All,

I'm just trying to design a box under a text, for the value of the width it is correct, but I don't understand what's wrong with the height ?

Patrick

ie :

 with aPdf do
 begin      
       sTxt:='PROFORMA';
       SetTextSize(30);
       iWidth  := GetTextWidth(sTxt);
       iHeight:= GetTextAscent - GetTextDescent;

        iY:=10;
        iX:=130;
        SetFillColor(0.88,0.88,0.88);
        DrawBox(iX,iY,iWidth,iHeight,1);
        SetTextColor(1,0.13,0.13);
        DrawText(iX,(iY+iHeight),sTxt);
 end;

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 Jan 21 at 7:37PM
Hi Patrick,

in the description for both functions (ascent/descent) you can read "...Returns the size of the selected font...". But i don't see that you've already selected a font.
Try SelectFont first before you try to do the settings for a font ;-)
https://www.debenu.com/docs/pdf_library_reference/SelectFont.php
Here you'll find a lot for the first start:
http://www.quickpdf.org/

Cheers and welcome here,
Ingo


Cheers,
Ingo

Back to Top
PatVdv View Drop Down
Beginner
Beginner


Joined: 13 Jan 21
Location: BE
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote PatVdv Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jan 21 at 2:52PM
Thanks Ingo,

You are right, I didn't show it here, but the font was selected before. I'll go deep into the documentation anyway.

Patrick


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 Jan 21 at 10:27PM
LastErrorCode after each function call let you see if the last call works or fails...
Cheers,
Ingo

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