The Apryse Summer 2026 Release: OUT NOW

Home

All Blogs

Read Barcodes and Convert to Searchable PDF with C++ using Apryse SDK

Published June 24, 2025

Updated August 06, 2026

Read time

5 min

email
linkedIn
twitter
link

Read Barcodes and Convert to Searchable PDF with C++ using Apryse SDK

Sanity Image

Apryse

Sanity Image

Barcodes are a ubiquitous tool for handling data in many industries, and Apryse SDK provides the tools you need to work with them. In this sample code, check out how to read barcodes and convert to searchable PDF for use in other workflows.

For this article we have used C++, but Apryse can be used with many other programming languages. OCR is provided by an add-on module that runs on Linux, Windows and macOS, and Barcode is provided by a separate add-on module and is available for Linux and Windows only.

Sample code

Copied to clipboard

The sample code detects barcodes within a PDF and extracts them into a JSON file. Next, it converts a *.TIFF into a PDF with a searchable text layer. OCR can also work with many other image types.

For full sample code check out the "Barcode Extraction sample" and "OCR sample" in the Apryse documentation.

PDFNet needs to be initialized with a license key before it is used, and should be terminated when you have finished with it.

Keep your license key confidential
License keys are uniquely generated and strictly confidential. Don't publish or store them in any public location, including public GitHub repositories.
You can get a trial license key for testing purposes, but you will need a commercial license in a production environment.

In this sample the barcodes were extracted from a PDF. If you have an image then you easily convert an image into a PDF.

Next Steps

Copied to clipboard

For more features and functionality of Apryse barcode recognition, check out the documentation, or contact us with any questions.