Hi Mike,
The PdfAnnotationComment class uses the PdfTextAnnotation class as the data source.
For solving your task you can go by 2 ways.
WAY 1. Store formatted text in "Adobe XML Architecture, XML Forms Architecture (XFA) Specification" format in the PdfTextAnnotation.RichText property.
For doing this you need to:
- Create an algorithm that encodes formatted text into XFA format.
- Create an algorithm that decodes formatted text from XFA format.
- Create custom class, which is derived from PdfAnnotationComment class, get PdfTextAnnotation using PdfAnnotationComment.Annotation property and store formatted text in the PdfTextAnnotation.RichText property. SDK does not use and does not interpret the PdfTextAnnotation.RichText property.
- Change the control, which displays the comment text.
WAY 2. Store information about font name and font size in custom properties of PdfTextAnnotation.
- Create custom class, which is derived from PdfAnnotationComment class, add new properties (FontName, FontSize) to the class and store information about text font in new properties. New properties will be stored in metadata of PDF text annotation in PDF tree.
- Change the control, which displays the comment text.
Both ways need to do changes in SDK. Changes will be available in next minor version.
Best regards, Alexander