IRONSOFTWAREHOME
Stamp QR Code to PDF
using IronQr;
using IronPdf;
using IronSoftware.Drawing;

// Generate QR code and save as bitmap
AnyBitmap qrBitmap = QrWriter.Write("hello world").Save();

// Load an existing PDF document
PdfDocument pdf = PdfDocument.FromFile("sample.pdf");

// Stamp the QR code onto the first page at position x=505, y=20 (top-right corner)
pdf.DrawBitmap(qrBitmap, PageIndex: 0, X: 505, Y: 20, DesiredWidth: 70, DesiredHeight: 70, PixelFormat: PixelFormat.Format32bppArgb, IgnorePageRotation: false);

// Save the modified PDF
pdf.SaveAs("output.pdf");
Imports IronQr
Imports IronPdf
Imports IronSoftware.Drawing

' Generate QR code and save as bitmap
Dim qrBitmap As AnyBitmap = QrWriter.Write("hello world").Save()

' Load an existing PDF document
Dim pdf As PdfDocument = PdfDocument.FromFile("sample.pdf")

' Stamp the QR code onto the first page at position x=505, y=20 (top-right corner)
pdf.DrawBitmap(qrBitmap, PageIndex:=0, X:=505, Y:=20, DesiredWidth:=70, DesiredHeight:=70, PixelFormat:=PixelFormat.Format32bppArgb, IgnorePageRotation:=False)

' Save the modified PDF
pdf.SaveAs("output.pdf")
NuGet Download
PM > Install-Package IronQR
Stamp QR Code to PDF

Stamp QR Code to PDF

Stamping a QR code directly onto an existing PDF page embeds scannable information without restructuring the document. IronQR handles this in three steps: create a QrWriter, generate the QR code with Write, then call StampToExistingPdfPage with the PDF path and the x and y coordinates that position the stamp on the chosen page.

3-step guide for stamping a QR code into a PDF

  • QrWriter writer = new QrWriter();
  • QrCode myQr = writer.Write("hello world");
  • myQr.StampToExistingPdfPage("sample.pdf", 505, 20, 0, "");

Code Explanation

QrWriter.Write generates the QR code and returns a QrCode. Calling StampToExistingPdfPage on that QrCode stamps it directly onto the source PDF, taking the PDF path, the x and y position, the zero-based pageIndex, and the PDF password (empty here). The x and y values position the stamp on the page - 505, 20 places it near the top-right corner.

Common use cases include embedding payment links on invoices, adding verification codes to legal documents, and placing tracking IDs on event tickets. For size-to-data tradeoffs, configure a QrOptions object with a different error correction level and pass it to QrWriter.Write.

Explore How to Stamp QR Codes into PDF Pages with IronQR.

Ready to Get Started?

Nuget Downloads 76,271Version:2026.10just released

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 IronQR
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
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.10

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.10

  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