I have a Java EE application running and on one of its webpage, I want to add a functionality that whenever the user presses a certain button, I get an image of ONLY the webpage which is currently displayed on the user end.
I have tried using a library for the purpose http://code.google.com/p/java-html2image/wiki/HtmlImageGenerator
My code using the above library is:
HtmlImageGenerator imageGenerator = new HtmlImageGenerator();
imageGenerator.loadUrl("http://localhost:8080/scheduler/xxx")
imageGenerator.getLinks();
imageGenerator.saveAsImage("sos.png");
It does generate an image but my page contains a lot of css and colors but the image which is generated does not seem to add that color and infact produces a blue screen with almost no css applied.
Can someone help in the code or suggest any alternative libraries for the same?