Html2Canvas Screenshot
Vaadin add-on that takes screenshots using html2canvas
Html2Canvas Screenshot is a Vaadin add-on that makes taking screenshots of your clients' UIs extremely easy and with no Java applet or plugin required. You get the data URL, raw image bytes, and MIME type of the image as a response in a listener callback. The current version utilizes html2canvas 0.4.1.
Sample code
final Screenshot screenshot = new Screenshot(); screenshot.addScreenshotListener(new ScreenshotListener() { public void screenshotComplete(ScreenshotImage image) { Window window = new Window("Here's your screenshot", new Image(null, new ExternalResource(image.getDataURL()))); window.setWidth("80%"); window.setHeight("80%"); addWindow(window); } }); screenshot.takeScreenshot();
final Screenshot component = Screenshot.newBuilder() .withAllowTaint(true) .withBackground("#f00") .withHeight(768) .withWidth(1024) .withLogging(true) .withMimeType(ScreenshotMimeType.JPEG) .build(); component.addScreenshotListener(new ScreenshotListener() { public void screenshotComplete(ScreenshotImage image) { Window window = new Window("Here's your screenshot", new Image(null, new ExternalResource(image.getDataURL()))); window.setWidth("80%"); window.setHeight("80%"); addWindow(window); } }); component.takeScreenshot();
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Support Vaadin 8
- Released
- 2017-02-06
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.2+
- Vaadin 8.0+
- Browser
- Firefox
- Safari
- Google Chrome
- Internet Explorer
- Internet Explorer
Html2Canvas Screenshot - Vaadin Add-on Directory
Vaadin add-on that takes screenshots using html2canvasAuthor Homepage
Issue Tracker
Source Code
Html2Canvas Screenshot version 0.4.1
Initial release targeting html2canvas 0.4.1 with all its options available.
Html2Canvas Screenshot version 0.4.1.1
* Added ability to take a screenshot of a specific component. Big thanks to Eduardo Frazão for the PR!
Html2Canvas Screenshot version 0.4.1.2
- Excluded rebel.xml from JARs to avoid conflicts for JRebel users
Html2Canvas Screenshot version 1.4.1.2
Support Vaadin 8