IRONSOFTWAREHOME
Adding HTML Content Efficiently
from ironpdf import *

# Use HtmlStamper to stamp Html onto pdf
htmlStamper = HtmlStamper("<h1>Html stamp</h1>")
htmlStamper.VerticalOffset = Length(-200, MeasurementUnit.Pixel)
htmlStamper.HorizontalOffset = Length(-200, MeasurementUnit.Pixel)

# Use TextStamper to stamp text with custom font onto pdf
textStamper = TextStamper("Hello World! Stamp One Here!")
textStamper.FontFamily = "Bungee Spice"
textStamper.UseGoogleFont = True
textStamper.FontSize = 30

# Use ImageStamper to stamp images onto pdf
file_path = r'C:\Users\logo.png'
imageStamper = ImageStamper(file_path)
imageStamper.VerticalAlignment = VerticalAlignment.Top
imageStamper.MinWidth = Length(20)
imageStamper.MinHeight = Length(20)

# Use BarcodeStamper to stamp QR code/Barcode onto pdf
barcodeStamper = BarcodeStamper("IronPDF", BarcodeEncoding.Code39)
barcodeStamper.MaxHeight = Length(5)
barcodeStamper.VerticalAlignment = VerticalAlignment.Bottom
barcodeStamper.HorizontalAlignment = HorizontalAlignment.Left

stamps_list = List[Stamper]()
stamps_list.Add(htmlStamper)
stamps_list.Add(textStamper)
stamps_list.Add(imageStamper)
stamps_list.Add(barcodeStamper)

pdf = PdfDocument.FromFile("Unstamped.pdf")
pdf.ApplyMultipleStamps(stamps_list)
pdf.SaveAs("Stamped.pdf")
pip install ironpdf
Adding HTML Content Efficiently

Adding HTML Content Efficiently

IronPDF for Python supports applying multiple different stamps - HTML, text, image, and barcode - to a PDF document in a single operation using ApplyMultipleStamps.

Getting Started

Create individual stamper objects for each stamp type, add them to a List[Stamper] collection, then call ApplyMultipleStamps on a PdfDocument to apply all stamps at once.

Understanding the Code

  • HtmlStamper(html): Stamps an HTML fragment onto the PDF. Supports VerticalOffset and HorizontalOffset to fine-tune position using pixel-based Length values.
  • TextStamper(text): Stamps plain text with custom font settings. Set UseGoogleFont = True and FontFamily to use any Google Font by name.
  • ImageStamper(path): Stamps an image file onto the PDF. Use MinWidth and MinHeight to control the stamp dimensions.
  • BarcodeStamper(value, encoding): Generates and stamps a barcode or QR code. BarcodeEncoding.Code39 produces a standard Code 39 barcode.
  • List[Stamper](): A typed collection that holds stamper objects of mixed types.
  • ApplyMultipleStamps(stamps_list): Applies all stamps in the list to every page of the document in a single efficient pass.

Alignment and Positioning

Each stamper supports VerticalAlignment, HorizontalAlignment, VerticalOffset, and HorizontalOffset for precise placement on the page.

Learn to stamp PDFs with IronPDF for Python!

Ready to Get Started?

Version:2026.9just 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.

OR
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
Python Module Download for PDF
Install with pip

Version: 2026.9

  1. Download and install Python 3.7+.
  2. Install pip from pypi.org if it isn't installed already.
  3. Execute the above command in the terminal.
Python PDF Module
Download Module

Version: 2026.9

Manually install into your project

  1. Download the package
  2. Run this command from the terminal
    pip install ironpdf-2026.9-py37-none-win_amd64.whi

Licenses from $999