Skip to main content
Barcode API

Generate, embed, read and split by barcode.

One REST API for the whole barcode lifecycle: create 150+ barcode and QR types, stamp them onto any PDF, read them back with coordinates, or split a scanned batch at its barcode separators.

Run it anywhere

The Barcode API, on every platform.

Add Create Barcode as a native no-code action, or call the same operation from the REST API. Build it once, then run it everywhere.

One call

A scannable barcode from one line of text.

  • Pick the symbology. Set barcodeType to qrCode, code128, dataMatrix, pdf417, aztec, ean13, upcA and more — 150+ in all.
  • Encode your value. Put the data in text; hideText decides whether the human-readable caption prints beneath it.
  • Get a print-ready PNG. POST /api/v2/CreateBarcode returns the barcode as a binary image, optimised for print and mobile scanning.
  • Scale up async. Set async: true for a 202 and a polling URL when you generate codes in bulk.
150+ types QR · Data Matrix PNG out
create-barcode.sh
curl -X POST https://api.pdf4me.com/api/v2/CreateBarcode \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "PDF4me Barcode Sample",
    "barcodeType": "qrCode",
    "hideText": false,
    "async": true
  }'
Add to a PDF

Stamp a barcode onto any page.

  • Send the PDF and the code. docContent is your Base64 PDF; text and barcodeType define the barcode to stamp.
  • Target the pages. pages accepts all, 1-3, 1,3,5 or 2-, so you can brand every page or just the cover.
  • Place it precisely. alignX (Left/Center/Right) and alignY (Top/Middle/Bottom), with size and margins in millimetres or points.
  • Fine-tune the look. Set opacity, put the caption above or below, or use showOnlyInPrint for a scan mark that stays off-screen.
Any page range mm or points Opacity & print-only
A barcode and QR code stamped onto a PDF document page with precise positioning.

Barcodes and QR codes embedded into a PDF via /api/v2/AddBarcode.

Read & route

Decode barcodes, then act on them.

  • Decode everything on the page. Pass barcodeType: ["all"], or list specific formats like ["qrCode","code128"]; pages picks the range.
  • Get structured results. Each hit returns its type, decoded text, page and x / y / width / height coordinates.
  • Route on the value. Use the decoded text to rename, sort or look up records in the next step of your workflow.
  • Or split the whole batch. Split PDF by Barcode cuts a merged scan at separator pages. For Swiss QR invoice batches, use Split PDF by Swiss QR. Read Swiss QR returns the payment payload.
1D & 2D Coordinates Split by barcode
read-barcodes.json
{
  "barcodes": [
    {
      "type": "qrCode",
      "text": "INV-2026-0042",
      "page": 1,
      "x": 100, "y": 200,
      "width": 50, "height": 50
    }
  ]
}

Get your documents done.

Build it into your product with the API, automate it with no code, or use the free tools in your browser. No credit card to begin.

Start with a single callcurl -X POST https://api.pdf4me.com/v1/ConvertToPdf

Free tier · No credit card required