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

📄 outlines.dpr

📁 生成PDF文档的控件
💻 DPR
字号:
{*******************************************************}
{                                                       }
{       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                           }
{                                                       }
{*******************************************************}

program Outlines;
{$APPTYPE CONSOLE}
uses
  SysUtils,
  Graphics,
  Classes,
  VPDFDoc;

var
   I: Integer;
   VPDF: TVPDF;
   OutlineRoot: TVPDFDocOutlineObject;
   CurrnetOutline: TVPDFDocOutlineObject;

begin
  VPDF:= TVPDF.Create(nil);
  try
    VPDF.AutoLaunch := true;              // PDF file will be shown automatically
    VPDF.FileName := '.\Outlines.pdf';    // Set PDF filename
    VPDF.BeginDoc( true );                // Create PDF file with outlines
    OutlineRoot := VPDF.OutlineRoot;      // Get Outlines Root
    VPDF.CurrentPage.TextOut(0, 5, 0, '  Page 1 top');           // Mark first page top
    VPDF.CurrentPage.TextOut(0, 830, 0, '  Page 1 bottom');      // Mark first page bottom
    for I := 2 to 100 do
    begin
        CurrnetOutline := OutlineRoot.AddChild( 'Page ' + IntToStr(I - 1) );  // Add Outline block linked to 0,0 in current page
        CurrnetOutline.AddChild( 'Top ' );                //  Add Outline linked to 0,0 in current page
        CurrnetOutline.AddChild( 'Bottom ', 0, 800 );     //  Add Outline linked to 0,800 in current page
        VPDF.AddPage;                                                     // ADD Next Page
        VPDF.CurrentPage.TextOut(0, 5,  0,'  Page ' + IntToStr(I) + ' top');      // Mark Next page top
        VPDF.CurrentPage.TextOut(0, 830,  0,'  Page ' + IntToStr(I) + ' bottom'); // Mark Next page bottom
    end;
    CurrnetOutline := OutlineRoot.AddChild( 'Page 100 ' );             // ADD last  Page
    CurrnetOutline.AddChild( 'Top ' );                      //  Add Outline linked to 0,0 in last page
    CurrnetOutline.AddChild( 'Bottom ', 0, 830 );           //  Add Outline linked to 0,830 in last page
    VPDF.EndDoc;                                            // Close PDF file
  finally
      VPDF.Free;
  end;
end.

⌨️ 快捷键说明

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