|
program Outlines; {$APPTYPE CONSOLE} uses SysUtils, Graphics, Classes, HPDFDoc;
var I: Integer; HPDF: THotPDF; OutlineRoot: THPDFDocOutlineObject; CurrnetOutline: THPDFDocOutlineObject;
begin HPDF:= THotPDF.Create(nil); try HPDF.AutoLaunch := true; // PDF file will be shown automatically HPDF.FileName := 'Outlines.pdf'; HPDF.BeginDoc( true ); // Create PDF file with outlines OutlineRoot := HPDF.OutlineRoot; // Get Outlines Root HPDF.CurrentPage.TextOut(0, 5, 0, ' Page 1 top'); // Mark first page top HPDF.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) ); // Añadir un bloque de esquema enlazado a 0,0 en la página actual CurrnetOutline.Opened := true; // This outline is opened. CurrnetOutline.AddChild( 'Top ' ); // Añadir un esquema enlazado a 0,0 en la página actual CurrnetOutline.AddChild( 'Bottom ', 0, 800 ); // Añadir un esquema enlazado a 0,800 en la página actual HPDF.AddPage; // ADD Siguiente Page HPDF.CurrentPage.TextOut( 0, 5, 0,' Page ' + IntToStr(I) + ' top' ); // Mark Siguiente page top HPDF.CurrentPage.TextOut( 0, 830, 0,' Page ' + IntToStr(I) + ' bottom' ); // Mark Siguiente page bottom end; CurrnetOutline := OutlineRoot.AddChild( 'Page 10 ' ); // ADD last Page CurrnetOutline.AddChild( 'Top ' ); // Añadir un esquema enlazado a 0,0 en la última página CurrnetOutline.AddChild( 'Bottom ', 0, 830 ); // Añadir un esquema enlazado a 0,830 en la última página HPDF.EndDoc; // Close PDF file finally HPDF.Free; end; end. |