Lazarus

Announcements => Third party => Topic started by: lazdeveloper on December 12, 2019, 06:50:39 pm

Title: PDF viewer
Post by: lazdeveloper on December 12, 2019, 06:50:39 pm
Hi guys,
Is there an easy way or an LCL component to view a pdf file within lazarus application.
 The purpose of this is that I have to print many pdf documents but from
my lazarus application, not from the windows explorer.
Many thanks
Title: Re: PDF viewer
Post by: wp on December 12, 2019, 10:54:26 pm
Some kind of overkill, but I tested it and it is working: you could embed the Chrome browser in your form which can display pdf files.
Alternatively, there is also an fpCEF package (https://wiki.freepascal.org/fpCEF3, https://github.com/dliw/fpCEF3) - I did not test it, it seems to contain ready-to-use Lazarus examples.

P.S.
Read the fpCEF (https://wiki.freepascal.org/fpCEF3) wiki -- you will get many ideas from it.
Title: Re: PDF viewer
Post by: lazdeveloper on December 12, 2019, 11:31:08 pm
Many thanks wp for your so neat reply.

Your steps sound enough to follow them and  thank you for the attachment as well.
I will give this a thorough try.
On the other hand, and for a moment I thought viewing or sending local pdf file to
a peinter is straightforward! Apprently,  it is not that easy.
Title: Re: PDF viewer
Post by: wp on December 13, 2019, 12:23:23 am
Now I also tested fpCEF, and it is working too. Just follow the steps of the wiki. The only important thing is that the correct CEF binaries must be used; the fpCEF version in the github requires v3.3029 as displayed in the package title.

A less bulky solution might be Google's pdfiumlib discussed in https://forum.lazarus.freepascal.org/index.php/topic,39589.msg272268.html#msg272268.

Unfortunately, the sources in https://github.com/ahausladen/PdfiumLib are still for Delphi only, and I did not manage to make them compile under Lazarus - but I do not want to dig into this too deeply and probably gave up too soon. If you are more successful than me it would be nice if you could upload your result here.
Title: Re: PDF viewer
Post by: lazdeveloper on December 13, 2019, 05:54:42 am
Cheers wp,
I will give it a good try as well. Many thanks
Title: Re: PDF viewer
Post by: HeavyUser on December 30, 2019, 09:01:25 pm
Cheers wp,
I will give it a good try as well. Many thanks

have you seen this one?
https://forum.lazarus.freepascal.org/index.php/topic,40938.msg283271.html#msg283271
last time I checked it worked for the minimal tests I cared to run but I haven't used lazarus after 1.6 something so I do not know how it fares.
Title: Re: PDF viewer
Post by: lazdeveloper on January 14, 2020, 07:29:08 pm
Thank you very much HeavyUser
I tried it and it works.
Many thanks.. I was late being implementing a database project and now
Got back to pdf expiremnts!
I can say it is some how the topic is solved.
Thanks for wp as well. His additions are so useful.