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!
![]() |
DrawText wrong size and position |
Post Reply ![]() |
Author | |
cscooper ![]() Beginner ![]() ![]() Joined: 06 Apr 12 Location: Boulder, CO Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
edvoigt ![]() Senior Member ![]() ![]() Joined: 26 Mar 11 Location: Berlin, Germany Status: Offline Points: 111 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
cscooper ![]() Beginner ![]() ![]() Joined: 06 Apr 12 Location: Boulder, CO Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
NormalizePage() did the trick - thanks!
|
|
![]() |
|
CrazyTIm ![]() Team Player ![]() ![]() Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() |
Ingo,
Thanks, SetOrigin put me on the right track! I see bottom left is the default page origin - weird! :)
|
|
![]() |
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