WebClient webClient = new WebClient();
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
webClient.getOptions().setJavaScriptEnabled(false);
webClient.getOptions().setCssEnabled(true);
webClient.getOptions().setDownloadImages(true);
Page page = webClient.getPage("http://www.example.com");
WebResponse response = page.getWebResponse();
how should I use the response
to render an image or pdf?
I have found several questions and several libraries that "do this".
But I could not in any of them, an effective way of through an http request, transform the return into an image or pdf, downloading and including all css and images external links automatically.
I don't care about the format (PNG or PDF), as long as the output is similar to what the browser renders.