Case Study: See how Formable built DOCX redlining with Apryse in two months

Home

All Blogs

Why Barcode Extraction Misses Codes on Scanned PDFs, and How to Fix It

Published January 29, 2025

Updated November 18, 2026

Read time

6 min

email
linkedIn
twitter
link

Why Barcode Extraction Misses Codes on Scanned PDFs, and How to Fix It

Sanity Image

Isaac Maw

Technical Content Creator

When barcode extraction misses codes in a PDF, the cause is usually one of four things: a low-quality scan, a barcode type the reader wasn't looking for, codes rotated on the page, or a long file where the barcodes sit on only a few pages. The Apryse Server SDK Barcode Extraction Module has a setting for each.

Extraction profiles trade speed for tolerance: the low quality profile handles noisy, low-resolution scans, and the small barcodes profile finds unusually small codes. Search types and orientations narrow what the module looks for, and a page range keeps it to the pages that matter. Below, we run one poor-quality scanned batch through each setting and show what changed in the results and the processing time.

Sanity Image

This post covers Apryse Server SDK integration using C# on Windows or Linux, applied to barcodes inside scanned PDFs. It does not cover camera scanning, which the Scanbot SDK handles. For other languages or platforms, see the Server SDK get-started guide.

Picture a claims mailroom at the end of a long Friday. A stack of forms runs through the scanner, one sheet carries a coffee ring across the claim number, and your intake service logs a barcode count of zero for that page. A low-quality scan is the first suspect. Noise, low resolution, or a faded print turns thin bars into smudges, and the reader skips them.

A barcode type the reader isn’t looking for is the second cause. Extraction searches every supported barcode type by default, so this miss appears when your code narrows the search to certain groups and a batch arrives with a type outside them. A QR code on a delivery slip disappears when the search covers only linear codes.

Rotated codes are the third cause. Extraction searches every orientation by default, so the miss appears after you limit the search to horizontal codes and a clerk feeds a page sideways. Vertical and diagonal codes then fall outside the search. Skewed codes on pages that began as images are a related case with a different fix.

Long files are the fourth cause, and the cost shows up in time more than in misses. A long archive file with barcodes on only a few pages still gets read page by page. Every page without a code adds processing time, and the slower profiles multiply that cost.

Fix Missed Barcodes with the Apryse Barcode Extraction Module’s Profiles, Search Types, and Page Ranges

Copied to clipboard

The Apryse Barcode Extraction Module answers each cause with a setting on its options object: extraction profiles, search types, orientations, and page ranges. Barcode detection for low quality scans starts with the profile, because the profile sets the tradeoff between accuracy and speed.

The default profile suits vector graphics and average to good scans, and it reads fastest. The low quality source profile targets noisy or low-resolution scans at a slightly slower pace. To read small barcodes from documents, use the small barcodes profile. To detect skewed barcodes on pages that began as images, use the natural picture profile. Both of those read significantly slower than the default.

The Barcode Extraction Module is part of the Smart Data Extraction add-on license and installs as a separate module download from the base Server SDK. See the modules documentation for download and installation instructions.

Cause

Setting

Documented Cost

Noisy or low-resolution scan

Low quality source profile

Slightly slower than the default profile

Unusually small barcodes

Small barcodes profile

Significantly slower

Page that began as an image, or skewed codes

Natural picture profile

Significantly slower

Good scan or vector graphics

Default profile

Fastest

Barcode type outside the groups you set

Search types: include every group present in your documents

Narrower groups cut processing time

Vertical or diagonal codes missed

Orientations: horizontal, vertical, diagonal

Narrower orientations cut processing time

Long file with barcodes on a few pages

Page ranges such as “1-3,5,10-”

Pages outside the range are skipped

Orientation limits apply to linear-style groups, including Linear, PDF417, and Patch Code. If your mailroom splits batches with Patch Code separator sheets, the orientation setting covers those sheets too.

The implementation takes four steps: initialize the SDK, register the folder that holds the Barcode Extraction Module, set the options, and extract. Replace the placeholder license key and the file paths with your own.

