-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to create screenshot of browser, ore its some section, and send it back to server using ZK. Or any idea? Thanks
you can use java.awt.Robot to "create an image containing pixels read from the screen." You can then write that image to a file on disk.
Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
BufferedImage capture = new Robot().createScreenCapture(screenRect);
ImageIO.write(capture, "bmp", new File("filename"));
edit :
Well then you will have to use it in the zul under :
<script defer="true">
</script>
Its monday :)
Now for mine code above it doesn't work indeed :), only on local tomcat/jetty
What you can use is :html2canvas.js
What else : You can wire your window, window is seriazable.
You can save it in a DB or file.
So you can load it also again and show it in your "managing place"
pro and con's :
pro picture : * Picture is easier to open and view it.
pro window : * You save it as the state it was so the when remitting your window normally your bug must be also there (or of course external reason of failure like javascript not turned on, cookie corrupted,...)
Now a suggestion to zk is each org.zkoss.zk.ui.AbstractComponent
to have an public Image toImage()
Taking screenshot(of content browser) is something that should be easy to do.
Hope some other readers agree with me.
Greetz chill.
Hi again. I saw html2canvas too, but this js library is written by single man, also doesn't fully supports css, so it's a black horse, seems should try and see the result. Now I think, it is better to get some component's html (for example window) on clients side and pass to server and than convert this html to pdf, for now I see many html->pdf converters..
Asked: 2014-03-07 10:28:48 +0800
Seen: 35 times
Last updated: Mar 10 '14
Some way to skip client validation for certain input values [closed]
composite component help [closed]
EL in a forEach @command not working?
Different template for each grid row
Cardlayout animation is broken
Grid RowRender slow using 6.5.1 and sizable=true
setVisible(false), component will load or not
Decimalbox and doublebox value rounded on iPad