Image with underline and hyperlink

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v11)  /  Image with underline and hyperlink

DynamicPDF CoreSuite for .NET (v11) Forum

 Jun 10 2021 8:29 AM
Hi Team,

I have a requirement to render image (as icon) with underline and hyperlink.
So user can click on image (icon) to navigate on another page in same pdf.

Chandan Singh
Posted by a ceTe Software moderator

You can achieve this using the Link, Image and Line page elements. Please refer to the documentation on the Link, Image  and Line page elements.

Here a sample:

           Document document = new Document();
            Page page = new Page();

            Page secondPage = new Page();

            //Adding link to the pages using Link and Image page elements.
            Image linkImage = new Image(@"C:\FromD\temporary\Images\Winter.jpg", 100, 100);
            linkImage.AlternateText = "Link to navigate to second page";
            XYDestination action = new XYDestination(2,0,0);
            Link link = new Link(100, 100, 100, 100, action);
            linkImage.Width = 100;
            linkImage.Height = 100;
            //Adding unerline behavior using Line page element.
            Line lineObj = new Line(linkImage.X, linkImage.Y + linkImage.Height + 2, linkImage.X + linkImage.Width, linkImage.Y + linkImage.Height + 2);
            string outputPath = @"C:\Temp\MyLinkDocument.pdf";

Feel free to download a fully functional evaluation edition of DynamicPDF Core Suite for .NET product from NuGet (Package ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website here.

ceTe Software Support Team

All times are US Eastern Standard time. The time now is 4:13 PM.