Skip to main content

Read Barcode From PDF in n8n

Read Barcode From PDF is an n8n module by PDF4me that detects and decodes barcodes embedded in a PDF document. Send the PDF as binary data, Base64, or a URL, choose a barcode type and page range, and receive the decoded values as structured JSON.

What this node does

PDF4me: Read Barcode From PDF scans a PDF and decodes any barcodes or QR codes it finds in one n8n step. Choose Barcode Type All or a specific format (QR Code, Code 128, Data Matrix, and other supported types), and target specific pages or the whole document with Pages. Returns the decoded values as a JSON file. Ideal for automated data entry, shipping label processing, inventory tracking, and compliance verification workflows.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

Authenticating Your API Request

Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate barcode-reading requests securely.

Important Facts You Should Not Miss

Narrowing Barcode Type speeds up scanning
All scans for every supported barcode format, which is thorough but slower. If you already know the format, for example QR Code on shipping labels, selecting it directly reduces processing time.
Scan resolution affects decode accuracy
Barcodes on low-resolution or heavily compressed scanned PDFs can fail to decode if the bars or modules are not clearly distinguishable.
Output is a JSON file, not the source PDF
The node returns decoded barcode data as a JSON file under Binary Data Output Name, it does not return or modify the original PDF.
Read Barcode From PDF n8n node configured with Credential PDF4ME account, Action Read Barcode From PDF, Input Data Type Binary Data, Input Binary Field data, Output File Name read_barcode_from_pdf.json, Barcode Type All, Pages all, Async toggle on, and Binary Data Output Name data

Full node panel: PDF via Binary Data, Barcode Type All, Pages all

Parameters

Required in the n8n UI: Input Data Type, Barcode Type, and Pages. Output File Name (default read_barcode_from_pdf.json), Async, and Binary Data Output Name (default data) are optional convenience fields. Conditional source fields (Input Binary Field, Base64 Document Content, File URL) appear only when their matching Input Data Type is chosen.

ParameterRequiredWhat it doesExample
Input Data TypeRequiredHow the source PDF enters the node. Binary Data reads from a previous node (default, most common). Base64 String accepts an encoded PDF. URL downloads the PDF from a public link.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the PDF. Required when Input Data Type is Binary Data.data
Base64 Document ContentConditionalBase64-encoded PDF content. Required when Input Data Type is Base64 String.UEsDBBQABgAI...
File URLConditionalPublicly reachable URL to the PDF file. Required when Input Data Type is URL.https://abc.com/xyz.pdf
Output File NameOptionalFilename of the generated JSON file containing barcode data. Default is read_barcode_from_pdf.json.read_barcode_from_pdf.json
Barcode TypeRequiredThe barcode format to scan for. All detects any supported type. A specific format speeds up processing when known in advance.All
PagesRequiredPage indices to scan, as a string. Accepts all, a single index like 0, a comma-separated list, or a range like 1-5.all
AsyncOptionalToggle background processing. On processes asynchronously for better throughput on larger jobs, off returns results synchronously.On
Binary Data Output NameOptionalName of the binary property the output JSON file is exposed under. Default is data.data

What Fields Does the Output Include?

FieldTypeWhat it contains
successBooleanTrue when barcode reading completed successfully. Use to route error-handling branches.
messageStringDescriptive status message confirming success or describing an error.
fileNameStringFilename of the generated JSON file, set from Output File Name.
mimeTypeStringMIME type of the generated file, application/json.
fileSizeNumberSize of the generated JSON file in bytes.
barcodeTypeStringThe barcode type that was scanned for during this run, for example all or QR Code.
pagesStringThe page range that was scanned during this run.
Binary (data)BinaryThe JSON file containing decoded barcode values, under Binary Data Output Name (default data).

How Do I Set Up Read Barcode From PDF in n8n?

  1. Add PDF4me to your n8n workflow and set Action to Read Barcode From PDF.
  2. In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
  3. Set Input Data Type to Binary Data (default), Base64 String, or URL and fill the matching field.
  4. Set Barcode Type to All or a specific format such as QR Code or Code 128.
  5. Set Pages to all, a single page index, or a range like 1-5.
  6. Optionally change Output File Name from the default read_barcode_from_pdf.json and Binary Data Output Name from the default data.
  7. Optionally toggle Async for background processing on larger batches.
  8. Execute the node and route the decoded JSON output into the next workflow step.

Typical Setups

