Sunday, October 20, 2019

Use Adobe Acrobat (PDF) Files in a Delphi Application

Use Adobe Acrobat (PDF) Files in a Delphi Application Delphi supports the display of Adobe PDF files from within an application. As long as youve got Adobe Reader installed, your PC will automatically have the relevant ActiveX control youll need to create a component you can drop into a Delphi form. Difficulty: Easy Time Required: 5 minutes Heres 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.Select a package where the new component must be installed or create a new package for the new TPdf control.Click OK.Delphi will ask you whether you want to rebuild the modified/new package. Click Yes.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.Close the package detail window, allowing Delphi to save the changes to it.The component is now available in the ActiveX tab (if you didnt change this setting in step 4).Drop the TPdf component onto a form and then select it.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.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.