1. PDF Tools
  2. Split PDF by Chapters

PDF Tools

Split PDF by Chapters

Splits PDFs by chapter bookmark levels. Useful for breaking large documents into meaningful sections.

Uses

Use this task for splitting a PDF into multiple smaller PDFs at specified chapter bookmark levels. The PDF needs bookmarks (an outline) for this to work.

Basic Usage

loading...

Parameters Explained

files
required
array

An array of PDF file objects to be split at specified chapter bookmark levels.

bookmark_level
required
integer

The bookmark level at which to split the PDF. For example splitting at level 0 would return PDFs each containing entire top level chapters, e.g Chapter 1, Chapter 2, etc. Splitting at level 1 would return PDFs of chapters: Chapter 1, Chapter 1.1, Chapter 2, etc.

include_metadata
required
boolean

Whether to include metadata or not in the resulting PDFs.

allow_duplicates
required
boolean

Whether a page that starts more than one bookmark (for example a chapter and its first section) is included in each of their PDFs.

function
required
string

The pdf_tools function to call, in this case it would be split_chapters

Result

The newly created files are returned in files. The same files are returned in attachments, which adds them to the stub's attachments.

editor
        {
  "split_pdf_by_chapters": {
    "success": true,
    "payload": {
      "files": [
        {
          "fileuuid": "8142ce6c-f3cd-526c-a5d3-747799ed2b01",
          "filename": "0 Chapter 1.pdf",
          "originalname": "0 Chapter 1.pdf",
          "contentType": "application/pdf",
          "visibility": "private"
        },
        {
          "fileuuid": "8142ce6c-f3cd-526c-a5d3-747799ed2b02",
          "filename": "1 Chapter 2.pdf",
          "originalname": "1 Chapter 2.pdf",
          "contentType": "application/pdf",
          "visibility": "private"
        }
      ],
      "attachments": [...]
    }
  }
}