License keys are confidential. Do not commit them to public repositories. Use environment variables or a secrets manager to inject your key at runtime.

AddResourceSearchPath takes the parent Lib folder, not the Windows or Linux Barcode folder inside it, so one path covers every installed module. The page range “1-3,5,10-” reads pages 1 to 3, page 5, and page 10 onward. An empty string, the default, reads every page. To use the low quality source profile instead, pass BarcodeOptions.BarcodeProfile.e_low_quality_source_profile to the same SetBarcodeProfile call.

Test Results on a Poor-Quality Scan

Copied to clipboard

Profile

Barcodes Found

Time per Run

Default

12/12

7.2 seconds

Low quality source

12/12

28.5 seconds

Small barcodes

12/12

6.3 seconds

Running Barcode Extraction on Poor Scans in Production

Copied to clipboard

Running barcode extraction on poor scans in production comes down to five decisions, and the first is when to rescan instead of retune.

Rescan when the barcode is missing from the image itself, such as cut off at the page edge or covered by a stamp: The Barcode Extraction Module reads the pixels the scan captured, so no profile recovers a barcode that never reached the page image. Send that sheet back to the scanner and keep profile changes for pages where the code is visible but unreadable.

Treat the slower profiles as a second pass: The small barcodes and natural picture profiles read significantly slower than the default, and the low quality source profile reads slightly slower. Run the default first. Then re-run only the pages that return fewer barcodes than expected, using a slower profile and a page range. Back in the Friday mailroom, one page gets the slow treatment, not the whole stack.

Store both output fields: A decoded barcode lands in the text field of the output JSON. A payload the module cannot decode arrives Base64-encoded in the data field, and your app decodes it. Keep the raw Base64 string next to any decoded value, because a failed decode is easier to debug when you still have the original bytes. For one consistent shape, the workflow docs describe a binary output format that returns every payload in the data field.

The Barcode Extraction Module reads PDFs, not image files: If your scanner emits TIFF, convert a scanned TIFF, then extract from the PDF it produces. Image-to-PDF conversion in the base Server SDK handles TIF and TIFF.

Compared with an open-source decoder, the choice is a license cost against engineering and maintenance time: The Barcode Extraction Module brings the license cost and the profile, search type, orientation, and page range controls in this post. An open-source decoder brings no license cost, and your team builds and maintains equivalent handling. To weigh the options side by side, compare barcode SDKs.

How to Check Whether Barcode Extraction Found Every Code in a Scanned PDF

Copied to clipboard

To check whether barcode extraction found every code in a scanned PDF, compare the output JSON against four things you know before the run. Barcode extraction for document automation needs a check that tells your app when a code is missing.

  • Count: Record how many barcodes each document type should hold, such as one on every claim form and one Patch Code on each batch cover sheet. After each run, count the barcode entries in the output JSON and compare. Route any document with a lower count to the second pass or to a rescan.
  • Type: Read the type of each entry in the JSON and compare it with the groups you set. A type you did not expect signals a document variant you did not plan for. A type you expected but never see signals a search that is too narrow or a page the extraction skipped.
  • Position and page: Read the location of each entry and confirm it falls on the page where you expect that barcode. This confirms a page range read the pages you meant.
  • Data field: Search the JSON for entries that carry a data field. Each one is a payload the module could not decode, stored as Base64 with the default output format. Decode the string in your app and validate it against the format you expect, such as a known prefix or length. An entry that fails validation goes to manual review.

Get Started with the Apryse Barcode Extraction Module

Copied to clipboard

The .NET get-started guide installs the base SDK from NuGet as PDFTron.NET.x64, and the Barcode workflow docs cover the Barcode Extraction Module download and setup. The BarcodeTest sample shows page ranges, search types, and orientations in C#. For a longer walkthrough, see how to extract barcodes from PDFs in C#.

Try it on your own documents: get a trial key at dev.apryse.com, run the BarcodeTest sample against one of your own poorest scans, and check the type, position, and value of each barcode in the JSON. If you have any questions, the Apryse Community is a great place to get answers.