Print Page | Close Window

Trouble with DrawText

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1153
Printed Date: 21 Sep 24 at 4:27AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Trouble with DrawText
Posted By: DougKnudson
Subject: Trouble with DrawText
Date Posted: 23 Jul 09 at 8:10PM
Hi All,
I am very new to QuickPDF but like it very much so far.  I am having trouble with DrawText not behaving as I believe it should and any help would be greatly appreciated!  I would like to insert some text at a particular position on an existing page that contains existing text.  Maybe this is not possible to write text over top (new text layer?) of existing text?  Here is how I am trying to do it in Visual Studio C++ Ver 6:
 
 if (msp_pdf_control.CreateInstance("QuickPDFAX0714.PDFLibrary") != 0)
  {
  MB("Sorry... Could not instantiate the QuickPDF control!");
  return false;
  }
 int success = msp_pdf_control->UnlockKey("jg6je64u3pj5x57ed8438p36y");
 
 msp_pdf_control->SetMeasurementUnits(2);
 msp_pdf_control->LoadFromFile("C:\\Test.pdf");
 msp_pdf_control->DrawText(2,2,"Some Text to Draw");
 msp_pdf_control->SaveToFile("C:\\Test.pdf");
 
 
The text is written to the document but it is ALWAYS written in the absolute lower left corner.  I have tried different positions for the text, I have tried not setting measurement units, I have tried writing on existing pages (with text) and on newly inserted empty pages but always get the text in the lower left.
 
Anything to point me in the right direction would sure be appreaciated Smile
 
Thanks,
Doug
 
 
 



Replies:
Posted By: Rowan
Date Posted: 24 Jul 09 at 12:11AM
Hi Doug,

You need to use the http://www.quickpdflibrary.com/help/quickpdf/SetOrigin.php - SetOrigin function to set the origin for drawing operations. The default origin is bottom left (and the X and Y co-ordinates are 0,0), but you can also choose to use the top left, top right and bottom right, as the origin for the X and Y co-ordinates.

Cheers,
- Rowan.


Posted By: DougKnudson
Date Posted: 27 Jul 09 at 3:09PM
Rowan,
 
Thanks very much.  I appreciate your help!
 
Doug
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk