updf.pas

来自「基于OOP设计的一套较好的ERP系统」· PAS 代码 · 共 50 行

PAS
50
字号
unit uPdf;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, OleCtrls, PdfLib_TLB, Buttons, ExtCtrls, RXCtrls;

type
  TPdf_View = class(TForm)
    Panel1: TPanel;
    Chiudi_btn: TBitBtn;
    Pdf_obj: TPdf;
    nome_file: TRxLabel;
    procedure Chiudi_btnClick(Sender: TObject);
  private
    { Private declarations }
  public
    procedure Pagina(pag: integer);
    procedure Carica(nomeFile: string);
    { Public declarations }
  end;

var
  Pdf_View: TPdf_View;

implementation

{$R *.DFM}

procedure TPdf_View.Chiudi_btnClick(Sender: TObject);
begin
 Close ;
end;

procedure TPdf_View.Pagina(pag: integer);
begin
 //If pdf_obj.src <> '' then
    pdf_obj.setCurrentPage(pag) ;
end;

procedure TPdf_View.Carica(nomeFile: string);
begin
 If nome_file.Caption = nomeFile then exit ;
 Pdf_obj.LoadFile(nomefile);
 nome_file.Caption := nomeFile ;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?