Home
We need your feedback!

Bytescout.PDF for .NET


Subscribe to Our Bi-Monthly Newsletter (tips, new releases, specials):
 Subscribe in a reader
 PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  TESTIMONIALS   |  NEWS  | 

Bytescout.PDF library for .NET - add annotation into PDF

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

How to create annotation in PDF document

This example demonstrates how to createa annotation in PDF made with Bytescout.PDF library for .NET

Annotation in PDF generated with Bytescout.PDF library for .NET

Download example source code: bytescoutpdf_annotations_with_color.zip (5 KB)

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.PDF;

namespace ColorizedAnnotations
{
class Program
{
static void Main(string[] args)
{
PDFDocEngine engine =
new PDFDocEngine("", "");

// Add new document
Document document = engine.AddDocument();

// Add standard font
uint font = document.AddFontStandard(StandardFontType.Courier, FontEncodingType.Standard);

// Append new pages to the document
Page page = document.AddPage(PageSizeType.A4, PageOrientationType.LandScape);

// Create new drawing
Drawing drawing = page.AddDrawing();

// Set Active Font
drawing.SetActiveFont(font, 50, false, false);

// Draw Text
drawing.PlaceText(100, 100, 0, "Hello World!");

// Close drawing
drawing.Close();

// Create rectangle
Rectangle rectangle =
new Rectangle();
rectangle.Left = 100;
rectangle.Right = 100;
rectangle.Top = 100;
rectangle.Bottom = 100;

// Add new annotation stamp
AnnotationStamp stamp =
new AnnotationStamp(page, rectangle, "Demo", AnnotationStampIconType.Approved);
// Set color
stamp.Color = Drawing.ToRGB(0, 0, 1);

// Save document
document.Save("HelloWorld.pdf");
}
}
}

Download example source code: bytescoutpdf_annotations_with_color.zip (5 KB)

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

"Hello, World!" quick start step-by-step tutorials:

Advanced Examples:

HOME  |  CONTACT US

Copyright © ByteScout, 2003-2010. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.