Posted by a ceTe Software moderator
Hello,
You can add links to a PDF using the Link page element and add an image to the PDF using the Image page element. Please refer to the documentation on Image page element
here. You can add a link on the image by specifying the image’s dimension and positions. The documentation on the Link page element is found
here. You can set a URL for the link using UrlAction class. Below is a code sample.
Document document = new MergeDocument();
Page MyPage = new Page();
document.Pages.Add(MyPage);
Image MyImage=new Image(@"Image file path",100,100);
MyImage.Width=50;
MyImage.Height=50;
UrlAction action2 = new UrlAction("http://www.dynamicpdf.com");
Link MyLink2 = new Link(MyImage.X, MyImage.Y, MyImage.Width, MyImage.Height, action2);
// Add the label and the link to the page
MyPage.Elements.Add(MyImage);
MyPage.Elements.Add(MyLink2);
document.Draw(@"C:\temp\MyDocument.pdf");
Thanks,
ceTe Software Support Team