PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Bookmarks are a convenient navigation tool in PDF documents that allow users to quickly jump to specific pages or locations within the document. Bookmarks are typically displayed in a sidebar or panel of the document reader, allowing users to quickly access related content by clicking on them. Bookmarks can be added manually or automatically generated based on the document structure.
const bookmarks = await pdfReaderRef.current?._pdfDocument.getBookmarks();const title = 'Chapter 1';
const pageIndex = 2;
const addResult = await pdfReaderRef.current?._pdfDocument.addBookmark(title, pageIndex);const bookmarks = await pdfReaderRef.current?._pdfDocument.getBookmarks();
if (bookmarks.length > 0) {
const bookmark = bookmarks[0];
bookmark.setTitle('Updated Title');
const updateResult = await pdfReaderRef.current?._pdfDocument.updateBookmark(bookmark);
}const pageIndex = 0;
const removeResult = await pdfReaderRef.current?._pdfDocument.removeBookmark(pageIndex);const pageIndex = 0;
const hasBookmark = await pdfReaderRef.current?._pdfDocument.hasBookmark(pageIndex);