Hyperlink not showing up on the page (example from your documentation)

The documentation for including hyperlinks in a PDF document does not work…

I tried this code as a test exactly as is, because I need to program a link into a doc that I am creating.
It results in nothing on the page. If you hold the mouse over different areas of the page, you can tell that a link is there. There is just no text of a link visible on the page.
Any ideas? If this documentation that you provide on your site is not the best way to include a link on a page, please provide an example of the right way to do it.
Thanks

@JBLgovcon

Have you tried the complete code example? i.e.

// Open document
Document document = new Document(dataDir + "AddHyperlink.pdf");
// Create link
Page page = document.Pages[1];
// Create Link annotation object
LinkAnnotation link = new LinkAnnotation(page, new Aspose.Pdf.Rectangle(100, 100, 300, 300));
// Create border object for LinkAnnotation
Border border = new Border(link);
// Set the border width value as 0
border.Width = 0;
// Set the border for LinkAnnotation
link.Border = border;
// Specify the link type as remote URI
link.Action = new GoToURIAction("www.aspose.com");
// Add link annotation to annotations collection of first page of PDF file
page.Annotations.Add(link);

// Create Free Text annotation
FreeTextAnnotation textAnnotation = new FreeTextAnnotation(document.Pages[1], new Aspose.Pdf.Rectangle(100, 100, 300, 300), new DefaultAppearance(Aspose.Pdf.Text.FontRepository.FindFont("TimesNewRoman"), 10, System.Drawing.Color.Blue));
// String to be added as Free text
textAnnotation.Contents = "Link to Aspose website";
// Set the border for Free Text Annotation
textAnnotation.Border = border;
// Add FreeText annotation to annotations collection of first page of Document
document.Pages[1].Annotations.Add(textAnnotation);
dataDir = dataDir + "AddHyperlink_out.pdf";
// Save updated document
document.Save(dataDir);

The link annotation is drawn around some text on a PDF page. In the second part of the code snippet, a text annotation is being added at the same location where link was placed. Please check the attached output PDF that is created in our environment using the above code snippet. AddHyperlink_out.pdf (79.3 KB)

Yes, I used the same exact code.
When I click on your file, it brings it up in the browser and seems to work.
When I download your file and open it up, the text is visible, but it will not link.
My file will link, but the text is not visible. I can even put a border around it, but the text will not be seen. When I click “edit links” it has the correct URL, but I still can’t see anywhere to edit the text shown itself.

I figured it out. It needs to be a text fragment and paragraph NOT a TextAnnotation. A TextAnnotation is a “tool tip/comment” rather than text on the page. You might want to update your documentation. Thanks

@JBLgovcon

Were you using an existing PDF? We tested while creating a PDF document from scratch and it worked for us. However, we have recorded your concerns and will surely update our example in the documentation accordingly.