Editar PDFs
Aproveite nossos inúmeros recursos que se baseiam em arquivos PDF existentes para finalizá-los em arquivos de saída perfeitos.
Edite objetos PDF com precisão.
Traduzir objetos PDF
Mova e posicione objetos PDF, como imagens, texto e formas, com precisão, garantindo que os elementos estejam alinhados e posicionados corretamente dentro do documento.
Aprenda como acessar objetos DOM de um PDF.using IronPdf;
using System.Drawing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("Test");
// Access DOM Objects
var objects = pdf.Pages.First().ObjectModel.TextObjects.First();
// Translate by 100 points right and 100 points down
objects.Translate = new System.Drawing.PointF(100,100);Imports IronPdf
Imports System.Drawing
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("Test")
' Access DOM Objects
Dim objects = pdf.Pages.First().ObjectModel.TextObjects.First()
' Translate by 100 points right and 100 points down
objects.Translate = New System.Drawing.PointF(100, 100)Objetos PDF em escala
Redimensione objetos em PDF para atender às suas necessidades de design. Ajuste a escala de imagens, texto ou outros elementos para obter a aparência desejada sem perder qualidade.
Aprenda como: dimensionar objetos DOM de PDFusing IronSoftware;
using System.Drawing; // Required for PointF
// Create a PDF from a URL using a PNG image
string html = @"<img src='https://example.com/logo.png'>";
ChromePdfRenderer renderer = new ChromePdfRenderer();
// Render HTML to PDF
PdfDocument pdf = renderer.RenderHtmlAsPdf(html);
// Access the first image object on the first page
ImageObject image = pdf.Pages.First().ObjectModel.ImageObjects.FirstOrDefault();
// To scale the image to 150% of its original size uniformly
image.Scale = new System.Drawing.PointF(1.5f, 1.5f);
// Save the PDF with the scaled image
pdf.SaveAs("scaled_image.pdf");Imports IronSoftware
Imports System.Drawing ' Required for PointF
' Create a PDF from a URL using a PNG image
Dim html As String = "<img src='https://example.com/logo.png'>"
Dim renderer As New ChromePdfRenderer()
' Render HTML to PDF
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf(html)
' Access the first image object on the first page
Dim image As ImageObject = pdf.Pages.First().ObjectModel.ImageObjects.FirstOrDefault()
' To scale the image to 150% of its original size uniformly
image.Scale = New System.Drawing.PointF(1.5F, 1.5F)
' Save the PDF with the scaled image
pdf.SaveAs("scaled_image.pdf")Remover objetos PDF
Exclua objetos PDF desnecessários ou indesejados para limpar e simplificar o conteúdo do seu documento.
Aprenda como remover objetos DOM de um PDF .using IronSoftware;
using IronSoftware.Pdfium.Dom;
using System.Linq;
// Load a PDF file
PdfDocument pdf = PdfDocument.FromFile("sampleObjectsWithImages.pdf");
// Access DOM Objects
IPdfPageObjectModel objects = pdf.Pages.First().ObjectModel;
// Remove first image
objects.ImageObjects.RemoveAt(0);Imports IronSoftware
Imports IronSoftware.Pdfium.Dom
Imports System.Linq
' Load a PDF file
Dim pdf As PdfDocument = PdfDocument.FromFile("sampleObjectsWithImages.pdf")
' Access DOM Objects
Dim objects As IPdfPageObjectModel = pdf.Pages.First().ObjectModel
' Remove first image
objects.ImageObjects.RemoveAt(0)
Modifique vários segmentos de texto simultaneamente.
Extrair texto e imagens de PDF
Extraia texto e imagens de seus arquivos PDF, permitindo a fácil reutilização ou reaproveitamento do conteúdo para outros documentos ou aplicativos.
Aprenda como: extrair texto e imagensusing IronPdf;
using System.IO;
PdfDocument pdf = PdfDocument.FromFile("sample.pdf");
// Extract text
string text = pdf.ExtractAllText();
// Export the extracted text to a text file
File.WriteAllText("extractedText.txt", text);Imports IronPdf
Imports System.IO
Dim pdf As PdfDocument = PdfDocument.FromFile("sample.pdf")
' Extract text
Dim text As String = pdf.ExtractAllText()
' Export the extracted text to a text file
File.WriteAllText("extractedText.txt", text)Redigir texto
Proteja informações confidenciais ocultando texto em seu PDF. Remova ou oculte texto permanentemente para manter a confidencialidade do documento.
Aprenda como: redigir textousing IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric");
pdf.SaveAs("redacted.pdf");Imports IronPdf
Dim pdf As PdfDocument = PdfDocument.FromFile("novel.pdf")
' Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric")
pdf.SaveAs("redacted.pdf")Localizar e substituir texto
Encontre e substitua texto rapidamente em todo o seu documento PDF, tornando as atualizações e correções de conteúdo eficientes e sem erros.
Aprenda como: localizar e substituir textousing IronPdf;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>.NET6</h1>");
string oldText = ".NET6";
string newText = ".NET7";
// Replace text on all pages
pdf.ReplaceTextOnAllPages(oldText, newText);
pdf.SaveAs("replaceText.pdf");Imports IronPdf
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>.NET6</h1>")
Dim oldText As String = ".NET6"
Dim newText As String = ".NET7"
' Replace text on all pages
pdf.ReplaceTextOnAllPages(oldText, newText)
pdf.SaveAs("replaceText.pdf")
Defenda melhorias robustas no design de PDFs.
Anotações
Adicione anotações aos seus arquivos PDF, como comentários, destaques ou notas, para fornecer contexto adicional ou enfatizar seções específicas.
Aprenda como: controlar anotações em PDFusing IronPdf;
using IronPdf.Annotations;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Annotation</h1>");
// Create a PDF annotation object on a specified page index
TextAnnotation annotation = new TextAnnotation(0)
{
Title = "This is the title",
Contents = "This is the long 'sticky note' comment content...",
X = 50,
Y = 700,
};
// Add the annotation
pdf.Annotations.Add(annotation);
pdf.SaveAs("annotation.pdf");Imports IronPdf
Imports IronPdf.Annotations
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Annotation</h1>")
' Create a PDF annotation object on a specified page index
Dim annotation As New TextAnnotation(0) With {
.Title = "This is the title",
.Contents = "This is the long 'sticky note' comment content...",
.X = 50,
.Y = 700
}
' Add the annotation
pdf.Annotations.Add(annotation)
pdf.SaveAs("annotation.pdf")Textos e imagens de selos
Aplique carimbos de texto ou imagem personalizados aos seus PDFs para fins de identidade visual, aprovações ou marcações especiais, aprimorando o profissionalismo e a clareza do documento.
Aprenda como: carimbar textos e imagensusing IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");Imports IronPdf
Imports IronPdf.Editing
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
' Create text stamper
Dim textStamper As New TextStamper() With {
.Text = "Text Stamper!",
.FontFamily = "Bungee Spice",
.UseGoogleFont = True,
.FontSize = 30,
.IsBold = True,
.IsItalic = True,
.VerticalAlignment = VerticalAlignment.Top
}
' Stamp the text stamper
pdf.ApplyStamp(textStamper)
pdf.SaveAs("stampText.pdf")Marca d'água personalizada
Crie e aplique marcas d'água personalizadas aos seus documentos PDF para marcá-los como rascunhos, confidenciais ou para adicionar elementos de identidade visual.
Aprenda como criar uma marca d'água.using IronPdf;
string watermarkHtml = @"
<img src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'>
";
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>");
// Apply watermark
pdf.ApplyWatermark(watermarkHtml);
pdf.SaveAs("watermark.pdf");Imports IronPdf
Dim watermarkHtml As String = "
<img src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'>
"
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>")
' Apply watermark
pdf.ApplyWatermark(watermarkHtml)
pdf.SaveAs("watermark.pdf")Desenhe texto e bitmap
Adicione texto personalizado e imagens bitmap aos seus PDFs, o que lhe dá a liberdade de incluir elementos de conteúdo exclusivos, adaptados às necessidades do seu documento.
Aprenda a desenhar texto e bitmaps.using IronPdf;
using IronSoftware.Drawing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>testing</h1>");
// Draw text on PDF
pdf.DrawText("Some text", FontTypes.TimesNewRoman.Name, FontSize: 12, PageIndex: 0, X: 100, Y: 100, Color.Black, Rotation: 0);
// Open the image from file
AnyBitmap bitmap = AnyBitmap.FromFile("ironSoftware.png");
// Draw the bitmp on PDF
pdf.DrawBitmap(bitmap, 0, 50, 250, 500, 300);Imports IronPdf
Imports IronSoftware.Drawing
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>testing</h1>")
' Draw text on PDF
pdf.DrawText("Some text", FontTypes.TimesNewRoman.Name, 12, 0, 100, 100, Color.Black, 0)
' Open the image from file
Dim bitmap As AnyBitmap = AnyBitmap.FromFile("ironSoftware.png")
' Draw the bitmap on PDF
pdf.DrawBitmap(bitmap, 0, 50, 250, 500, 300)Desenhe uma linha e um retângulo.
Insira linhas e retângulos em seu PDF para estruturar o conteúdo, enfatizar seções ou criar diagramas.
Aprenda como: converter retângulousing IronPdf;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>testing</h1>");
// Configure the required parameters
int pageIndex = 0;
var start = new IronSoftware.Drawing.PointF(200,150);
var end = new IronSoftware.Drawing.PointF(1000,150);
int width = 10;
var color = new IronSoftware.Drawing.Color("#000000");
// Draw line on PDF
pdf.DrawLine(pageIndex, start, end, width, color);
pdf.SaveAs("drawLine.pdf");Imports IronPdf
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>testing</h1>")
' Configure the required parameters
Dim pageIndex As Integer = 0
Dim start = New IronSoftware.Drawing.PointF(200, 150)
Dim [end] = New IronSoftware.Drawing.PointF(1000, 150)
Dim width As Integer = 10
Dim color = New IronSoftware.Drawing.Color("#000000")
' Draw line on PDF
pdf.DrawLine(pageIndex, start, [end], width, color)
pdf.SaveAs("drawLine.pdf")Adicionar cabeçalhos/rodapés
Incorpore cabeçalhos e rodapés personalizados em seus PDFs com texto, imagens ou elementos HTML, criando uma aparência consistente e profissional.
Aprenda como adicionar cabeçalhos/rodapésusing IronPdf;
// Instantiate renderer and create PDF
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>");
// Create text header
TextHeaderFooter textHeader = new TextHeaderFooter
{
CenterText = "This is the header!",
};
// Add text header to the PDF
pdf.AddTextHeaders(textHeader);
pdf.SaveAs("addTextHeaderFooter.pdf");Imports IronPdf
' Instantiate renderer and create PDF
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>")
' Create text header
Dim textHeader As New TextHeaderFooter With {
.CenterText = "This is the header!"
}
' Add text header to the PDF
pdf.AddTextHeaders(textHeader)
pdf.SaveAs("addTextHeaderFooter.pdf")Adicionar números de página
Insira números de página no seu PDF, posicionando-os de acordo com suas preferências de formatação para manter uma estrutura de documento organizada.
Aprenda como: adicionar números de páginausing IronPdf;
// Create text header
TextHeaderFooter textHeader = new TextHeaderFooter()
{
CenterText = "{page} of {total-pages}"
};
// Render a new PDF
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>");
// Add header and footer
pdf.AddTextHeaders(textHeader);
pdf.SaveAs("pdfWithPageNumber.pdf");Imports IronPdf
' Create text header
Dim textHeader As New TextHeaderFooter() With {
.CenterText = "{page} of {total-pages}"
}
' Render a new PDF
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>")
' Add header and footer
pdf.AddTextHeaders(textHeader)
pdf.SaveAs("pdfWithPageNumber.pdf")Plano de fundo e primeiro plano
Controle os elementos de fundo e de primeiro plano em seu PDF para destacar conteúdo específico, melhorar a legibilidade ou adicionar apelo visual.
Aprenda como adicionar plano de fundo e primeiro plano.using IronPdf;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Main HTML content</h1>");
// Render background
PdfDocument background = renderer.RenderHtmlAsPdf("<body style='background-color: cyan;'></body>");
// Render foreground
PdfDocument foreground = renderer.RenderHtmlAsPdf("<h1 style='transform: rotate(-45deg); opacity: 50%;'>Overlay Watermark</h1>");
// Add background
pdf.AddBackgroundPdf(background);
// Overlay foreground
pdf.AddForegroundOverlayPdf(foreground);Imports IronPdf
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Main HTML content</h1>")
' Render background
Dim background As PdfDocument = renderer.RenderHtmlAsPdf("<body style='background-color: cyan;'></body>")
' Render foreground
Dim foreground As PdfDocument = renderer.RenderHtmlAsPdf("<h1 style='transform: rotate(-45deg); opacity: 50%;'>Overlay Watermark</h1>")
' Add background
pdf.AddBackgroundPdf(background)
' Overlay foreground
pdf.AddForegroundOverlayPdf(foreground)Pronto para começar?
Nuget Downloads 20,756,830|Versão:2026.7recém-lançado