//
unit ads_Acrobat; {Copyright(c)2016 Advanced Delphi Systems Richard Maley Advanced Delphi Systems 12613 Maidens Bower Drive Potomac, MD 20854 USA phone 301-840-1554 dickmaley@advdelphisys.com The code herein can be used or modified by anyone. Please retain references to Richard Maley at Advanced Delphi Systems. If you make improvements to the code please send your improvements to dickmaley@advdelphisys.com so that the entire Delphi community can benefit. All comments are welcome. } (*UnitIndex Master Index Implementation Section Download Units
Description: ads_Acrobat.pas This unit contains the following routines.
Register TAcroFormApp.GetIsOpen TAcroFormApp.GetPDFFile TAcroFormApp.Open TAcroFormApp.SetPDFFile
*) interface Uses AFORMAUTLib_TLB,Acrobat_TLB, Classes; Type TAcroFormApp = class(TAFormApp) private FPDFFile : String; function GetPDFFile: String; procedure SetPDFFile(const Value: String); function GetIsOpen: Boolean; Protected FavDoc : Variant; FIsOpen : Boolean; Public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure Open(); published property PDFFile: String Read GetPDFFile Write SetPDFFile; property IsOpen : Boolean Read GetIsOpen; End; procedure Register; {$R ADS_ACROBAT01.DCR} implementation Uses ComObj,Variants,SysUtils; //Unit Description UnitIndex Master Index
procedure Register; begin RegisterComponents('Acrobat', [TAcroFormApp]); end; { TAcroFormApp } constructor TAcroFormApp.Create; begin inherited; FPDFFile := ''; FIsOpen := False; FavDoc := CreateOleObject('AcroExch.AVDoc'); end; destructor TAcroFormApp.Destroy; begin FavDoc := Unassigned; inherited; end; //Unit Description UnitIndex Master Index
function TAcroFormApp.GetIsOpen: Boolean; begin Result := FIsOpen; end; //Unit Description UnitIndex Master Index
function TAcroFormApp.GetPDFFile: String; begin SetPDFFile(FPDFFile); Result := FPDFFile; end; //Unit Description UnitIndex Master Index
procedure TAcroFormApp.Open(); begin If PDFFile<>'' Then FIsOpen := FavDoc.Open(PDFFile,''); end; //Unit Description UnitIndex Master Index
procedure TAcroFormApp.SetPDFFile(const Value: String); begin If Not FileExists(Value) Then FPDFFile := '' Else FPDFFile := Value; end; end. //