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
Private 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
Private textStamper As New TextStamper("Hello World! Stamp One Here!") With {
.FontFamily = "Bungee Spice",
.UseGoogleFont = True,
.FontSize = 30
}
' Use ImageStamper to stamp images onto pdf
Private filepath As New Uri("C:\assets\logo.png") ' absolute path or URL
Private 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
Private barcodeStamper As New BarcodeStamper("IronPDF", BarcodeEncoding.Code128) With {
.Height=75,
.VerticalAlignment = VerticalAlignment.Bottom,
.HorizontalAlignment = HorizontalAlignment.Left
}
Private stamps() As Stamper = { htmlStamper, textStamper, imageStamper, barcodeStamper }
Private pdf = PdfDocument.FromFile("Unstamped.pdf")
pdf.ApplyMultipleStamps(stamps)
pdf.SaveAs("Stamped.pdf")
Install-Package IronPdf
Ajout efficace de contenu HTML
IronPdf.PdfDocument.ApplyMultipleStamps permet aux développeurs d'apposer rapidement plusieurs types de tampons sur une ou plusieurs pages d'un PDF. Pour en savoir plus sur cette fonctionnalité et d'autres capacités d'IronPDF, visitez la Page Produit d'IronPDF pour des informations détaillées.
Votre clé d'essai devrait être dans l'e-mail. Si elle ne l'est pas, veuillez contacter support@ironsoftware.com
Rejoignez les millions d'ingénieurs qui ont essayé IronPDF
Votre clé d'essai devrait être dans l'e-mail. Si elle ne l'est pas, veuillez contacter support@ironsoftware.com
Parlez à l'Équipe de Vente
Réservez une Consultation sans Engagement
Comment pouvons-nous vous aider :
Consultez votre flux de travail et vos points de douleur
Voyez comment d'autres entreprises répondent à leurs besoins en matière de documents .NET
Toutes vos questions reçoivent une réponse pour vous assurer d'avoir toutes les informations nécessaires. (Aucun engagement de quelque nature que ce soit.)
Obtenez un devis personnalisé pour les besoins de votre projet