Converting charts from a rendered view to PDF

Hi,

We are in the process of determining if we will be able to use Aspose.Pdf for our project.

We are working on converting an HTML page to PDF. This is a MVC .NET page that is rendered dynamically and loaded with data. We then want to get the HTML from this view after it is rendered, save it to a stream, then convert the stream to PDF. I see that Aspose.Pdf can do this.

Here's my question:

We have charts that are loaded/created dynamically in our view. When we export these charts, we save them as SVG to a stream and then download the file from the stream to the user's machine.

What's the best way to get these images from the rendered view to the converted PDF without having to predefine them or having them saved on disk?

We saw this example: http://www.aspose.com/docs/display/pdfnet/Convert+HTML+to+PDF+-+Resource+Loading+Callback

That example reads the image as bytes but it does so from a "predefined" image saved on disk. Can this image replacement be done from a stream?

Can the replacement be done to multiple images inside the same document? In other words, if i have multiple images in my rendered view, can Aspose.Pdf replace them with images on the PDF?

What do you recommend?

Thanks in advance,

Thiago S.
Hi Thiago,

Thanks for your inquiry. We are looking into your query and will get back to you soon.

Best Regards,

Thiago S:

We have charts that are loaded/created dynamically in our view. When we export these charts, we save them as SVG to a stream and then download the file from the stream to the user’s machine.

What’s the best way to get these images from the rendered view to the converted PDF without having to predefine them or having them saved on disk?


That example reads the image as bytes but it does so from a “predefined” image saved on disk. Can this image replacement be done from a stream?


HI Thiago,

We are sorry for the delayed response. You can read stream data in byte array and pass ResourceLoadingResult method. It will help you to accomplish the task.

Thiago S:
Can the replacement be done to multiple images inside the same document? In other words, if i have multiple images in my rendered view, can Aspose.Pdf replace them with images on the PDF?


We are looking into multiple images replacement request and will update you soon.

We are sorry for the inconvenience caused.

Best Regards,