Skip to main content

Split PDF by Barcode

Merge & SplitSplit 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. :::

Loading API Tester...

Overview, parameters, and 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. :::

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.

Get Help