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

Free Support Forum - aspose.com

Assign HTTP link for particular icon

Dear Team.,

How to assign HTTP link for particular icon(or)image in PDF document. After click that icon in document,directly links goes to web.Please give solution for this.

Vadivel S S


Thanks for contacting support.

Please check following code snippet, in order to achieve the required functionality:

Aspose.Pdf.Image img = new Aspose.Pdf.Image();
img.File = dataDir + "aspose.jpg";
img.FixWidth = 200;
img.FixHeight = 100;
// Add Hyperlink to the image
img.Hyperlink = new WebHyperlink("http://aspose.com");
// Create a new Document Object
Document doc = new Document();
// Add image to paragraph collection of added page
// Save the document
doc.Save(dataDir + "ImageWithHyperlink.pdf"); 

In event of any further query, please feel free to contact us.

Thank you Asad.