Use Adobe Acrobat (PDF) Files in a Delphi Application

Delphi supports the display of Adobe PDF files from within an application. As long as you've got Adobe Reader installed, your PC will automatically have the relevant ActiveX control you'll need to create a component you can drop into a Delphi form.

Difficulty: Easy

Time Required: 5 minutes

Here's How:

  1. Start Delphi and select Component | Import ActiveX Control...
  2. Look for the "Acrobat Control for ActiveX (Version x.x)" control and click Install.
  3. Select the Component palette location into which the selected library will appear. Click Install.
  4. Select a package where the new component must be installed or create a new package for the new TPdf control.
  5. Click OK.
  6. Delphi will ask you whether you want to rebuild the modified/new package. Click Yes.
  7. After the package is compiled, Delphi will show you a message saying that the new TPdf component was registered and already available as part of the VCL.
  8. Close the package detail window, allowing Delphi to save the changes to it.
  9. The component is now available in the ActiveX tab (if you didn't change this setting in step 4).
  10. Drop the TPdf component onto a form and then select it.
  11. Using the object inspector, set the src property to the name of an existing PDF file on your system. Now all you have to do is resize the component and read the PDF file from your Delphi application.

Tips:

  • The Adobe ActiveX control installs automatically when you install Adobe Reader. 
  • Step 11 can be completed during runtime, so you can open and close files programmatically as well as resize the control.
Format
mla apa chicago
Your Citation
Gajic, Zarko. "Use Adobe Acrobat (PDF) Files in a Delphi Application." ThoughtCo, Jan. 29, 2020, thoughtco.com/adobe-acrobat-pdf-files-delphi-applications-1056893. Gajic, Zarko. (2020, January 29). Use Adobe Acrobat (PDF) Files in a Delphi Application. Retrieved from https://www.thoughtco.com/adobe-acrobat-pdf-files-delphi-applications-1056893 Gajic, Zarko. "Use Adobe Acrobat (PDF) Files in a Delphi Application." ThoughtCo. https://www.thoughtco.com/adobe-acrobat-pdf-files-delphi-applications-1056893 (accessed March 28, 2024).