add_outline#
Adds an entry to the PDF’s document outline (its bookmark tree) and returns the entry’s id, for use as the parent of further entries.
my $id = $pdf->add_outline( Cairo::PdfSurface::OUTLINE_ROOT, ‘Chapter 1’, “page=1”, 0); $pdf->add_outline($id, ‘Section 1.1’, “page=2”, 0);
$parent_id is Cairo::PdfSurface::OUTLINE_ROOT for a top-level entry, $link_attribs a string of name=value pairs saying where the entry points, and $flags a plain INTEGER bitmask - unlike the other enumerated arguments in this module, it is not a name. Needs cairo 1.16 or newer; on an older library the call dies saying so. Wraps cairo_pdf_surface_add_outline.