Outlines

Top  Previous  Next

Outline items created in WPTools can be exported to PDF.

 

As Outline items all paragraphs are recognized which use the flag 'outlinemode'. This can be set in the WPRichText.CurrAttr.OutlineMode property. If you use the WPTools gutter a little dot will be shown for such paragraphs.

 

As standard behavior the outline items (adobe calls them bookmarks) are created one underneath each other. You can change this order be setting a level in the OnPrintOutline event:

 

procedure TForm1.OnPrintOutline(

     Sender: TWPCustomPDFExport;

     Memo : TWPRTFTextPaint;

     par  : PTParagraph;

     lin  : PTLine;

    var Caption : String;

    var level : Integer;

    var Abort : Boolean);

begin

 level := par^.numlevel-1;

if level<0 then level := 0;

end;

 

This code will use the level of the outline in the text (the numbering level!) as depth in the PDF outline. You can of course also check for certain text sizes to change the depth.