Print Page | Close Window

Problems with Delphi RIO and QuickPDF Lite

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=3735
Printed Date: 26 Apr 24 at 5:52PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problems with Delphi RIO and QuickPDF Lite
Posted By: Jonno-UK
Subject: Problems with Delphi RIO and QuickPDF Lite
Date Posted: 29 Aug 19 at 3:30PM
Hi,
I have a Delphi FMX project and I wish to create some very simple PDF files.
I have downloaded QuickPDF Lite, installed it, imported the type library and installed the package.
(This generated the DebenuPDFLibraryAX1411_TLB file)

My code is as follows :
var
   PDF_library : OleVariant;

begin
    PDF_library:=CreateOleObject('DebenuPDFLibraryAX1411.PDFLibrary');

    PDF_library.SetMeasurementUnits(1);  { 1 = mm  2 = inches }
    PDF_library.SetPageSize('A4');
 
{ At this point I can see that PageWidth and PageHeight are 210/297 - which looks great }

    PDF_library.DrawText(100,500,'Hello world');  { I am aware that the co-ordinates might be out of range, but this should not be a problem }
    PDF_library.SaveToFile('C:\TestDocs\Test.pdf');
end;

Yet the code above never creates a pdf file in the TestDocs folder.
What am I doing wrong?
I am sorry but I am new to this.

Thanks in advance. 





Replies:
Posted By: tfrost
Date Posted: 29 Aug 19 at 8:01PM
Warning: I have never used the ActiveX interface or the Lite edition, and my applications typically work with existing PDFs, not creating new ones.  But my immediate suggestion would be to check if SaveToFile returns a 0, and if so call GetLastError. 

In addition, I think you need to call New Document and SelectPage (there may be one created with a new document, I can't remember; if not then NewPage), before you can draw text onto it.  Perhaps the Error value would tell you this.  Someone else may be more helpful but this is a start.  Persevere, it will all come together quite soon!  And the users here are friendly; we were all new once.  The example scripts are also very helpful.


Posted By: Ingo
Date Posted: 29 Aug 19 at 10:20PM
Hi Jonno,

retry again and start with this sample from Rowan (one of the publishers):
http://www.quickpdf.org/forum/getting-started-with-quickpdf-lite_topic1612.html

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo




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