1. Computing
Send to a Friend via Email

Use Adobe Acrobat (PDF) Files in a Delphi Application

By

Let's see how to to show an Adobe Acrobat (.PDF) file in a Delphi application. All you need to do is the Acrobat ActiveX control (pdf.ocx and pdf.tlb), which you you can get for free from Adobe.
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)' and simply click on Install.
  3. Select the Component palette location in which you want to place selected library.
  4. Maybe the best is to leave the ActiveX option selected.
  5. Click on Install.
  6. Select a package where the new component must be installed or create a new package for the new TPdf control.
  7. Click on OK.
  8. Delphi will prompt you whether you want to rebuild the modified/new package or not.
  9. Click on Yes.
  10. 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.
  11. Close the package detail window, allowing Delphi to save the changes to it.
  12. The component is now available in the ActiveX tab (if you didn't change this setting in step 4)
  13. Drop the component on a form.
  14. Select the TPdf component you just dropped on a blank form.
  15. 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:

  1. If you do not have the Acrobat ActiveX control, download it now! It will be required for tip to work.
  2. Last step (Step 15) can be done in runtime, so you can open and close files programatically, as well as resize the control.
Related Video
Live Trace in Illustrator
Add Blog Images with Picasa

©2014 About.com. All rights reserved.