How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

PDF Annotation VB.NET Library
PDF Annotation in VB.NET


Guide to Draw, Add and Edit Various Annotations on PDF File in VB.NET Programming. ASP.NET Annotate PDF function is based on C# PDF Annotate SDK.










Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.


Annotation Overview



When we are reading or viewing a PDF document file, we may often need to mark the source PDF file by adding some comments, notes, explanations or other remarks. And this VB.NET PDF annotation control add-on, which integrates advanced VB.NET PDF editing functions and VB.NET image annotating features, provides developers with a great .NET solution to annotate .pdf file with both text & graphics. From this page, you will get a simple VB.NET online PDF annotation tutorial.

asp.net open word document in browser, asp.net pdf viewer free, asp.net display image from database, asp.net multipage tiff viewer, display pdf in mvc, how to edit pdf file in asp.net c#, asp.net preview pdf.




API Explanations



To help you better understand above VB.NET PDF annotating APIs, we here specifically illustrate some programming classes that may cause unnecessary confusion.


PDFDocument: this VB.NET PDF annotation control component uses PDFDocument class to represent one in-memory PDF document file. A PDFDocument object contains all information about source PDF document file.


PDFPage: As for one page of PDFDocument instance, RasterEdge VB.NET PDF annotator control add-on uses one PDFPage object to display it. Thus, PDFPage, derived from REPage, is a programming abstraction for representing one PDF page.




Annotating Process



Besides giving you the detailed VB.NET PDF annotating APIs, we think it is necessary to briefly introduce the general process of this VB.NET PDF annotation application.


Decode source PDF document file into an in-memory object, namely, PDFDocument, using VB.NET PDF annotation control add-on;


Accurately select the page on which you want to draw annotation using VB.NET code;


Create your annotation object and customize it with desired imaging properties;


Add & burn your annotation on selected PDF page using above mentioned VB.NET PDF annotation APIs;


Save and re-encode target PDF file to desired web or file path.




VB.NET DLLs: PDF Annotation



In order to run the sample code, the following steps would be necessary.




VB.NET: Retrieve All Annotations Information from PDF Document



This demo code let you learn how to retrieve all annotations from PDF file in VB.NET project.




' Get PDF document.
Dim fileInpath As String = ""
Dim doc As PDFDocument = New PDFDocument(fileInpath)

' Get all annotations.
Dim allAnnotation As List(Of IPDFAnnot) = PDFAnnotHandler.GetAllAnnotations(doc)





VB.NET: Retrieve All Annotations Information from PDF Page



This demo code let you learn how to retrieve all annotations from PDF page in VB.NET project.




' Get PDF document.
Dim fileInpath As String = ""
Dim doc As PDFDocument = New PDFDocument(fileInpath)

' Get PDF page.
Dim page As PDFPage = doc.GetPage(0)

' Get all annotations of PDF page.
Dim allAnnotation As List(Of IPDFAnnot) = PDFAnnotHandler.GetAllAnnotations(page)





VB.NET: Add an Annotation - Sticky Note



Use the code below to add an sticky note annotation to a PDF page in VB.NET project.




Dim inputFilePath As String = Program.RootPath + "\\" + "2.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "Annot_8.pdf"

' open a PDF file
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
' get the 1st page
Dim page As PDFPage = doc.GetPage(0)

' create the annotation
Dim annot As PDFAnnotStickyNote = New PDFAnnotStickyNote()

annot.Position = New PointF(100.0F, 100.0F)

' add annotation to the page
PDFAnnotHandler.AddAnnotation(page, annot)

' save to a new file
doc.Save(outputFilePath)