How to Remove FreeText Border When Using ImportAnnotationFromXfdf

I am using ImportAnnotationFromXfdf to create FreeText annotations. This is working, but I always get a red border around the FreeText. How can I remove the border entirely? I’ve tried setting the width attribute to zero on the tag, but I still get the border.

Also, where is the defaultappearance tag documented? Thanks.

Hi Joseph,

I am afraid; currently it is not supported to remove the border of the free text annotation. I have added a feature enhancement request in our issue tracking system with issue id: PDFNEWNET-34522. Our development will further check this issue and get back to you soon.

Also, where is the defaultappearance tag documented?

You can check the following link for details regarding Default Appearance members.

Sorry for the inconvenience,

Regarding the defaultappearance, I’m not talking about the class, I’m talking about the PDF syntax for this as a string, which I discovered can be set on a FreeTextAnnotation to control font, font size, and font color. For example, “/TimesRoman 12 Tf 1 0 0 rg” will set the text to Times New Roman, 12 pt, red text. So I’m asking where the documentation is for the syntax of that text string for defaultappearance. Thanks.

Hi Joseph,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the feedback.

Currently, we don’t have a documentation sample for setting the defaultappearance of an annotation. The example you shared is correct and we will update our documentation accordingly as well to include such example for this property as well.

Following is the sample of using defaultappearance of annotation:

<?xml version="1.0" encoding="UTF-8"?>

<xfdf xmlns="" xml:space="preserve">


<freetext page="0" color="#FF0000" flags="print" name="981a7be0-13b8-4647-b9b3-ae82e1cae9d6" rect="50,50,150,150" width="2">

<contents>Sample content</contents>

<defaultappearance>1 1 1 rg /Times-Roman 16 Tf</defaultappearance>



<f href="HelloWorld.pdf" />


Sorry for the inconvenience,

Thank you for the sample, but I need to know the syntax of the string in general. Please provide me the general definition of the string. In other words, what are each of the pieces of the string mean (i.e. font name, font size, color, what does “rg” mean, etc.). Thank you.

Hi Joseph,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Sorry for the inconvenience,

I have already asked the development team to share the detailed information regarding the use of defaultappearance property (Issue Id: PDFNEWNET-34552). As soon as I get the details, I will update the documentation as well as reply you with the details via this thread.

Thank you for being patient,

Hi Joseph,

Thanks for your patience.

We have further investigated the issue PDFNEWNET-34552 reported earlier and following are our findings. The Default Appearance string contains sequence of graphics and state operators which defines text properties such as color and text size.

rg is operator to set color of non-stroking operators (this defines text color in this case) 1 1 1 is color components (reg, green, blue, value range is 0…1). Thus, 1 1 1 defines white color.

Tf is set font operator. This operator selects font used for text. The first operand is key of font resource and second of font size. The Second operand is size of text. This, /Times-Roman 16 Tf means that Time-roman font of size 16 will be used .

More detailed info may be found in PDF specification (for example, Variable Text / Table 222 – Additional entries common to all fields containing variable text / DA value)

Please note that in latest release of Aspose.Pdf for .NET 9.2.1, the class FreeTextAnnotation has property named DefaultAppearanceObject. It is an instance of DefaultAppearance class which has properties to get/set color and text size.