How do I create bookmarks (table of contents) based on font and other text styles in PDF?

Q: I'm a software engineer and looking for a C# API to create
bookmarks in an existing pdf document.
I've already read the corresponding parts on your website but still
don't know if PDFNet SDK offers what I would need.

We have a lot of pdf documents where we have to create bookmarks. The
bookmarks should base on the headlines in the pdf document.
Unfortunately we only know what a headline is by font and style.
Example:
Arial 14 pt, bold => Headline Level 1
Arial 12 pt, bold => Headline Level 2
...

So, what a pdf API needs to offer is a way we can search for a certain
font style in the pdf document and create bookmarks based on this
information.

Can I use PDFNet SDK for this purpose?
------
A: You could use PDFNet SDK to create bookmarks based on the logical
structure (e.g. font styles or positioning info) of PDF content.

For bookmark creation part please refer to BookmarksTest sample
project (http://www.pdftron.com/net/samplecode.html#Bookmark) and the
API Reference (http://www.pdftron.com/net/html/
classpdftron_1_1PDF_1_1Bookmark.html).

In order to identify section headers (e.g. start of a chapter) you
could use either 'pdftron.PDF.TextExtractor' or
'pdftron.PDF.ElementReader'.

TextExtractor is simpler to use than ElementReader, because it can
analyze text fragments on the page and reconstruct logical structure
(e.g. words, lines, paragraphs, etc). As a starting point you may want
to take a look at TextExtract sample project (http://www.pdftron.com/
net/samplecode.html#TextExtract).

To obtain the positioning information for each word/line use (word/
line.GetBBox()) and to obtain styling information (including font,
font size, font name, and text color) use word/line.GetStyle().