Copy link to clipboard
Copied
What does the Auto-tag API do in terms of generating bookmarks? It seems that some PDFs produce bookmarks based on the structure, and some don't. In Acrobat, there is an ability to generate bookmarks based on the structure, but you are required to select the structure elements to be used. The API doesn't provide a way to specify these structures.
Thanks.
Copy link to clipboard
Copied
Ping!
Copy link to clipboard
Copied
Auto-Tag doesn't modify the bookmarks at all.
You'll have to post-process the PDF using a PDF library tool like PDFBox.
PDFMarkedContentExtractor
class in PDFBox to extract the tagged content from a PDF document. You'll iterate through the pages, process each page with the extractor, and then retrieve the marked content list, which will contain information about the tags and their associated text content.PDMarkedContent
objects and identify the tags that should correspond to your desired bookmark hierarchy (e.g., <H1>
for top-level bookmarks, <H2>
for sub-bookmarks, etc.).PDDocumentOutline
and PDOutlineItem
classes in PDFBox to build the bookmark structure (also called the document outline) based on the identified tags and their corresponding text. You'll specify the title of each bookmark (typically extracted from the tag's content) and the page it should link to. Copy link to clipboard
Copied
Thanks Joel
Find more inspiration, events, and resources on the new Adobe Community
Explore Now