1

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.

We are Borg
  • 5,117
  • 17
  • 102
  • 225
  • The server "fires and forgets" HTTP responses, in some cases they're HTML, and in some cases those are consumed by a web browser. There's no way to "tap into" user's browser in the generic manner described by you, you'll have to look for a client-side solution. – kryger Mar 08 '16 at 11:24
  • @kryger : Know any good client-side solutions? – We are Borg Mar 08 '16 at 11:54

0 Answers0