⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainunit.pas

📁 生成PDF文档的控件
💻 PAS
字号:
{*******************************************************}
{                                                       }
{       This unit is part of the VISPDF VCL library.    }
{       Written by R.Husske - ALL RIGHTS RESERVED.      }
{                                                       }
{       Copyright (C) 2000-2008, www.vispdf.com         }
{                                                       }
{       e-mail: support@vispdf.com                      }
{       http://www.vispdf.com                           }
{                                                       }
{*******************************************************}

unit MainUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  VPDFDoc, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    VPDF: TVPDF;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
    BeginPoint: TVPDFCurrPoint;
    EndPoint: TVPDFCurrPoint;
begin
    VPDF.BeginDoc;                 // Create PDF document

    VPDF.CurrentPage.AddTextAnnotation( 'Text annotations example', Rect(10, 10, 20, 20), true, taComment, clBlue ); // Draw text annotation

    VPDF.CurrentPage.AddFreeTextAnnotation( 'Free text annotations example', Rect(10, 160, 200, 220), ftLeftJust, clRed ); // Draw free text annotation

    BeginPoint.X := 10;
    BeginPoint.Y := 230;
    EndPoint.X := 100;
    EndPoint.Y := 290;

    VPDF.CurrentPage.AddLineAnnotation( 'Line annotation example', BeginPoint, EndPoint, clYellow); // Draw line annotation

    VPDF.CurrentPage.AddCircleSquareAnnotation( 'Circle annotation example', Rect(10, 300, 200, 330), csCircle, clGreen ); // Draw circle and square annotation

    VPDF.CurrentPage.AddStampAnnotation('Stamp annotation example', Rect(313, 20, 475, 120), satDraft, clPurple); // Draw stamp annotation

    VPDF.CurrentPage.AddFileAttachmentAnnotation('File attach annotation example', '..\License.txt', Rect(300, 160, 450, 200), clLime); // Draw file attachment annotation

    VPDF.CurrentPage.AddSoundAnnotation( 'Sound Annotation demo', '..\Music.wav', Rect(300, 230, 450, 250), $550000); // Draw sound annotation

    VPDF.CurrentPage.AddMovieAnnotation( 'Movie annotation demo', '..\Clock.mov', Rect(300, 290, 450, 370), clGreen ); // Draw movie annotation

    VPDF.EndDoc;                   // Close PDF document
end;

end.

⌨️ 快捷键说明

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