We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

FreeTextAnnotation does not appear until it is resized

I am attempting to add a a FreeTextAnnotation to an existing PDF that will only show on the PDF when printing, following the example at the bottom of the page here: http://www.aspose.com/docs/display/pdfnet/Add+Annotation+in+an+Existing+PDF+File


When I printed the PDF, the annotation did not show up, so I removed the AnnotationFlags.NoView flag. After that, the annotation did not show up when opening the file in Acrobat, but if I clicked around where the annotation should have been, a box would be highlighted. If I resized the box, the annotation would then appear.

To make sure this wasn’t an issue with my code, I checked the annotation examples in the Aspose Examples Dashboard to see if I experienced the same issue. I ran the example Aspose.Pdf/Programmers Guide/Working with Annotations/Set Formatting of FreeTextAnnotation. The exact same issue occurred. See attachments for pictures of the issue on the file generated by the Aspose example.

I am running Windows Server 2012 and the latest version of Adobe Acrobat XI. Others in my office tried the same file and experienced the same issue. All of them are using Acrobat XI and Server 2012/ Windows 8.1/ Server 2008 R2.

What we need is for a) the FreeTextAnnotation to show up without resizing the box if the NoView flag is not set, and b) the FreeTextAnnotation to show up on printed paper if the Print flag is set.
Hi Keith,

keithkurak:
a) the FreeTextAnnotation to show up without resizing the box if the NoView flag is not set, and

Thanks for your inquiry. Please check following code snippet to add FreeTextAnnotation. It will help you to add FreeTextAnnotation to show up it without resizing box.

Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(myDir + "HelloWorld.pdf");

// instantiate DefaultAppearance object

Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance("Arial", 12, System.Drawing.Color.Red);

FreeTextAnnotation freetext = new FreeTextAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(100, 650, 294, 700), default_appearance);

Aspose.Pdf.InteractiveFeatures.Annotations.Border border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(freetext);

border.Style = Aspose.Pdf.InteractiveFeatures.Annotations.BorderStyle.Solid;

border.Width = 2;

//border.Style = Aspose.Pdf.InteractiveFeatures.Annotations.BorderStyle.Dashed;

border.EffectIntensity = 2;

freetext.Opacity = 10f;

freetext.Characteristics.Border = System.Drawing.Color.Black;

freetext.Border = border;

freetext.Contents = "Free Text";

//freetext.Flags = AnnotationFlags.Print | AnnotationFlags.NoView;

// add anootation to annotations collection of page

pdfDocument.Pages[1].Annotations.Add(freetext);

pdfDocument.Save(myDir + "freetext_output.pdf");

Please feel free to contact us for any further assistance.


Best Regards,

Hi Keith,

keithkurak:
b) the FreeTextAnnotation to show up on printed paper if the Print flag is set.

Moreover, in reference to showing annotation in print only, I have tested the scenario and found the feature is not working as expected. So logged a ticket PDFNEWNET-38521 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress within this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

<span style=“font-size:8.5pt;font-family:“Arial”,sans-serif;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:#444444;
background:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA”>We are considering buying the Priority Support and would like our issue
evaluated to see if it will be appropriate.

tilal.ahmad:
Hi Keith,

keithkurak:
a) the FreeTextAnnotation to show up without resizing the box if the NoView flag is not set, and

Thanks for your inquiry. Please check following code snippet to add FreeTextAnnotation. It will help you to add FreeTextAnnotation to show up it without resizing box.


I used this code and experienced the same issue with the FreeTextAnnotation not showing up unless the box was resized.

Hi Keith,


Thanks for your patience.

As shared in other forum thread, please note that
ES/PS support does not guarantee any immediate resolution of issues (
because
it might be dependent on other issues or feature which needs to be implemented
)
but under this model, the development team starts investigating the
problem on high priority. For further details, please visit
Support Options.

Should you have any further query, please feel free to contact.

I was able to get to this to work (having the annotation show without resizing) after installing our license file in my test project (I had started up a new project apart from our main solution where the license was already installed).

Hi Kieth,

keithkurak:

I used this code and experienced the same issue with the FreeTextAnnotation not showing up unless the box was resized.

Thanks for your feedback. I am afraid the code is working fine, sample output is also attached above. We will appreciate it if you please share your sample code and document here, we will check it and guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

We are prepared to buy Support and please evaluate our issue and let me know if purchasing the support would help.

keithkurak:
I was able to get to this to work (having the annotation show without resizing) after installing our license file in my test project (I had started up a new project apart from our main solution where the license was already installed).

Hi Keith,

Thanks for your feedback. It is good to know that you have manged to resolve the Annotation resizing issue. Moreover we are looking into your above reported issue and evaluating it whether purchasing Paid support will help you to resolve it quicker.

Thanks for your patience and cooperation.

Best Regards,
tilal.ahmad:
keithkurak:
I was able to get to this to work (having the annotation show without resizing) after installing our license file in my test project (I had started up a new project apart from our main solution where the license was already installed).

Hi Keith,

Thanks for your feedback. It is good to know that you have manged to resolve the Annotation resizing issue. Moreover we are looking into your above reported issue and evaluating it whether purchasing Paid support will help you to resolve it quicker.

Thanks for your patience and cooperation.

Best Regards,
Have you determined if paid support would help? In particular, we are most interested in getting the bug preventing print-only annotations from printing resolved.

It just occurred to me that I had not tried using the AnnotationFlags.Print/ NoView flags since figuring out why annotations were not appearing without resizing and fixing that. I tried it and it worked for horizontal FreeTextAnnotations.


