Skip to main content

Split PDF by Text

Merge & SplitSplit PDF by Text

The Split PDF by Text API splits a PDF at pages containing specific text. You send the PDF (docContent Base64, docName), text (search string), splitTextPage (before or after), optional fileNaming, and async. The API returns an array of split PDFs. Use the tester below to try it; more details are in the sections that follow.

Try the Split PDF by Text API

:::note Quick reference Endpoint: POST /api/v2/SplitByText · Required: api-key, docContent, docName, text, splitTextPage :::

:::info Try it live Use the form below to send your API key, PDF (Base64), and the text to split on (before or after). The response is an array of split PDFs. No code required—fill the fields and click Send request. :::

Loading API Tester...

Overview, parameters, and use cases

What is Split PDF by Text?

This endpoint splits a PDF at pages that contain specific text. You provide text (the search string) and splitTextPage (before or after the text). The API returns an array of PDFs, each split at the pages where the text is found. Use it when documents have repeating text markers (e.g. "Chapter 1", "Section A") that define split points.

Key features

  • Text-basedtext is the exact string to search for; splits occur at pages containing it.
  • PositionsplitTextPage: before or after the text occurrence.
  • Async – Use async for large PDFs.

:::tip Best for Use when splitting by section headers or markers. For page-based splits use Split PDF; for barcode-based use Split PDF by Barcode or Split PDF by Swiss QR. :::

Prerequisites

Before using this endpoint, make sure you have:

  • A valid PDF4me API key (Get your API Key)
  • A PDF file in Base64 format containing the text to search for

Response Format

The API returns an array of split PDF documents, each split at the pages containing the specified text.

Get Help