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

Free Support Forum - aspose.com

Is it possible to feed Aspose.Pdf.Text with customized image stream?

With IsHtmlTagSupported set to true, Text objects accept HTML. This is very good. There are some images, in IMG tags. My question is if it is possible to expose some API from Text class, which can pass image stream in, instead of let it downloads itself. Here is my proposed implementation:


Text txt = new Text(html);
txt.IsHtmlTagSupported = true;
txt.ImageFeeder = new MyImageFeeder();

class MyImageFeeder : IImageFeeder
{
public System.Drawing.Image GetImageStream(HtmlElement img, string src)
{
return System.Drawing.Image.FromFile(“c:\temp.png”);
}
}

Thanks.

Hello Tony,

Thanks for using our products.

Do you mean you also need to add images while converting HTML pages into PDF format ? If so is the case, please use the following code line. pdf.HtmlInfo.ImgUrl = "D:/pdftest/MemoryStream/";

Or, in case you need to add an image from MemorStream, please visit the following link for required information. How to convert MemoryStream Image to PDF

In case I have not properly understood your requirement, please elaborate your requirement. We apologize for your inconvenience.

Got it.


But this means I have dump all images to the disc folder, which is not clean and not efficient for my web applications. So I still suggest you could have some API for me to feed it with memory images. Thanks.

Hello Tony,

Thanks for sharing your feedback.

Before I log this requirement, I would like to have your concise over what I have understood so far. Please acknowledge that you require some feature / API / property that can be used to specify MemoryStream image data while converting HTML text into PDF format ?

That’s correct. Thanks for logging this.

Hello Tony,

Thanks for the feedback.

I have logged this requirement under new features list in our issue tracking system as PDFNET-19921. We will further look into the details of this requirement and as soon as we have some updates regarding its resolution, we would be pleased to update you with the status of correction.

Your patience and comprehension is greatly appreciated in this regard. We apologize for your inconvenience.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan