Convert Url in Image in Java

Hello everybody,

I would to like to know how to convert an Url(www.google.com, or any other url) in Image(better in png, but isn’t the main point this), or if is not possible, convert an Url first in a document and then in Image. I’m pretty new about Aspose, sorry in advance if the question has one or more answer yet.

Thanks

I thought it was an easy question…

Hi,

Thanks for your inquiry. You can meet this requirement using Aspose.Words for Java API. Please use the following code:

LoadOptions opts = new LoadOptions();
opts.setLoadFormat(LoadFormat.HTML);
Document doc = new Document("http://www.google.com", opts);
doc.save(getMyDir() + "out.png");

Please let us know if we can be of any further assistance.

Best regards,

Hi,

It seems it works. I say “it seems” because the picture contains “Evalutation only…” and is not completely clear. I tried with www.google.it but the result is this one. So, in this way I don’t know if it works or not…

Hi,

Thanks for your inquiry. The red message appears because you’re using Aspose.Words in evaluation mode. To avoid these limitations, you first need to apply license before creating Document instance. Secondly, please note that it is not guaranteed that the output Image will look exactly the same as the input HTML file in web browsers. There are a few documented limitations when dealing with webpages/HTML files. Please check the articles mentioned in the following links:

Load in the HTML (.HTML, .XHTML, .MHTML) Format
Save in the HTML (.HTML, .XHTML, .MHTML) Format

Best regards,