IRONSOFTWAREHOME
高效添加HTML内容
using IronPdf;
using IronPdf.Editing;
using System;

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

// Use TextStamper to stamp text with custom font onto pdf
TextStamper textStamper = new TextStamper("Hello World! Stamp One Here!")
{
    FontFamily = "Bungee Spice",
    UseGoogleFont = true,
    FontSize = 30,
};

// Use ImageStamper to stamp images onto pdf
Uri filepath = new Uri(@"C:\assets\logo.png"); // absolute path or URL
ImageStamper imageStamper = new ImageStamper(filepath)
{
    VerticalAlignment = VerticalAlignment.Top,
    MinWidth = new Length(20),
    MinHeight = new Length(20),
};

// Use BarcodeStamper to stamp QR code/Barcode onto pdf
BarcodeStamper barcodeStamper = new BarcodeStamper("IronPDF", BarcodeEncoding.Code128)
{
    Height=75,
    VerticalAlignment = VerticalAlignment.Bottom,
    HorizontalAlignment = HorizontalAlignment.Left,
};

Stamper[] stamps = { htmlStamper, textStamper, imageStamper, barcodeStamper };

var pdf = PdfDocument.FromFile("Unstamped.pdf");
pdf.ApplyMultipleStamps(stamps);
pdf.SaveAs("Stamped.pdf");
Imports IronPdf
Imports IronPdf.Editing
Imports System

' Use HtmlStamper to stamp Html onto pdf
Dim htmlStamper As New HtmlStamper("<h1>Html stamp</h1>") With {
    .VerticalOffset = New Length(-200, MeasurementUnit.Pixel),
    .HorizontalOffset = New Length(-200, MeasurementUnit.Pixel)
}

' Use TextStamper to stamp text with custom font onto pdf
Dim textStamper As New TextStamper("Hello World! Stamp One Here!") With {
    .FontFamily = "Bungee Spice",
    .UseGoogleFont = True,
    .FontSize = 30
}

' Use ImageStamper to stamp images onto pdf
Dim filepath As New Uri("C:\assets\logo.png") ' absolute path or URL
Dim imageStamper As New ImageStamper(filepath) With {
    .VerticalAlignment = VerticalAlignment.Top,
    .MinWidth = New Length(20),
    .MinHeight = New Length(20)
}

' Use BarcodeStamper to stamp QR code/Barcode onto pdf
Dim barcodeStamper As New BarcodeStamper("IronPDF", BarcodeEncoding.Code128) With {
    .Height = 75,
    .VerticalAlignment = VerticalAlignment.Bottom,
    .HorizontalAlignment = HorizontalAlignment.Left
}

Dim stamps As Stamper() = {htmlStamper, textStamper, imageStamper, barcodeStamper}

Dim pdf = PdfDocument.FromFile("Unstamped.pdf")
pdf.ApplyMultipleStamps(stamps)
pdf.SaveAs("Stamped.pdf")
NuGet Download
Install-Package IronPdf
高效添加HTML内容

高效添加HTML内容

在 GitHub 上查看

准备开始了吗?

Nuget Downloads 20,389,208版本:2026.7刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

bullet_checked无需信用卡或创建账户
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
预约您的免费现场演示
Booking Badge related to IronPDF Product Demo

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥
无需信用卡或创建账户