Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to Use Adobe Acrobat (PDF) Files in a Delphi Application Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
13-Aug-02
Category
ActiveX
Language
Delphi 3.x
Views
210
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How to Use Adobe Acrobat (PDF) Files in a Delphi Application

Answer:

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.

Here's How:

Start Delphi and select Component | Import ActiveX Control...
Look for the 'Acrobat Control for ActiveX (Version x.x)'  and simply click on 
Install.
Select the Component palette location in which you want to place selected library.
Maybe the best is to leave the ActiveX option selected.
Click on Install.
Select a package where the new component must be installed or create a new package 
for the new TPdf control.  Click on OK.
Delphi will prompt you whether you want to rebuild the modified/new package or not. 
 Click on 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 didn't change this 
setting in step 4)  
Drop the component on a form.
Select the TPdf component you just dropped on a blank form.
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:

If you do not have the Acrobat ActiveX control, download it 
nowhttp://www.adobe.com/prodindex/acrobat/readstep.html! It will be required for 
tip to work.
Last step (Step 15) can be done in runtime, so you can open and close files 
programmatically, as well as resize the control.

Closing acrobat reader on formdestroy:

1   procedure Tfrm_doc_pdf.FormDestroy(Sender: TObject);
2   var
3     xHWND: integer;
4   begin
5     xHWND := findwindow(nil, 'Acrobat Reader');
6     sendmessage(xHWND, WM_CLOSE, 0, 0);
7   end;



			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC