Font Properties on PdfTextAnnotation
Moderator: Alex
-
- Posts: 56
- Joined: Mon Dec 02, 2019 11:19 pm
Font Properties on PdfTextAnnotation
I'm trying to allow for different font properties to be set on replies to annotations, but there doesn't appear to be a way to save the updated font data to the text annotation. As a result I can't have one user save their reply with one set of font settings and another reply with a different set later on. Is there a way you would suggest doing this?
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Font Properties on PdfTextAnnotation
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:
Best regards, Alexander
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.
- 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.
Best regards, Alexander
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Font Properties on PdfTextAnnotation
Hello Mike,
In version 9.0.0.21 we have added the ability to create classes, which are derived from PdfAnnotationComment and PdfAnnotationCommentCollection classes. This allows to implement logic, which is necessary in your task.
Best regards, Alexander
In version 9.0.0.21 we have added the ability to create classes, which are derived from PdfAnnotationComment and PdfAnnotationCommentCollection classes. This allows to implement logic, which is necessary in your task.
Best regards, Alexander
-
- Posts: 56
- Joined: Mon Dec 02, 2019 11:19 pm
Re: Font Properties on PdfTextAnnotation
Awesome, thank you! I'll start taking a look at that.