Two questions:

1) What exactly was the bug that you logged? Is it related to printing but not viewing the FreeTextAnnotation? Just want to make sure there’s not an issue I’m going to run into later.

2) If I try to rotate an annotation, the annotation no longer appears on the page or the printout, regardless of which flags I’m using. Can you look into this? Here’s my sample code:

private void DrawWatermarkForPage(Page page, string watermarkText)
{
Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance(“Arial”, 28, System.Drawing.Color.Black);

FreeTextAnnotation freetext = new FreeTextAnnotation(page, new Rectangle(80, 80, 400, 400), default_appearance);

Aspose.Pdf.InteractiveFeatures.Annotations.Border border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(freetext);
border.Width = 0;
freetext.Opacity = .3;
freetext.Contents = watermarkText;
freetext.Characteristics.Rotate = Rotation.on90;

//freetext.Flags = AnnotationFlags.Print | AnnotationFlags.NoView;

// add anootation to annotations collection of page
page.Annotations.Add(freetext);
}
Hi Keith,

keithkurak:
It just occurred to me that I had not tried using the AnnotationFlags.Print/ NoView flags since figuring out why annotations were not appearing without resizing and fixing that. I tried it and it worked for horizontal FreeTextAnnotations.

Two questions:

1) What exactly was the bug that you logged? Is it related to printing but not viewing the FreeTextAnnotation? Just want to make sure there's not an issue I'm going to run into later.

Thanks for your feedback. Can you please shares your sample code of "horizontal FreeTextAnnotation "that worked for you? we will look into it and share our findings.

Moreover, in reference to logged issue, I have tried AnnotationFlags.Print | AnnotationFlags.NoView together. It was not working as expected as annotation is missing in printout. So I have logged it for further investigation and resolution.

Best Regards,
tilal.ahmad:
Hi Keith,

keithkurak:
It just occurred to me that I had not tried using the AnnotationFlags.Print/ NoView flags since figuring out why annotations were not appearing without resizing and fixing that. I tried it and it worked for horizontal FreeTextAnnotations.

Two questions:

1) What exactly was the bug that you logged? Is it related to printing but not viewing the FreeTextAnnotation? Just want to make sure there's not an issue I'm going to run into later.

Thanks for your feedback. Can you please shares your sample code of "horizontal FreeTextAnnotation "that worked for you? we will look into it and share our findings.

Moreover, in reference to logged issue, I have tried AnnotationFlags.Print | AnnotationFlags.NoView together. It was not working as expected as annotation was being reflecting in output PDF document and missing in printout. So I have logged it for further investigation and resolution.

Best Regards,

Here is the code:

private void DrawWatermarkForPage(Page page, string watermarkText)
{
Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance("Arial", 28, System.Drawing.Color.Black);

FreeTextAnnotation freetext = new FreeTextAnnotation(page, new Rectangle(80, 80, 400, 400), default_appearance);

Aspose.Pdf.InteractiveFeatures.Annotations.Border border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(freetext);
border.Width = 0;
freetext.Opacity = .3;
freetext.Contents = watermarkText;

freetext.Flags = AnnotationFlags.Print | AnnotationFlags.NoView;

// add anootation to annotations collection of page
page.Annotations.Add(freetext);
}

Hi Keith,


Thanks for your prompt reply. By it worked , do you mean that annotation is being printed properly? As I noticed that annotation is not showing in printout.


AnnotationFlags.Print | AnnotationFlags.NoView;


Best Regards,
tilal.ahmad:
Hi Keith,

Thanks for your prompt reply. By it worked , do you mean that annotation is being printed properly? As I noticed that annotation is not showing in printout.


AnnotationFlags.Print | AnnotationFlags.NoView;


Best Regards,

The annotation did not appear on the screen, but did appear in the print preview and then on the printout from Acrobat, which was the expected behavior
Hi Keith,

Thanks for your inquiry.

keithkurak:

2) If I try to rotate an annotation, the annotation no longer appears on the page or the printout, regardless of which flags I'm using. Can you look into this? Here's my sample code:

private void DrawWatermarkForPage(Page page, string watermarkText)
{
Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance("Arial", 28, System.Drawing.Color.Black);

FreeTextAnnotation freetext = new FreeTextAnnotation(page, new Rectangle(80, 80, 400, 400), default_appearance);

Aspose.Pdf.InteractiveFeatures.Annotations.Border border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(freetext);
border.Width = 0;
freetext.Opacity = .3;
freetext.Contents = watermarkText;
freetext.Characteristics.Rotate = Rotation.on90;

//freetext.Flags = AnnotationFlags.Print | AnnotationFlags.NoView;

// add anootation to annotations collection of page
page.Annotations.Add(freetext);
}

I have tested the scenario and noticed Annotation does not appear after setting of rotate property. We have logged a ticket PDFNEWNET-38661 for further investigation and resolution. We will update you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

wait a minute … I also posted a new thread about this issue. so the free text annotation will automatically resize its boundaries if a license file is used?


please confirm? because that is messed up. ive been scratching my head on this issue. it would be nice if some kind of notice will show up in console for example so the user will not have to waste time trying to find a solution when all there is to it is to use a license file.

Hi Chit,


Thanks for your inquiry. It is not the case that text annotation automatically resize its boundaries with license implementation. Actually without license implementation FreeTextAnnotation is not appearing until modified in PDF viewer, we have logged a ticket PDFNET-41908 for its rectification.

We are sorry for the inconvenience. We will look into your post and will update you accordingly.

Best Regards,