Skip to main content
ferif4081634
Participant
March 11, 2019
Question

[Delphi Rio] How to close current pdf i show.

  • March 11, 2019
  • 1 reply
  • 1613 views

unit Unit1;

interface

uses

  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,

  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, AcroPDFLib_TLB,

  Vcl.StdCtrls;

type

  TForm1 = class(TForm)

    acrpdf1: TAcroPDF;

    btn1: TButton;

    btn2: TButton;

    procedure btn1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);

begin

     acrpdf1.src:=GetCurrentDir+'\assets\dokumen\welcome.pdf';

     acrpdf1.Show;

end;

end.

when I close the application I got force close. so before I close my application, I want to release the adobe reader 1st.

or any recommendation to do that?

my question is how to do that, there is no such function to do that.

This topic has been closed for replies.

1 reply

sinious
Legend
March 15, 2019

On the Form Close did you try simple nilling like acrpdf1.Src := '';  acrpdf1.Free;  acrpdf1 := Nil; ?