Print Page | Close Window

FreePascal/Lazarus and QuickPDF

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1825
Printed Date: 22 Nov 24 at 7:48PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: FreePascal/Lazarus and QuickPDF
Posted By: Ingo
Subject: FreePascal/Lazarus and QuickPDF
Date Posted: 11 May 11 at 7:40AM
Hi All!

Is here anybody using QuickPDF with Lazarus (FreePascal)?
Are there certain things and specialities which i should know in this case?
I would like to read about few experiences...

Thanks and cheers,
Ingo





Replies:
Posted By: Rowan
Date Posted: 11 May 11 at 11:21AM
Hi Ingo,

I am very eager to hear if anybody has been able to successfully use Quick PDF with Free Pascal.

The source code itself will not compile with Free Pascal as it is as it depends on several Delphi classes which are not available in Free Pascal. We were able to get a subset of the source code to compile with Free Pascal after we cut out the Delphi only classes. It allowed us to generate a basic PDF.

There are also other changes that might need to be made in order to handle any 64-bit related issues which need to be addressed for the FPC but not for Delphi.

Really looking forward to hearing how other people have gone trying this...

Cheers,
- Rowan.


Posted By: Ingo
Date Posted: 11 May 11 at 4:03PM
Hi Rowan!

But in Lazarus there's a function to convert a Delphi-project to FreePascal/Lazarus ... ;-)

Cheers, Ingo



Posted By: Rowan
Date Posted: 11 May 11 at 5:59PM
Oh, did you try it, does it work? I will be exceedingly happy if it works. :-)


Posted By: Ingo
Date Posted: 11 May 11 at 8:58PM
Hi Rowan!

I've converted a Delphi-project and it runs without any further changes.
I've not converted a QuickPDF-Delphi-project so far ;-)
I'm working with Delphi 2007 and starting (a little bit) with Lazarus/FPC.
I want to mix a bit 'cause with Lazarus/FPC i have Unicode and 64 bit and with D2007 not :-(

Cheers, Ingo



Posted By: TJoe(J^)
Date Posted: 31 May 11 at 1:11AM
I was able to get a Lazarus project to compile, run, produce, and display a PDF using the ActiveX verison of the Quick PDF Library. Very nice!

Uses ComObj;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  QP : Variant;
  LicenseKey : WideString;
  iResult : integer;
  FileName : WideString;
  v : variant;
  bm : Graphics.TBitmap;

begin
  QP := CreateOleObject('QuickPDFAX0725.PDFLibrary');
  Memo1.Lines.Add(QP.LibraryVersion);
  LicenseKey := 'add yours here';
  FileName := 'Hello.pdf';
  iResult := QP.UnlockKey(LicenseKey);
  if (iResult = 1) then begin
    Memo1.Lines.Add('Valid license key: ' + QP.LicenseInfo);
    QP.DrawText(60, 600, 'Hello world from Lazuras');
    //Works!   
    //v := Canvas.Handle;
    //QP.RenderPageToDC(92, 1, v);
   
    //This also works
    bm := TBitmap.Create;
    bm.Width := 612;
    bm.Height := 792;
    v := bm.Canvas.Handle;
    QP.RenderPageToDC(92, 1, v);
    Canvas.Draw(0,0, BM);
    if (QP.SaveToFile('Hello.pdf') = 1) then begin
      Memo1.Lines.Add('File ' + FileName + ' was written successfully to disk');
    end else begin
      Memo1.Lines.Add('Error, file could not be written');
    end
  end else begin
    Memo1.Lines.Add('Invalid license key');
    Memo1.Lines.Add('Please set your license ke7y by editing this file');
  end;
  QP := NULL;
end;



Posted By: Rowan
Date Posted: 31 May 11 at 9:23AM
Nice one Joe, I am firing up Lazarus now to take a look.


Posted By: gadenne
Date Posted: 08 Jun 11 at 6:19PM
Possibly off-topic, but may I say that I'd be glad to hear that quickpdf is evolving towards multi-platform as much as I love to hear about additional functionality.

In term of the later - functionality - quickpdf already offers tremendous scope! As many people here, I'm evaluating the long term - including the non W32 one - as much as the short one. No hurry of courseSmile

I expect that covering a larger set of platforms - ideally a la chartdirector - would certainly be appreciated by quite a few users here. Am I wrong?



Posted By: TJoe(J^)
Date Posted: 08 Jun 11 at 6:31PM
I do not think it is off topic at all :)

The moment you mention Lazarus it's "Write Once, Compile Anywhere" capability, the topic can stray to just about anywhere!

I noticed that there is a Perl interface now available as well.

They sure seem to be "going places" with the library!

TJoe(J^)


Posted By: Rowan
Date Posted: 09 Jun 11 at 9:46AM
Nope, not off topic. We're looking at our options as far as multi-platform support goes. There are a few exciting possibilities. In short: we would like multi-platform support to be in Quick PDF's future, including mobile.



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