Free plan

Bookmarks and Contents

Add, read or clear the clickable contents list of a PDF
POST
/v1/pdfs/bookmarks

About this tool

Bookmarks are the clickable list of chapters in the side panel of a PDF. This tool can read them, write a new list, clear them, or add a contents page with links to the pages. It can also set page labels, such as i, ii, iii for the first pages and then 1, 2, 3. You write bookmarks as a list of titles with page numbers.
For example, you add chapter links to a long report so readers can jump to each part.

How to use it

  1. Choose this tool.
  2. Add your PDF with Upload or drag and drop.
  3. Choose what to do: list, set, clear, contents page or page labels.
  4. For set, contents page or labels, fill in the bookmark titles with their page numbers.
  5. Press Generate, then view the list or download the new PDF.

What you get back

You get the list of bookmarks on screen, or a new PDF with the change, ready to download.
GOOD TO KNOW
list answers inline and produces no file.
TEST IT LIVE

Try Bookmarks and Contents in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/bookmarks
Tool ID
pdfs.bookmarks
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/bookmarks" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'operation=list' \
  -F 'toc_depth=3' \
  -F 'output_bundle=zip'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.bookmarks({
    "file": 'document.pdf',
    "operation": "list",
    "toc_depth": 3,
    "output_bundle": "zip"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->bookmarks([
    'file' => 'document.pdf',
    'operation' => 'list',
    'toc_depth' => 3,
    'output_bundle' => 'zip',
]);
echo $result->requestId;
FAQ

Frequently asked questions

list: read the bookmarks; set: write a bookmark tree; clear: remove them; toc: insert a table-of-contents page with links built from the bookmarks (or a tree you send); labels: set page labels such as i, ii, iii then 1, 2, 3.

Bookmarks and Contents accepts PDF. You can send several files in one request.

Bookmarks and Contents is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/bookmarks with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.