I am having an issue when I create a new Pdf.Page and add a FreeTextAnnotation to that new page. It is visible in Firefox and IE but not in Chrome, using its proprietary PDF viewer that runs by default in that browser. The LinkAnnotation that I create is clickable but the text of the FreeTextAnnotation is not visible in the Chrome Pdf viewer.
Hi Tom,
Thanks Tilal for the quick reply. I was able to fix the issue by updating to the latest version of the Aspose.Pdf dll.
Hi Tom,tomq:
Thanks Tilal for the quick reply. I was able to fix the issue by updating to the latest version of the Aspose.Pdf dll.
I am afraid the API currently does not support the feature to hide/remove border from Annotation instance. However for the sake of implementation, I have logged an enhancement ticket as PDFNEWNET-38647 in our issue tracking system. We will further look into the details of this requirement and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for your inconvenience.tomq:
One other question - is there a way to remove the border from a FreeTextAnnotation? I set the width property to zero but the border still appears.
With the code below and using version from 24.3 library, the desired result is obtained.
Added line textAnnotation.Border.Width = 0; (made in accordance with the pdf specification - see attachment, although not entirely obvious)
var pdfDocument = new Aspose.Pdf.Document();
Aspose.Pdf.Page linkPage = (Aspose.Pdf.Page)pdfDocument.Pages.Add();
// create Link annotation object
var link = new LinkAnnotation(linkPage, new Aspose.Pdf.Rectangle(100, 300, 500, 750));
link.Color = Aspose.Pdf.Color.Transparent;
// create border object for LinkAnnotation
var border = new Border(link);
// set the border width
border.Width = 0;
// set the border for LinkAnnotation
//link.Border = border;
//Set the link url.
link.Action = new GoToURIAction("http://aspose.com");
// add link annotation to annotations collection of first page of PDF file
linkPage.Annotations.Add(link);
//create Free Text annotation
var textAnnotation = new FreeTextAnnotation(linkPage, new Aspose.Pdf.Rectangle(100, 300, 500, 750), new DefaultAppearance());
textAnnotation.Border.Width = 0; // --------> This line added.
//Create text for link.
string strTextFrag = "Please click here to goto website.";
// String to be added as Free text
textAnnotation.Contents = strTextFrag;
// set the border for Free Text Annotation
//textAnnotation.Border = border;
// add FreeText annotation to annotations collection of first page of Document
linkPage.Annotations.Add(textAnnotation);
pdfDocument.Save(dataDir + "38647-out.pdf");
38647-out.pdf (2.6 KB)
picture607-1.png (70.5 KB)