Read Barcode from PDF
Barcode → Read 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
Endpoint: POST /api/v2/ReadBarcodes · Required: api-key, docContent, docName, barcodeType, pages, async
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.
Overview, parameters, and use cases
- Overview
- Parameters
- 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 targeting – pages:
all,1,1,3,5,2-5, or1,3,7-10. - Type filtering – barcodeType:
["all"]or e.g.["qrCode","dataMatrix","code128"]. - Async – Use async for large PDFs to avoid timeouts.
Use after Add Barcode to PDF to verify embedded codes, or to extract tracking numbers, references, or product IDs from existing PDFs.
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). |
| docName | string | Yes | PDF file name with .pdf extension. |
| barcodeType | array | Yes | Barcode types to detect, e.g. ["all"] or ["qrCode","dataMatrix","code128"]. |
| pages | string | Yes | Page range: all, 1, 1,3,5, 2-5, 1,3,7-10, 2-. |
| async | boolean | Yes | Enable asynchronous processing. |
When to use Read Barcode from PDF
- Invoices and labels – Extract barcode data from shipping labels, invoices, or documents for automated processing.
- Inventory and catalogs – Read product barcodes from PDF catalogs or inventory documents.
- Tracking – Extract tracking numbers and identifiers from shipping or delivery PDFs.
- Workflows – Integrate barcode reading into document processing or verification pipelines.
- Verification – Check that barcodes added with Add Barcode to PDF decode correctly.
For request/response schemas and code samples, see Read Barcode from PDF 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 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.