Skip to main content

Split PDF by Text using n8n action

PDF4me Split PDF by Text divides PDF documents based on detected text patterns and content through n8n automation workflows. Process PDFs via n8n triggers, binary data, base64 strings, or public URLs to automatically find specific text strings, split documents at text locations, and organize files using detected content for intelligent file naming. This solution is ideal for invoice separation, contract splitting, batch document processing, content-based organization, automated filing, and text-based document sorting workflows that require accurate text detection with intelligent document splitting and seamless integration.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

Setup​

Add the PDF4me "Split PDF by Text" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Split PDF by Text" action
  3. Configure input parameters (see below)
Split PDF by Text

Parameters​

Complete list of parameters for the Split PDF By Text action. Configure these parameters to control text-based PDF splitting.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterRequiredWhat it doesExample
Input Data TypeRequiredChoose how to provide the PDF data. Options: Base64 String, Binary Data, URL. Default is `Binary Data`.Binary Data
Base64 ContentConditionalBase64 encoded PDF content. Shown when Input Data Type is Base64 String.UEsDBBQABgAI...
Binary Property NameConditionalName of the binary property containing the PDF file. Shown when Input Data Type is Binary Data. Default is `data`.data
PDF URLConditionalURL to the PDF file. Shown when Input Data Type is URL.
Text to SearchRequiredText to search for splitting.page 1, line 10.
Split Text PageRequiredWhere to split relative to the text page. Options: After, Before. Default is `After`.After
File NamingRequiredFile naming convention for split files. Options: Name As Per Order, Name As Per Page. Default is `Name As Per Order`.Name As Per Order
Output Binary Field NameOptionalName of the binary property to store the output PDF file. Default is `data`.data
Advanced OptionsOptionalOptional settings, collapsed behind Add Option.Add Option
Custom ProfilesOptionalUse "JSON" to adjust custom properties. Review Profiles at https://dev.pdf4me.com/apiv2/documentation/ to set extra options for API calls.{ "outputDataFormat": "base64", "preserveMetadata": true, "optimizeForPrinting": false, "compressionLevel": "medium" }

Output​

Output Parameters​

FieldTypeWhat it contains
successBooleanTrue when the operation succeeded.
messageStringStatus message, `PDF split into <n> file(s) successfully`.
folderNameStringAlways `sample_split_text_outputs`. Informational only.
outputDirectoryString`/tmp/` followed by folderName. Informational only: the node does not write any files there.
totalFilesNumberNumber of split files returned.
sourcePdfStringAlways `sample.pdf`, whatever the input file is called.
responseTypeStringWhich PDF4me response format the node read, for example `Multiple PDFs (splitedDocuments)`.
filesStringOne entry per split file: fileName, pageIndex (position of the part, from 1), binaryProperty (name of the binary property that holds it), mimeType, fileType (`PDF file`) and fileSize (bytes).
dataBinaryOne PDF per split part, all on the single output item, in binary properties named after Output Binary Field Name with a counter (`data_1`, `data_2`, ...). No ZIP file is returned; if PDF4me answers with a ZIP the node stops with an error.

N8N Action Response​

The PDF4me Split PDF by Text API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"success": true,
"message": "PDF split by text successfully",
"fileName": "text_split_output.pdf",
"mimeType": "application/pdf",
"fileSize": 125430,
"docName": "text_split_output.pdf",
"textSplitCompleted": true,
"textMatchesFound": 3,
"filesGenerated": 4
}
]

Use Cases​

Document Processing and Content Management​

  • Split large documents at specific text markers or section headers to create organized, manageable files for different departments or processes
  • Process legal documents by splitting at specific clause markers or section dividers to create individual files for each legal section
  • Automate the separation of reports and manuals based on chapter titles or section headers for better content organization

Business Process Automation​

  • Split invoice batches by searching for specific text patterns like "Invoice #" or "Payment Due" to create individual invoice files for each transaction
  • Process contracts and agreements by splitting at specific text markers like "Section" or "Article" to create separate files for each section
  • Automate the organization of financial documents by splitting at text patterns like "Quarterly Report" or "Annual Summary" for different reporting periods

Content Distribution and Workflow Management​

  • Split confidential documents at specific text markers to create separate files for different stakeholders based on access requirements
  • Process training materials by splitting at text patterns like "Module" or "Lesson" to create individual learning modules for different audiences
  • Automate the organization of technical documentation by splitting at text markers like "API Reference" or "User Guide" for different user types

Get Help​