When creating an InteractiveFeatures.Annotations.FreeTextAnnotation, how do you set the font name, font size, color, etc? I see there is a DefaultAppearance string and an Appearance object, but don’t see how to set this attributes. Thanks.
for using our products.
have tested the scenario and have observed that in current release version of Aspose.Pdf for .NET, the data type of DefaultAppearance is not correct so its not allowing us to set the appearance attributes for text object. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34471. We
will investigate this issue in details and will keep you updated on the status
of a correction.
apologize for your inconvenience.
Thank you for your reply. When will there be an update or patch that fixes this problem?
I have a project due for a client in one week. If this is fixed, I can buy Aspose.PDF for this project. So, will there be a fix available within one week? Thanks.
Has a date been set yet to release a fix for this problem? I have an urgent need (this week) for this fix as stated before. Thank you for your help.
- property string FontName // gets or sets font name;
- property double FontSize // gets or sets default size of text
- property System.Drawing.Color Color (//gets or sets color of the text)
- property TextAligment Alignment (// gets or sets text alignment in the annotation.)
Document doc1 = new
//set font size and color of the annotation:
(doc1.Pages.Annotations as FreeTextAnnotation).TextStyle.FontSize = 18;
(doc1.Pages.Annotations as FreeTextAnnotation).TextStyle.Color = System.Drawing.Color.Green;
Document pdfDocument = new Document("c:/pdftest/TestReport.pdf");
// instantiate DefaultAppearance object
Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance("Arial", 28, System.Drawing.Color.Red);
FreeTextAnnotation freetext = new FreeTextAnnotation(pdfDocument.Pages, new Aspose.Pdf.Rectangle(200, 400, 400, 600), default_appearance);
// specify the contents of annotation
freetext.Contents = "Free Text";
// add anootation to annotations collection of page
// save the updated document
PS, When Contents or TextStyle of the free text annotation is changed, annotation appearance is regenerated to reflect changes.