Workflow ExamplesCommon n8n workflow patterns using Read Barcode From PDF.
Shipping label data entry
  1. An email attachment trigger receives a shipping manifest PDF (Binary Data, property data).
  2. PDF4me Read Barcode From PDF runs with Barcode Type Code 128 to decode tracking numbers.
  3. A Set node parses the JSON output and writes tracking numbers into a logistics spreadsheet.
Inventory report reconciliation
  1. A scheduled trigger pulls the weekly inventory report PDF from a URL.
  2. PDF4me Read Barcode From PDF is configured with Input Data Type URL and Barcode Type All to catch mixed barcode formats.
  3. The decoded item codes are matched against the inventory database to flag discrepancies.
Compliance certificate verification
  1. A document management system uploads a compliance certificate PDF on approval.
  2. PDF4me Read Barcode From PDF scans page 1 only (Pages set to 0) for the embedded verification QR code.
  3. The decoded value is compared against an internal registry to confirm the certificate is genuine.

Practical Tips

Set Barcode Type when you know the format
All is thorough but scans for every supported format. Selecting the exact type, such as QR Code, speeds up processing on high-volume workflows.
Limit Pages on large documents
Scanning all pages of a long PDF is slower than targeting the specific page or range where the barcode actually lives.
Low-resolution scans can fail to decode
If a scanned PDF returns no barcode data, check the source scan resolution before assuming the barcode itself is invalid.
Enable Async for large batch jobs
Turning Async on lets PDF4me process larger or higher-volume barcode-reading jobs in the background instead of blocking the workflow synchronously.
Output is JSON, not the original PDF
Do not expect the node to return a modified PDF. It returns a separate JSON file with the decoded barcode values.
Multiple barcodes per page are all captured
The node is not limited to one barcode per page. Every detected barcode on the scanned pages is included in the JSON output.

Cheat Sheet

FieldValue
ActionRead Barcode From PDF
Input Data TypeBinary Data
Input Binary Fielddata
Output File Nameread_barcode_from_pdf.json
Barcode TypeAll
Pagesall
AsyncOn
Binary Data Output Namedata
CredentialsPDF4me API credential

Frequently Asked Questions

How do I read a barcode from a PDF in n8n?+
Add the PDF4me node, set Action to Read Barcode From PDF, provide the PDF as Binary Data, Base64, or URL, set Barcode Type and Pages, and execute. The node returns the decoded barcode data as a JSON file.
What barcode types does this action support?+
The node supports scanning for all barcode types at once with Barcode Type set to All, or a specific format such as QR Code, Code 128, Data Matrix, or PDF417 for faster, targeted extraction when you know the format in advance.
Can I read barcodes from a scanned PDF?+
Yes, as long as the scan resolution is high enough for the barcode bars or modules to be distinguishable. A low-resolution or heavily compressed scan can prevent accurate decoding.
Can I extract barcodes from only specific pages?+
Yes. Set Pages to a single page index, a comma-separated list, or a range such as 1-5 instead of all to limit scanning to the pages that actually contain barcodes.
What happens if a page has multiple barcodes?+
All detected barcodes on the scanned pages are included in the JSON output, the node is not limited to decoding a single barcode per page.

Same Task on Other Platforms

Use Cases

Document Processing and Data Extraction

  • Automatically extract product codes, serial numbers, and tracking information from invoices, shipping documents, and inventory reports to streamline data entry and reduce manual processing errors
  • Process scanned documents and digital archives by reading embedded barcodes to identify document types, batch numbers, and reference codes for automated document classification and routing
  • Extract customer information and order details from PDF receipts, invoices, and delivery notes by reading QR codes and barcodes that contain encoded customer and transaction data

Quality Control and Compliance Verification

  • Verify product authenticity and compliance by reading barcodes from product documentation, certificates, and regulatory forms to ensure products meet industry standards and regulatory requirements
  • Process batch tracking and quality control documents by extracting batch numbers, expiration dates, and manufacturing codes from barcodes embedded in production and quality assurance documents
  • Validate document integrity and authenticity by reading security barcodes and QR codes that contain verification information and tamper-proof identifiers for document security

Inventory Management and Asset Tracking

  • Process inventory reports and asset documentation by reading barcodes to extract item codes, location information, and status updates for automated inventory management and asset tracking systems
  • Extract tracking information from shipping labels, delivery documents, and logistics reports to enable real-time package tracking and delivery confirmation for supply chain management
  • Process equipment maintenance records and service documentation by reading barcodes that contain equipment IDs, maintenance schedules, and service history for preventive maintenance and asset management

Get Help