Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to display a PDF file in Delphi 2009 [closed]

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

like image 832
Charles Faiga Avatar asked Mar 08 '09 20:03

Charles Faiga


People also ask

How do I display a PDF in Delphi?

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.

How do I keep a PDF open?

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 .

How do you close a hanging PDF?

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.


2 Answers

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.

like image 133
Vegar Avatar answered Oct 20 '22 01:10

Vegar


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.

like image 24
Kris De Decker Avatar answered Oct 20 '22 00:10

Kris De Decker