Free Support Forum - aspose.com

Annotation Types

Can I create a highlight annotation using Aspose.pdf? How about a line annotation?

Hi Joseph,


Thanks for contacting support.

Aspose.Pdf for .NET supports the feature to create annotations in PDF document. In order to accomplish your requirements, please try using CreateMarkup and CreateLine methods of PdfContentEditor class.

In order to highlight the test, please pass 0 as type argument to CreateMarkup method. In case of any further query, please feel free to contact.

Can a Highlight and Line annotation be put into an XML file and created using the Generator method?

Hi Joseph,



The methods which I have shared earlier are related to adding Line and Highlight annotations in existing PDF document. Whereas Aspose.Pdf.Generator namespace supports the feature to create PDF documents from scratch and in case you need to add annotations while creating the PDF file using an XML, you may consider following the approaches specified below.



In order to add Highlight annotations, you may simply create a text object and specify its back ground color information. Please visit the following link for further information on Text Formatting (http://www.aspose.com/docs/display/pdfnet/Text+Formatting).



In order to add line annotation, you may consider adding line using Graph object. Please visit the following link for further information on Working with Graphs (http://www.aspose.com/docs/display/pdfnet/Working+with+Graphs+(Generator))



In the event of any further query, please feel free to contact.