I am working on a Spring-MVC project running on a Debian server, in which currently we are using html2canvas
for taking screenshots of the Users browser. Due to some changes in our front-end architecture, html2canvas
is no longer suitable for us..
Any idea how I can take a screenshot in a SPring-MVC project. Kindly let me know. Thank you.
Update
Anyway I can achieve this with the robot class and by putting the code inside a JSP?
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle screenRectangle = new Rectangle(screenSize);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(screenRectangle);
ImageIO.write(image, "png", new File(fileName));
2nd Update
I tried out the code, but it just gave screenshot of both the monitors I am running. Preferred is the webpage which is being accessed.