What component should I use to display a PDF file in a Delphi 2009 application?
EDIT:
I have been using PDF Viewer by Synactis - a very nice free PDF Viewer But it has no Delphi 2009 support.
So I need to designing it out of the product
Here's How: Start Delphi and select Component | Import ActiveX Control... Look for the "Acrobat Control for ActiveX (Version x.x)" control and click Install. Select the Component palette location into which the selected library will appear. Click Install.
Right-click the PDF, choose Open With > Choose default program or another app in. 2. Choose Adobe Acrobat Reader DC or Adobe Acrobat DC in the list of programs, and then do one of the following: (Windows 10) Select Always use this app to open .
All replies. You can FORCE QUIT the app that had frozen with the PDF document. The way you can do that is by pushing and holding down the OPTION key and then right clicking on the app that is frozen (For example, Acrobat Reader). That will display the option to Force Quit the app.
I have a feeling that more and more users prefere alternatives to acrobat reader, so forcing them to install acrobat to use your progam is a bad idea.
The ProPlus version of Gnistice PDFtoolkit let you display pdf files. And so does QuickPDFLibrary. I'm sure there are more of them.
Launching the file in the users prefered pdf viewer could be a second option for better controlling printing etc.
We embedded the Acrobat Reader in our Delphi application. Take a look at this article "How to embed Adobe Acrobat into your application". Once you have added the Acrobat Reader ActiveX component to your Form you can use following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
// This example assumes that you have a TOpenDialog
// and TPdf dropped onto your form
OpenDialog1.Filter := 'PDF Files (*.pdf)|*.pdf';
if OpenDialog1.Execute then
Pdf1.src := OpenDialog1.FileName;
end;
There is native Delphi components out there but embedding the Acrobat Reader component served our needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With