Convert Web Site to Image

Dear Aspose Team,
I have a requirement to convert web site( user will provide web site url) to image using .NET and display on the page.

I tried with the below code:

Approach-1:
// Initialize an HTML document from the file
using var document = new HTMLDocument(“Message Handlers | C#”);
// Create an instance of the ImageRenderingOptions class
var imageOptions = new ImageRenderingOptions(ImageFormat.Jpeg);
// Create an instance of the ImageDevice
using var device = new ImageDevice(imageOptions, savePath);

// Render HTML to JPG
document.RenderTo(device);

Approach -2:
// Initialize an HTML document from the file
var document = new HTMLDocument(“Message Handlers | C#”);
// Initialize ImageSaveOptions
var options = new Aspose.Html.Saving.ImageSaveOptions(ImageFormat.Png);
// Convert HTML to PNG
Converter.ConvertHTML(document, options, “test-html.png”);

The code is working fine for the url. But, It’s not working if i give some urls.
Example:

Please help me.

Regards,
Kamal

@kamal.guntuku

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLNET-5560

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.