It lets the user to select any screen region (not only in the browser) and sends it back to the server. Here is a server-side usage sample:
win.addComponent(ss = new Screenshot());
ss.addListener(new Screenshot.Listener() {
@Override
public void screenshotReady(
Screenshot screenshot) {
// After screenshot is ready, show it
image.setSource(screenshot.getScreenshotResource());
}
});
ss.takeScreenshot();
The implementation is based on the AppletIntegration package and I have signed the demo jars with a self-signed certificate. If you plan to use this component in real application, please sign with you a valid certificate.
Yes. Import the
org.vaadin.screenshot.Screenshot . Also, before running the application you have to make sure you have put the add-on jar into WEB-INF/lib folder and recompiled the widgetset. In Eclipse, the plugin introduces a toolbar button for this, but in other environments you need to have an Ant task or similar.
The
no_image.gif was only used in Screenshot demo, and should not even be in the package. I consider this as a bug in the packaging script. You can simply ignore (or remove) the file.
I tried this Add-On ( and also JS Screenshot) but ran into some problems. I used a similar code then in the first post but put the takeScreenShot on a buttonClick. When i click the button nothing happens (sometimes a loading indicator appears but that’s it). I also can’t get your demo to work. When i click on the button in your demo also nothing happens.
Is there a problem with the Browser, Vaadin or am i doing something else wrong?
Don’t know about JS Screenshot, but the screenshot widget uses Java in the browser. If you’ve disabled running Java in the browser (with the recent list of vulnerabilities reported on enabling Java in the browser, many have disabled it), the plugin won’t work.