Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Outlines
Collapse All

Adds a new tree node to a tree of the outline items.

Syntax

LONG PDFOUTLINES_Add (
LONG nodeIndex,
BSTR nodeTitle,
LONG actionIndex,
TxFontCharset charset
)
Parameters
nodeIndex
Index of any sibling node.

nodeTitle
New node's title.

actionIndex
New node's action index.

charset
New node's character set.

Return value
New node index.

Remarks

This function adds a new node to a tree as the last sibling of the node specified by the nodeIndex parameter. Use PDFOUTLINES_AddFirst to add node as the first sibling of the node specified by the nodeIndex parameter. Use PDFOUTLINES_Insert to insert a node in the specified position.

The function returns the node that has been added. An action with actionIndex index executes when a user clicks a created node. The created node contains a nodeTitle as the node's own text in a charset code page.

The return value is an outline identifier in document's outlines collection and can be used in SetCurrentPDFOutlineNode, PDFOUTLINES_Add, PDFOUTLINES_AddChild, PDFOUTLINES_AddFirst, PDFOUTLINES_Insert.

Analogue in new interface: IPDFDocument4::AddOutlineAfter, IPDFDocument4::AddOutlineBefore, IPDFDocument4::AddUnicodeOutlineAfter, IPDFDocument4::AddUnicodeOutlineBefore.

Example

Pdf outlines construction sample

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
lAction := PDF.CreateGoToPageAction(0, 0);
i0 := PDF.PDFOUTLINES_Add(0, '0', lAction, charsetANSI_CHARSET);
i1 := PDF.PDFOUTLINES_Add(i0, '1', lAction, charsetANSI_CHARSET);
{ you may set 1st parameter to any sibling }
i2 := PDF.PDFOUTLINES_Add(i1, '2', lAction, charsetANSI_CHARSET);
' it is identical to
' i2 := PDF.PDFOUTLINES_Add(i0, '2', lAction, charsetANSI_CHARSET);
i3 := PDF.PDFOUTLINES_AddChild(i0, '3', lAction, charsetANSI_CHARSET);
PDF.EndDoc;

{ This code will produce nodes tree like this:
 0
  3
 1
 2
}
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
LONG lAction = PDF.CreateGoToPageAction (0, 0);
LONG i0 = PDF->PDFOUTLINES_Add(0, "0", lAction, charsetANSI_CHARSET);
LONG i1 = PDF->PDFOUTLINES_Add(i0, "1", lAction, charsetANSI_CHARSET);
// you may set 1st parameter to any sibling
LONG i2 = PDF->PDFOUTLINES_Add(i1, "2", lAction, charsetANSI_CHARSET);
// it is identical to
// LONG i2 = PDF->PDFOUTLINES_Add(i0, "2", lAction, charsetANSI_CHARSET);
LONG i3 = PDF->PDFOUTLINES_AddChild(i0, "3", lAction, charsetANSI_CHARSET);
PDF->EndDoc();

/* This code will produce nodes tree like this:
 0
  3
 1
 2
*/
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
long lAction = PDF.CreateGoToPageAction (0, 0);
long i0 = PDF.PDFOUTLINES_Add(0, "0", lAction, TxFontCharset.charsetANSI_CHARSET);
long i1 = PDF.PDFOUTLINES_Add(i0, "1", lAction, TxFontCharset.charsetANSI_CHARSET);
// you may set 1st parameter to any sibling
long i2 = PDF.PDFOUTLINES_Add(i1, "2", lAction, TxFontCharset.charsetANSI_CHARSET);
// it is identical to
// long i2 = PDF.PDFOUTLINES_Add(i0, "2", lAction, TxFontCharset.charsetANSI_CHARSET);
long i3 = PDF.PDFOUTLINES_AddChild(i0, "3", lAction, TxFontCharset.charsetANSI_CHARSET);
PDF.EndDoc();

/* This code will produce nodes tree like this:
 0
  3
 1
 2
*/
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
lAction = PDF.CreateGoToPageAction (0, 0)
i0 = PDF.PDFOUTLINES_Add(0, "0", lAction, 0)
i1 = PDF.PDFOUTLINES_Add(i0, "1", lAction, 0)
' you may set 1st parameter to any sibling
i2 = PDF.PDFOUTLINES_Add(i1, "2", lAction, 0)
' it is identical to
' i2 = PDF.PDFOUTLINES_Add(i0, "2", lAction, 0)
i3 = PDF.PDFOUTLINES_AddChild(i0, "3", lAction, 0)
PDF.EndDoc

' This code will produce nodes tree like this:
' 0
'  3
' 1
' 2

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots