Can I insert a <img> tag into a pdf document?

Hi, we are considering using Aspose for PDF. Can you tell me if it’s possible to insert an external image reference into a PDF document? For example, adding a <img src=http://somewebsite > ?

We want the PDF, when opened, to get the latest image from this url.

Please let me know if that’s possible.

Hello Michael,

Thanks for considering Aspose.

Aspose.Pdf is a component which is used to generate PDF files from scratch and I am pleased to inform you that it supports the feature to add a hyperlink to local as well as remote/web resource. According to your requirement you can use this feature to accomplish your requirement. For more information please visit Hyperlink to a Web Location.

In case you need to add a hyperlink to an existing PDF file, you can try using Aspose.Pdf.Kit, a component which is used to manipulate/edit existing PDF file. You can use it to add Hyperlink within an existing PDF file. For more related information, please visit Create Links.

In case it does not satisfy your requirement, please free to share.

We aren’t interested in adding a hyperlink in the PDF, we want to embed an external image.
Is that possible?

Hello Michael,

Thanks for considering Aspose.

I am not exactly sure what about the term "Embed an external image" into PDF file that you have quoted. As far as I've understood, there are two ways to include an image file into PDF file while creating through Aspose.Pdf. You can add the image file as an attachment or you can convert an image file into PDF format. For more information on how to attach and image file as an attachment, please visit Attach any File to PDF Document and visit the following link for information on How to Convert an Image to PDF.

Or in case you need to embed an image to an existing PDF file, then you can use Aspose.Pdf.Kit. It offers you the capability to Adhere Image or add image as watermark or you can add an image file as an attachment to an existing PDF file using AddDocumentAttachment method of PdfContentEditor class.

Please take a look and incase still it does not satisfy your requirement, please feel free to share.

Maybe there is a different way to accomplish what i’m looking for. Here is a link to a competitive product of yours referencing a method called AddImageUrl:

ABCpdf .NET PDF Component Documentation - Doc AddImageUrl Function. Renders a web page specified by URL.

Notice that they are adding an external URL to the pdf, and it renders the webpage directly into the PDF. This would work for our purposes too. We’ve purchased Aspose Total, so I’m trying to see if your product can do the same thing.

Another potential solution…do you support the “OpenAction” method in a PDF, which can trigger some event when the PDF is opened, such as invoking a piece of javascript?





Hello Michael,

Sorry for replying you late.

As far as I can see the feature link of the product that you have shared is transforming a webpage into PDF document. I am pleased to inform you that this feature is supported by Aspose.Pdf, whereas a web page can be some web location or web page saved over your hard drive. For more related information please visit, Converting Html or Aspx to PDF (Beta version). I would also recommend you to check the following technical articles that are related to this topic.

NOTE: This is Beta version of Html2Pdf. Only simple HTML is supported

Regarding your second query over JavaScript, I am delighted to inform you that this feature is also supported by Aspose.Pdf. For more related information please visit Adding JavaScript.

In case it does not satisfy your requirement, please feel free to share.