Print Page | Close Window

Create a One page PDF with a line of text

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1035
Printed Date: 02 May 24 at 10:14PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Create a One page PDF with a line of text
Posted By: ZarkoGajic
Subject: Create a One page PDF with a line of text
Date Posted: 19 Mar 09 at 6:25AM
Can someone share some Delphi source code for the next task:
 
Create a one page PDF document (A4, landscape) with centered text in the middle of the page (horizontal / vertical). Text can be for example "Created with Quick PDF"
 
-zarko gajic


-------------
-zarko gajic



Replies:
Posted By: deabrew
Date Posted: 19 Mar 09 at 7:18AM
procedure TfrmMain.Button1Click(Sender: TObject);
var
QP: TQuickPDF0712;
begin
QP := TQuickPDF0712.Create;
try
   QP.UnlockKey(' key goes here ');

   // Set the page size of the default document
   QP.SetPageSize('A4 Landscape');

   // Set centered horizontal alignment
   QP.SetTextAlign(1);

   // Draw the text centered on the page, the final
   // 0 parameter is for centered vertical alignment
   QP.DrawTextBox(0, QP.PageHeight, QP.PageWidth, QP.PageHeight,
     'Created with Quick PDF Library', 0);

   QP.SaveToFile('filename.pdf');
finally
   QP.Free;
end;
end;



Posted By: ZarkoGajic
Date Posted: 19 Mar 09 at 11:20AM
Great, thanks!

-------------
-zarko gajic



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