DEV Community

Stone
Stone

Posted on

How to automatically add bookmarks to a PDF?

Tocify is a web-based utility designed to automate the creation of bookmarks / Tables of Contents for PDF documents. It resolves issues regarding missing directory structures in scanned or electronic files.

The tool operates entirely within the browser, utilizing AI to parse structure from images or raw text without requiring software installation. And it also supports Desktop client on MacOS and Windows.

Key Features

1. Intelligent Extraction from PDF

For PDF documents containing a visual contents page (e.g., scanned images that are non-interactive), Tocify provides a selection tool to convert these images into functional bookmarks.

add bookmarks to a pdf<br>
 1

add bookmarks to a pdf<br>
 2

2.Text-Based Structure Parsing

In cases where the source PDF lacks a visual directory, users may utilize external text data (e.g., TOC text copied from library databases or online bookstores). The generated structure is synchronized with the PDF's internal bookmark system.

Note: Page offsets can be manually adjusted in the ToC settings to align digital page numbers with physical print numbers.

parse text table of contents

3. Entity Page Injection

Standard PDF editors typically modify only the metadata bookmarks. Tocify allows for the generation of a physical Table of Contents page, which is essential for printing or viewing on limited hardware.

adjust style for ToC pages<br>

Specifications & Privacy

1. Local Processing Environment

All core file manipulation logic, including bookmark insertion and page rendering, is executed locally within the user's browser. PDF files are not uploaded to cloud storage servers during the editing process.

2. API Configuration

The application includes a default API key for immediate evaluation. Due to token limitations on public keys, it is recommended to configure a custom API key for high-volume usage or enhanced privacy.
Supported Providers: Qwen, Gemini, Doubao. API keys can be entered directly in the API Settings panel.

3. Open Source Availability

This project is open-source and the link is https://github.com/anig1scur/tocify. Developers or users requiring offline functionality may clone the repository for local deployment.

Top comments (0)