Question:
How can I embed Adobe Acrobat into my application so users can read PDF files?
Answer:
This document describes the process on how to use Adobe Acrobat to display files inside of your application.
To set the file that you want open, use the src property, such as:
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;
If you don't want the Acrobat toolbar to be shown, you can call Pdf1.setShowToolbar(false);. You can then have custom buttons that allow the user to navigate through the PDF document by calling gotoFirstPage, gotoLastPage, setZoom(percent: Single), etc. To find out a list of all the functions you can call, open the file that you imported (it is probably called PdfLib_TLB.pas), and look at all the functions in the class TPdf = class(TOleControl). To easily browse to this file, you can place the cursor over the PdfLib_TLB name in the uses clause and press Ctrl-Enter.
Last Modified: 31-MAY-00