Nutrient .NET SDK
Need pricing or implementation help? Talk to Sales.
PDF ANNOTATIONS IN C#
using GdPicturePDF gdpicturePDF = new GdPicturePDF();gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginBottomLeft);gdpicturePDF.SetMeasurementUnit( PdfMeasurementUnit.PdfMeasurementUnitCentimeter);gdpicturePDF.SelectPage(gdpicturePDF.GetPageCount());
// Add an "Approved" stamp annotation.gdpicturePDF.AddStampAnnotation( Left: 5, Top: 5, Width: 5, Height: 2, "Nutrient", "Approved", PdfRubberStampAnnotationIcon.Approved, 0.75f, 173, 216, 230);
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");using GdPicturePDF gdpicturePDF = new GdPicturePDF();gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);gdpicturePDF.SetMeasurementUnit( PdfMeasurementUnit.PdfMeasurementUnitCentimeter);gdpicturePDF.SelectPage(1);
// Add a free text annotation.string font = gdpicturePDF.AddStandardFont( PdfStandardFont.PdfStandardFontHelvetica);gdpicturePDF.AddFreeTextAnnotation( 1, 2, 8, 1.5f, true, "Author", "Note", "Review this section.", font, 14, 0, 0, 200, 100, 100, 100, 100);
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");using GdPicturePDF gdpicturePDF = new GdPicturePDF();gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Flatten all annotations on the first page.gdpicturePDF.SelectPage(1);int count = gdpicturePDF.GetAnnotationCount();for (int i = count - 1; i >= 0; i--){ gdpicturePDF.FlattenAnnotation(i);}
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");USE CASES
Apply rubber stamp annotations — Approved, Draft, Confidential, Final, or Not Approved — to documents in batch. Stamps follow the PDF specification and render in any compliant viewer.
Add free text, shapes, sticky notes, and links to PDFs as part of an automated pipeline. All annotation operations are programmatic — no GUI required.
Burn annotations into page content so they can no longer be edited or removed. Flatten individual annotations or all annotations on a page at once.
Add annotations to JPG, PNG, and TIFF files — not just PDFs. XMP annotations are embedded in the image metadata and can be imported, exported, and burned into the image.
Add annotations to any PDF page. Set the coordinate system, measurement unit, and position. Each annotation returns an index for later reference.
Apply rubber stamp annotations with predefined styles. Configure position, size, color, and opacity. Stamp any page in a document.
Flatten annotations into permanent page content. Edit properties like contents, color, and opacity. Remove individual annotations or clear all on a page.
Export annotation data to CSV. Import from XFDF files or databases. Annotate images with XMP and save/load annotations as XML or Base64.
ADVANCED CAPABILITIES
The SDK supports PDF annotations and XMP annotations for images. Read and write annotation properties, attach files and images, apply PDF actions (navigation, JavaScript, URLs), and manage annotations on JPG, PNG, and TIFF files through a dedicated annotation manager. All operations are available in both C# and VB.NET.
Attach actions to annotations — navigate to a page, open a URL, launch an application, or execute JavaScript when a user clicks an annotation.
Access any property of an existing annotation — color, fill color, contents, opacity, flags, bounding box, quad points, subject, and title.
Annotate images (JPG, PNG, TIFF) with a dedicated manager. Add, edit, burn, save, and load XMP annotations from XML files, streams, or Base64 strings.
All annotation operations are available in VB.NET with the same API. The guides include complete code examples in both C# and VB.NET.
Load the PDF, set the coordinate system and measurement unit, select a page, and add the annotation. The SDK provides methods for free text, squares, circles, stamps, sticky notes, lines, and links. Each method returns an index you can use to reference the annotation later. See the create annotations guide for complete C# examples.
Add a stamp annotation to a page using the SDK’s stamp method. Choose from predefined rubber stamp styles: Approved, Draft, Confidential, Final, and Not Approved. Configure the position, size, color (RGB), and opacity. Stamps follow the PDF specification and render in any compliant viewer. See the stamp guide.
Flatten individual annotations by index, or loop through all annotations on a page and flatten each one. Flattened annotations become permanent page content — they can no longer be edited, moved, or removed. This is commonly used for archiving and compliance. See the flatten guide.
Yes. The SDK can export annotation data — index, type, and contents — to CSV format, organized by page. This is useful for reporting, auditing, or feeding annotation data into external systems. See the export guide.
The SDK imports annotation data from XFDF files or from database streams containing XFDF data. You control whether to import form fields, annotations, or both. See the XFDF import guide.
Yes. The SDK supports XMP annotations on image files. Use the annotation manager to add text, stamps, shapes, freehand drawings, and comments to JPG, PNG, and TIFF files. Annotations are stored as XMP metadata and can be saved to XML, streams, or Base64 strings. See the XMP annotations guide.
The SDK exposes color, fill color, contents, opacity, flags, bounding box, quad points, subject, title, name, and action ID for each annotation. You can read any property and modify contents and other editable fields. See the annotation properties guide.
Yes. All annotation operations are available in VB.NET with the same API. The annotation guides include complete code examples in both C# and VB.NET.
FREE TRIAL
Add PDF annotations and stamps in C# in minutes — no payment information required.