Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
Leverage our countless features that build on existing PDF files to finalize them into perfect output files.
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 objectsusing 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);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 objectsusing 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");Delete unnecessary or unwanted PDF objects from your document to clean up and streamline your content.
Learn how to:remove PDF DOM objectsusing 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);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 imagesusing 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);Protect sensitive information by redacting text within your PDF. Permanently remove or obscure text to maintain document confidentiality.
Learn how to:redact textusing IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric");
pdf.SaveAs("redacted.pdf");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 textusing 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");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 annotationsusing 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");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 imagesusing 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");Create and apply custom watermarks to your PDF documents to mark them as drafts, confidential, or to add branding elements.
Learn how to:create watermarkusing 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");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 bitmapusing 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);Insert lines and rectangles into your PDF to structure content, emphasize sections, or create diagrams.
Learn how to:convert rectangleusing 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");Insert page numbers into your PDF, positioning them according to your formatting preferences to maintain an organized document structure.
Learn how to:add page numbersusing 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");Control background and foreground elements within your PDF to highlight specific content, enhance readability, or add visual appeal.
Learn how to:add background and foregroundusing 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);