|
Bestimmt, ob das aktuelle Gliederungselement geöffnet ist
Delphi-Syntax:
property Opened : boolean;
C++-Syntax:
__property bool Opened;
Beschreibung
Verwenden Sie die Eigenschaft Opened, um ein Gliederungselement zu öffnen (Wert True) oder zu schließen (Wert False)
Default value: false
Codebeispiel
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-Datei wird automatisch angezeigt
HPDF.FileName := '.\Outlines.pdf'; // Set PDF filename
HPDF.BeginDoc( true ); // PDF-Datei mit Outlines erstellen
OutlineRoot := HPDF.OutlineRoot; // Outlines-Wurzel abrufen
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) ); // Zu 0,0 auf der aktuellen Seite verknüpftes Outline hinzufügen
CurrnetOutline.Opened := true; // This outline is opened
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
HPDF.AddPage; // ADD Next Page
HPDF.CurrentPage.TextOut( 0, 5, 0,' Page ' + IntToStr(I) + ' top' ); // Mark Next page top
HPDF.CurrentPage.TextOut( 0, 830, 0,' Page ' + IntToStr(I) + ' bottom' ); // Mark Next page bottom
end;
CurrnetOutline := OutlineRoot.AddChild( 'Page 10 ' ); // 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
HPDF.EndDoc; // PDF-Datei schließen
finally
HPDF.Free;
end;
end.
|