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 wrong size and position
  FAQ FAQ  Forum Search   Register Register  Login Login

DrawText wrong size and position

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

Joined: 06 Apr 12
Location: Boulder, CO
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote cscooper Quote  Post ReplyReply Direct Link To This Post Topic: DrawText wrong size and position
    Posted: 07 Apr 12 at 11:16PM
If I create a new PDF file and call DrawText(100, 100, "Text"), the text appears where I expect it to.

If instead I open an existing PDF file (one I didn't create so I have no idea how it's set up), create a new content stream, and make the same DrawText() call, the text ends up much smaller than I want and isn't in the right position.

It seems likely that the page has a coordinate mapping set up, or some other nonsense, can I just somehow clear all that in the content stream that I create so I get a blank slate to work from?

Thanks,
Chris

Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 08 Apr 12 at 10:11AM
Hi,

you are free to use NewPage to get a new blank page (on the end of PDF) and to set all you want as you need, undisturbed by older content of another page. With MovePage comes the so made page on the right position in the document and with DeletePages you may delete all unwished pages.

If you really need the pagecontent, which seems to set something strange, try NormalizePage(0) before your DrawText. It corrects some wrong things in the PDF.


Cheers,
Werner
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: 08 Apr 12 at 12:17PM
Hi Chris!

You should have a look at these functionalities:
http://www.quickpdflibrary.com/help/quickpdf/MeasurementAndCoordinateUnits.php
Keep an eye on SetOrigin ;-)

If you write on an existing page then there are always settings like where is coordinate 0,0 (top left, top right, bottom left or bottom right) and which is the fontheight. These settings are relative to your simple drawing (without any further setting) and so you can't be sure where your drawing will be visible on the page.

So SetOrigin and SetTextSize should be the minimum functionalities you should add before your drawing.

Cheers, Ingo

Back to Top
cscooper View Drop Down
Beginner
Beginner
Avatar

Joined: 06 Apr 12
Location: Boulder, CO
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote cscooper Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 12 at 4:30PM
NormalizePage() did the trick - thanks!

Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 12 at 6:10AM
Ingo, 

Thanks, SetOrigin put me on the right track! I see bottom left is the default page origin - weird! :)
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