Split PDF by Barcode
Merge & Split → Split PDF by Barcode
The Split PDF by Barcode API splits a PDF at pages containing specific barcodes. You send the PDF (docContent Base64, docName), barcodeString, barcodeFilter (startsWith, endsWith, contains, exact), optional barcodeType, splitBarcodePage (before, after, remove), optional combinePagesWithSameConsecutiveBarcodes, pdfRenderDpi, 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 Barcode API
:::note Quick reference
Endpoint: POST /api/v2/SplitPdfByBarcode_old · Required: api-key, docContent, docName, barcodeString, barcodeFilter, splitBarcodePage
:::
:::info Try it live Use the form below to send your API key, PDF (Base64), barcode string, filter, and split position. The response is an array of split PDFs. No code required—fill the fields and click Send request. :::
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Split PDF by Barcode?
This endpoint splits a PDF at pages that contain barcodes matching your criteria. You provide barcodeString and barcodeFilter (startsWith, endsWith, contains, exact), optional barcodeType (any, datamatrix, qrcode, pdf417), splitBarcodePage (before, after, remove), and optional combinePagesWithSameConsecutiveBarcodes. The API returns an array of PDFs split at the matching barcode pages.
Barcode filter options
- startsWith – Barcode starts with the specified string.
- endsWith – Barcode ends with the specified string.
- contains – Barcode contains the specified string.
- exact – Barcode exactly matches the specified string.
:::tip Best for Use when splitting by barcode content (e.g. batch IDs). For page-based splits use Split PDF; for Swiss QR use Split PDF by Swiss QR. :::
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64) containing barcodes. |
| docName | string | Yes | Output PDF file name (e.g. output.pdf). |
| barcodeString | string | Yes | Barcode string to search for. |
| barcodeFilter | string | Yes | startsWith, endsWith, contains, or exact. |
| barcodeType | string | No | any, datamatrix, qrcode, or pdf417. |
| splitBarcodePage | string | Yes | before, after, or remove. |
| combinePagesWithSameConsecutiveBarcodes | boolean | No | Combine consecutive pages with same barcode. |
| pdfRenderDpi | string | No | PDF render DPI (e.g. 150). |
| async | boolean | No | Enable asynchronous processing. |
When to use Split PDF by Barcode
- Batch separation – Split at pages where barcode content changes (e.g. batch ID).
- Document routing – Split by barcode value for routing or archiving.
- Multi-document extraction – Extract segments between barcode markers.
:::info Need the full API? For request/response schemas and code samples, see Split by Barcode in the PDF4me API docs. :::
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 barcodes
Response Format
The API returns an array of split PDF documents, each split at the pages containing the specified barcode.