IRONSOFTWAREHOME

How to Stamp QR Codes into PDF Pages

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Embed QR codes directly into your PDF documents to instantly watermark pages or add dynamic information like URLs, tracking IDs, or digital signatures.

Adding a QR code to an existing PDF is a common requirement in document workflows. Invoice PDFs can carry a QR code linking to a payment portal. Government records can embed a verification code. Event tickets can include a scannable ID without restructuring the entire document layout. IronQR makes this straightforward: generate a QR code with QrWriter.Write and stamp it to any page at any position with a single call to StampToExistingPdfPage.

This guide demonstrates how to embed QR codes into existing PDF files using the IronQR library. Developers who have not yet generated a QR code should start with the Create QR Code as Image guide first.

Quickstart: Stamp a QR Code into a PDF

Generate a QR code and stamp it onto an existing PDF page at a specific position.

  1. 1Install IronQR with NuGet Package Manager

    PM > Install-Package IronQR

  2. 2Copy and run this code snippet.

    QrCode myQr = QrWriter.Write("https://example.com");
    myQr.StampToExistingPdfPage("document.pdf", 505, 20, 0, "");
    C#
  3. 3Deploy to test on your live environment

    Start using IronQR in your project today with a free trial
    arrow pointer

Stamping a QR Code onto a PDF Page

To embed a QR code into an existing PDF, generate the QR code with QrWriter.Write, then call StampToExistingPdfPage on the resulting QrCode to place it at precise coordinates. The x and y values are in PDF points (an A4 page is 595 × 842 pts), the pageIndex is zero-based, and the final parameter is the PDF password (pass an empty string for unencrypted files).

Input

The QR code below encodes https://ironsoftware.com and will be stamped onto the PDF.

QR code bitmap encoding https://ironsoftware.com
using IronQr;

// Generate the QR code
QrCode myQr = QrWriter.Write("hello world");

// Stamp the QR code at the top-right corner of page 1 (zero-based pageIndex)
// A4 page is 595 x 842 PDF points; x:505, y:20 places the QR near the top-right.
// The final parameter is the PDF password ("" for unencrypted files).
myQr.StampToExistingPdfPage("sample.pdf", 505, 20, 0, "");
C#

The QR code is written directly into the PDF file at the specified path.

Output

The QR code is stamped at the top-right corner of page 1 at coordinates (505, 20).


Controlling Position and Page Number

The x and y parameters are in PDF points measured from the top-left corner of the page. Increasing x moves the stamp to the right; increasing y moves it down. The pageIndex parameter is zero-based, so pageIndex: 0 targets the first page.

The following example stamps two QR codes on different pages - a verification link at the top-right of page 1 and a support link at the bottom-left of page 2:

Input

The two QR codes below encode the verification and support URLs that will be stamped onto separate pages.

QR code encoding https://ironsoftware.com/verify

Page 1 input - QR code for ironsoftware.com/verify

QR code encoding https://ironsoftware.com/support

Page 2 input - QR code for ironsoftware.com/support

using IronQr;

// Page 1: stamp a verification QR at the top-right corner (pageIndex 0)
QrCode qrVerify = QrWriter.Write("https://ironsoftware.com/verify");
qrVerify.StampToExistingPdfPage("document.pdf", 505, 20, 0, "");

// Page 2: stamp a support QR at the bottom-left corner (pageIndex 1)
QrCode qrSupport = QrWriter.Write("https://ironsoftware.com/support");
qrSupport.StampToExistingPdfPage("document.pdf", 20, 752, 1, "");
C#
Please note: PDF points are the unit of measurement for coordinates on a PDF page. An A4 page is 595 pts wide and 842 pts tall, with (0, 0) at the top-left corner. To place a 70 pt QR code with a 20 pt margin from the top-right edge, subtract the QR size and margin from the page width: x = 595 − 70 − 20 = 505, and keep y = 20 to sit near the top. For the bottom-left corner, x = 20 and subtract from the page height: y = 842 − 70 − 20 = 752.

Output

Each QR code is placed at its respective corner - verification at the top-right of page 1, support at the bottom-left of page 2.


Use Cases

  • Invoice payment link: Encode a payment portal URL and stamp it at the top-right corner of page 1 so customers can scan and pay instantly.
  • Document verification: Encode a record ID or hash and stamp it at the bottom of every page to allow recipients to verify authenticity.
  • Event tickets: Encode an attendee ID or booking reference and stamp it at the centre of page 1 for easy scanning at entry.
  • Product labels: Encode a product URL or serial number and stamp it at the top-left or bottom-right corner for quick inventory lookups.
  • Legal records: Encode a case number or filing reference and stamp it in the footer of each page for traceability.

For more control over the QR code before stamping, such as setting error correction levels or adjusting the output size, configure a QrOptions object and pass it to QrWriter.Write before calling StampToExistingPdfPage.

For more QR code generation patterns, explore the C# QR Code Generator tutorial and the full IronQR feature set.

Frequently Asked Questions

How can I stamp a QR code onto an existing PDF using C#?

You can stamp a QR code onto an existing PDF using IronQR by generating the QR code with `QrWriter.Write` and then calling `StampToExistingPdfPage`, providing the PDF path, x/y coordinates, and page index.

What is the purpose of stamping QR codes in PDF documents?

Stamping QR codes in PDF documents can serve various purposes such as watermarking, linking to a payment portal in invoices, providing verification codes in government records, or including scannable IDs in event tickets.

Can I control the position of the QR code on the PDF page?

Yes, you can control the position by specifying x and y coordinates in PDF points when calling `StampToExistingPdfPage`. The method allows you to place the QR code precisely where needed on the page.

What are PDF points and how do they affect QR code positioning?

PDF points are units of measurement used for coordinates on a PDF page. For example, an A4 page is 595 points wide and 842 points tall, with (0, 0) at the top-left corner. You use these points to determine the QR code's position.

Is it possible to stamp multiple QR codes on different pages of a PDF?

Yes, you can stamp multiple QR codes on different pages by calling `StampToExistingPdfPage` for each QR code with different `pageIndex` values specifying the page number.

How do I handle PDF files with passwords when stamping QR codes?

If a PDF file is password-protected, provide the password as the final parameter in the `StampToExistingPdfPage` method. For unencrypted files, pass an empty string.

Can I customize the QR code before stamping it into a PDF?

Yes, you can customize the QR code by configuring a `QrOptions` object with settings such as error correction levels and output size, then passing it to `QrWriter.Write` before using `StampToExistingPdfPage`.

What are common use cases for stamping QR codes into PDFs?

Common use cases include embedding payment links in invoices, document verification with record IDs, event ticket scanning with attendee IDs, product labels with serial numbers, and legal record traceability with case numbers.

Where can I find more information on generating QR codes with IronQR?

For more information, you can explore the [C# QR Code Generator tutorial](https://ironsoftware.com/csharp/qr/tutorials/csharp-qr-code-generator/) and the full [IronQR feature set](https://ironsoftware.com/csharp/qr/features/).

What should I do if I haven't generated a QR code yet?

If you haven't generated a QR code, start with the [Create QR Code as Image](/csharp/qr/how-to/create-qr-code-image/) guide, which will walk you through the steps to generate a QR code using IronQR.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 74,386Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronQR
nuget.org/packages/IronQR/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronQR"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronQR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronQR.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required