On Sun, 15 Sep 2019 20:15:35 +0300, Andy Sardina <[email protected]> wrote: > Hi everyone, > > I sometimes get PDF files that do not contain TOC. I really like that > in Foxit Reader you can create the TOC and I would like to have the same > functionality in Okular. I have been looking at the source code of Poppler > and I couldn't find a function to set an Outline object. Is anybody working > on it? I would like to contribute to it.
For tagged PDFs you can probably get a very good TOC by fetching the document's structure tree and traversing it to extract the interesting parts. With the GLib API you can use PopplerStructureElement [1] to inspect the structure of the document and pick the heading elements. Beware that not all PDFs are tagged, so this won't work for every document out there. For non-tagged documents, I suppose Foxit uses some heuristics to guess which text elements are section headings. I hope this helps. Cheers, —Adrián --- [1] https://poppler.freedesktop.org/api/glib/PopplerStructureElement.html
signature.asc
Description: PGP signature
_______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
