Print Page | Close Window

DrawText Question

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=2837
Printed Date: 20 Dec 25 at 1:42AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DrawText Question
Posted By: JohnT
Subject: DrawText Question
Date Posted: 25 Feb 14 at 5:06PM
The following Delphi code works in single generated PDF's, but not merged and scanned PDFs.

The code simply adds a page numbers to the top of each page of the merged document.
I have verified that the code/loop is executing.

if UnlockResult = 1 then
                  If PDFLibrary.LoadFromFile(OutputFullFilename,'') <> 0 then
                      begin
                          CurrentPage := 2;
                          PageCounter := PDFLibrary.PageCount;
                          PDFLibrary.SetPageSize('Legal');
                          PDfLibrary.SetTextSize(4);
                          PDFLibrary.SetNeedAppearances(1);
                          PDFLibrary.SetTextUnderline(1);
                          For CurrentPage := 2 to PageCounter do
                          begin
                            PDFLibrary.SelectPage(CurrentPage);
                            PDFLibrary.SetOrigin(1);
                            PDFLibrary.DrawText(700,10,'Merged Page ' + IntToStr(CurrentPage) + ' of ' + IntToStr(PageCounter));
                          end;
                        PDFLibrary.SaveToFile(OutputFullFilename);
                      end; ///load check

TIA,

John



Replies:
Posted By: JohnT
Date Posted: 25 Feb 14 at 6:22PM
SORRY!
It works...the horizontal number (700) was pushing the numbering off of the page.
JohnEmbarrassed


Posted By: JohnT
Date Posted: 25 Feb 14 at 7:49PM
One clarification...
The drawtext method does not appear to work with PDF's that originated as scans of hard copy.

What am I missing?

TIA,

John


Posted By: jpbro
Date Posted: 25 Feb 14 at 9:10PM
Try calling the NormalizePage function before drawing your text on the scanned documents - they might have rotation applied.

Here's the documentation on the NormalizePage function:
http://www.debenu.com/docs/pdf_library_reference/NormalizePage.php" rel="nofollow - http://www.debenu.com/docs/pdf_library_reference/NormalizePage.php

Of note in the description of the function:

"Moves and/or rotates the contents of the page so that subsequent drawing operations are at the expected position on the page. "



Posted By: JohnT
Date Posted: 25 Feb 14 at 10:51PM
JpBro,

Thanks very much.

That fixed it!

John


Posted By: jpbro
Date Posted: 26 Feb 14 at 1:23AM
Glad to help!



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