Enhanced Watermark Annotation and Footnote in Aspose.Pdf for .NET 17.2.0

Share on FacebookTweet about this on TwitterShare on LinkedIn

This month release of Aspose.Pdf for .NET 17.2.0 has been published. It includes some important enhancements along with number of bug fixes those were reported in previous months’ releases and making this release more reliable and stable. The enhancements include opacity feature in Watermark Annotation and hyperlink feature in Footnote. In this release, we have fixed PDF to PDFA, PDF to HTML conversion feature issues along with some other issues. In order to get an idea about the new features/enhancements and fixes made in this release, please check the detailed release notes of this version.

Furthermore, If you are planning to upgrade the API from any previous version, we strongly recommend you to check the Public API Changes section of other intermediate releases from release notes folder, to know what has been changed since your current revision of the API.

The following sections describe some details regarding these newly added enhancements.

Adding Transparent Watermark Annotation

Some of our customers requested to control transparency of Watermark Annotation, so we have implemented opacity property in new release for this purpose. Please check following sample code to add transparent Watermark Annotation:

//Load a Document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document("source.pdf");
//Load Page object to add Annotation
Page page = doc.Pages[1];
//Create Annotation
WatermarkAnnotation wa = new WatermarkAnnotation(page, new Aspose.Pdf.Rectangle(100, 500, 400, 600));
//Add annotaiton into Annotation collection of Page
page.Annotations.Add(wa);
//Create TextState for Font settings
Aspose.Pdf.Text.TextState ts = new Aspose.Pdf.Text.TextState();
ts.ForegroundColor = Aspose.Pdf.Color.Blue;
ts.Font = FontRepository.FindFont("Times New Roman");
ts.FontSize = 32;
//Set opacity level of Annotation Text
wa.Opacity = 0.5;
//Add Text in Annotation
wa.SetTextAndState(new string[] { "HELLO", "Line 1", "Line 2" }, ts);
//Save the Docuemnt
doc.Save("Output.pdf");

Hyperlink support in Footnote text

We already support Footnote feature in Aspose.Pdf for .NET. However recently, one of the customer asked for hyperlink enhancement in Footnote feature. To fulfill this requirement, we have enhanced Footnote feature in this release. Now, by default Footnote functionality will add a reference of Footnote text to related superscript text. For example, Footnote superscript text “1” will be linked to Footnote text in output PDF document of following code:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Page page = doc.Pages.Add();
Aspose.Pdf.GraphInfo graph = new Aspose.Pdf.GraphInfo();
graph.LineWidth = 2;
graph.Color = Aspose.Pdf.Color.Red;
graph.DashArray = new int[] { 3 };
graph.DashPhase = 1;
page.NoteLineStyle = graph;
TextFragment text = new TextFragment("test text 1");
text.FootNote = new Note("foot note for test text 1");
text.FootNote.Text = "1";
page.Paragraphs.Add(text);
doc.Save(myDir + "footnote.pdf");

Aspose.Pdf for .NET Resources

The following resources will help you work with Aspose.Pdf for .NET: