Skip to footer content

Edit PDFs

Leverage our countless features that build on existing PDF files to finalize them into perfect output files.

Icon Main related to Edit PDFs
Edit PDF Objects with Precision

1

Translate PDF Objects

Move and position PDF objects such as images, text, and shapes with precision, ensuring that elements are correctly aligned and placed within your document.

Learn how to:access PDF DOM objects
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);
C#
2

Scale PDF Objects

Resize PDF objects to meet your design requirements. Scale images, text, or other elements to achieve the desired appearance without losing quality.

Learn how to:scale PDF DOM objects
using 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");
C#
3

Remove PDF Objects

Delete unnecessary or unwanted PDF objects from your document to clean up and streamline your content.

Learn how to:remove PDF DOM objects
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);
C#

Icon Main related to Edit PDFs
Modify Multiple Text Segments at Once

1

Extract PDF Text & Images

Extract text and images from your PDF files, enabling easy reuse or repurposing of content for other documents or applications.

Learn how to:extract text and images
using 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);
C#
2

Redact Text

Protect sensitive information by redacting text within your PDF. Permanently remove or obscure text to maintain document confidentiality.

Learn how to:redact text
using IronPdf;

PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric");
pdf.SaveAs("redacted.pdf");
C#
3

Find and Replace Text

Quickly find and replace text throughout your entire PDF document, making content updates and corrections efficient and error-free.

Learn how to:find and replace text
using 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");
C#

Icon Main related to Edit PDFs
Advocate Robust PDF Design Enhancements

1

Annotations

Add annotations to your PDF files, such as comments, highlights, or notes, to provide additional context or emphasize specific sections.

Learn how to:control PDF annotations
using 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");
C#
2

Stamp Texts & Images

Apply custom text or image stamps to your PDFs for branding, approvals, or special markings, enhancing document professionalism and clarity.

Learn how to:stamp texts and images
using 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");
C#
3

Custom Watermark

Create and apply custom watermarks to your PDF documents to mark them as drafts, confidential, or to add branding elements.

Learn how to:create watermark
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");
C#
4

Draw Text & Bitmap

Add custom text and bitmap images to your PDFs, giving you the freedom to include unique content elements tailored to your document's needs.

Learn how to:draw text and bitmap
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);
C#
5

Draw Line and Rectangle

Insert lines and rectangles into your PDF to structure content, emphasize sections, or create diagrams.

Learn how to:convert rectangle
using 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");
C#
6

Add Headers/Footers

Incorporate custom headers and footers into your PDFs with text, images, or HTML elements, creating a consistent and professional appearance.

Learn how to:add headers/footers
using 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");
C#
7

Add Page Numbers

Insert page numbers into your PDF, positioning them according to your formatting preferences to maintain an organized document structure.

Learn how to:add page numbers
using 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");
C#
8

Background & Foreground

Control background and foreground elements within your PDF to highlight specific content, enhance readability, or add visual appeal.

Learn how to:add background and foreground
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);
C#
Ready to Get Started?
Nuget Downloads 16,315,602 | Version: 2025.11 just released