PDF Guides

How to Add Unique QR Codes or Barcodes to Every Page of a PDF

Number and track documents with a QR code or Code 128 barcode on each page: content templates, serial numbers, sizes, placement and test scanning.

Saizul Amin
Saizul Amin28 Oct 2026 · 3 min read
How to Add Unique QR Codes or Barcodes to Every Page of a PDF

How to Add Unique QR Codes or Barcodes to Every Page of a PDF

Paper still moves through offices, schools, warehouses and courts, and it often comes back to be scanned. A machine-readable code on each page lets software recognise which document and which page it is, sort it automatically and link it to a record. This guide explains how to choose and place codes and how to stamp them with the PDF QR and Barcode Stamper.

QR code or barcode?

  • QR codes are square, hold up to a few thousand characters and can be read by any phone camera. Use them for web links, longer IDs and anything people will scan with a phone.
  • Code 128 barcodes are the familiar stripes. They hold short text, scan instantly with handheld laser scanners and fit in narrow spaces, such as a document margin. Warehouses, libraries and mailrooms use them.

What to put in the code

A code is only useful if its content can be looked up. Good patterns:

  • A serial number: DOC-000101, DOC-000102 and so on, with the serial recorded in a spreadsheet.
  • File and page: contract-2026-p3, which identifies a page without any database.
  • A link: https://example.com/track?id=101, which opens a record on a phone.

The tool fills tokens for each page: {n} for the serial, {page} and {pages}, {file} and {date}. Padding such as {n:6} keeps codes the same length, which looks tidier and sorts correctly.

Sizing and placement

  • QR codes should be at least 15 to 20 mm wide for phone scanning; larger for long links or scanning at a distance.
  • Barcodes need width proportional to their length; 40 to 60 mm suits typical IDs.
  • Leave a white margin around every code, called the quiet zone.
  • Avoid placing codes over text or dark backgrounds.

Corners are usual. For forms, a fixed spot where scanners expect the code works best; place it once by clicking.

Error correction

QR codes include extra data so they still scan when partly damaged. Medium error correction (about 15 percent) suits most documents. Choose high for pages that will be folded, stamped or handled roughly.

Per page or per file

A code on every page lets a scanning system put loose pages back in order. A code only on the first page, with the serial running across a batch of files, identifies whole documents, such as one code per exam script.

Keeping a list

The tool writes a CSV of every page and its code. Import it into a spreadsheet or document system so each code can be matched to its record later.

Test before you print

Print one page, then scan the code with a phone and, for barcodes, with the actual scanner. Check that the content matches the list. Low printer quality, toner-saving modes and glossy paper can all affect scanning.

Example

A distribution company prints 40 delivery notes per run. Each gets a Code 128 barcode DN-000101 to DN-000140 in the top right corner, 45 mm wide, with the text below. When signed notes come back, a handheld scanner reads each code and the system marks the delivery complete.

Codes on exam scripts

Schools that scan marked papers back in can put one code per student script on the first page, with the serial running across the batch. After scanning, each file is matched to a student by its code instead of by reading names, which is faster and avoids mistakes with similar names.

Limits and privacy

The codes follow the QR and Code 128 standards, but scanning depends on print size and quality. Barcodes hold only basic characters. Do not put personal data in codes that strangers might scan. Everything is generated in your browser.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages