Skip to main content

Read Barcode from PDF

BarcodeRead Barcode from PDF

The Read Barcode from PDF API extracts barcodes and QR codes from a PDF. You send the PDF as Base64 (docContent), docName, barcodeType (e.g. ["all"] or specific types like ["qrCode","code128"]), pages (e.g. all, 1-3), and optionally async. The API returns JSON with each barcode’s type, text, page, and position. Use the tester below to try it; more details are in the sections that follow.

Try the Read Barcode from PDF API

Quick reference

Endpoint: POST /api/v2/ReadBarcodes · Required: api-key, docContent, docName, barcodeType, pages, async

Try it live

Use the form below to send your API key, PDF (Base64), barcode types to detect, and page range. The response is JSON with extracted barcode data (or a polling URL when async). No code required—fill the fields and click Send request.

Loading API Tester...

Overview, parameters, and use cases

What is Read Barcode from PDF?

This endpoint detects and reads barcodes and QR codes inside a PDF. You specify which barcode types to look for (or ["all"]) and which pages to scan. The API returns JSON with each barcode’s type, decoded text, page number, and position (x, y, width, height). Use it to automate extraction of encoded data from invoices, labels, or any PDF with barcodes.

Key features

  • 1D and 2D support – QR Code, DataMatrix, PDF417, Code128, Code39, EAN8/EAN13, UPC-A/UPC-E, and many more.
  • Page targetingpages: all, 1, 1,3,5, 2-5, or 1,3,7-10.
  • Type filteringbarcodeType: ["all"] or e.g. ["qrCode","dataMatrix","code128"].
  • Async – Use async for large PDFs to avoid timeouts.
Best for

Use after Add Barcode to PDF to verify embedded codes, or to extract tracking numbers, references, or product IDs from existing PDFs.

Prerequisites

Before using this endpoint, make sure you have:

  • A valid PDF4me API key (Get your API Key)
  • A PDF document containing barcodes or QR codes
  • The PDF file encoded in Base64 format

Response Format

The API returns JSON with a barcodes array. Each entry includes type, text, page, x, y, width, height. Status 200 returns the data immediately; Status 202 means processing is asynchronous—poll the Location header URL until the result is ready.

Get Help