Is it possible to capture the screen or generate a hardcopy in GWT programatically?
using AWT its possible but the AWT can't be used in GWT[only GWT not any other like smartGWT, ext-GWT]?
On client side GWT do nothing more than Javascript. So your question is: Can I take screen shot in JavaScript? The answer is:
If you want only take screen shot inside browser and can bear different you can use html2canvas.
If you want also take screen shot out of browser, you have to use other technology such as ActiveX control (may be Java Applet with AWT).
Check this: Take a screenshot of a webpage with JavaScript?
I don't believe that you will find anything native in GWT to do this. I believe that the best that you could manage would be something like this:
http://html2canvas.hertzen.com/
GWT just compiles java into javascript as it as been said by other guys in their answer. So you can look for a solution on the client but you can also do it on the server side.
One way to make it is to use phantomJS (which is a kind of webkit on the server) to rasterize the web page into an image on the server side. Could be really usefull to create features like "Export" etc
Phantom JS scree n capture
Related
This is for an offline application. However, I would like the front end to be run in a web browser. What I want is, a simple gui design in HTML/CSS. I want to be able to execute java commands at a button's press. Furthermore, I would like to be able to display and read information from the browser. Is this feasible?
You could use JxBrowser. The knowledge base contains some pretty good example. Unfortunately, it is not free though.
Likes to add screen shot submission for any bugs in my web application which developed using J2EE.That is if there is any bugs then client has the ability to take the screen shot of bug and submit for bug maintains.
So want a efficient mechanism to capture screen shot using JavaScript or Jquery since i want the screen shot of client using my web application.
Already tried with html2canvas.js but it doesn't work in IE8.Wants efficient solution that supports in IE8.
So please help me to find a solution for this.
excanvas.js can be used in html to support canvas.Even though you can't solve it for html2canvas in IE8.
I was wondering how I could embed a browser like view in a Java client application, at the same time that I can interact with it by means of JavaScript.
The problem that triggered this question is the following:
The interface of my application consists of a (Google) map and some svg stuff.
This is easy to do in a browser.
However, I also need access to some special Java libraries that can process some information from the map (e.g., certain coordinates in the map) and that answers values that should influence the browser view (e.g., a path should be drawn over the map).
My first idea was to implement the Java side behaviour as a REST web service, so from JavaScript I will invoke this webservice sending relevant information about the map and using the answer to update the map. Nevertheless, for my current needs (this is only a prototype) using webservices is a bit too much of infrastructure.
Is there a way I could just:
embed a browser like view in my Java application.
Interact from the Java side with this view by means of JavaScript functions implemented in the web page displayed in the browser view (such as these functions will influence the rendering of the page in the browser like view) ?.
I found other questions related to how to embed a browser in a swing application (e.g., Embedding web browser window in Java) and JDIC seems to be able to do this. Although some people report it is difficult to make it work in OSX (the OS I use) and do not mention if it is possible to interact with the browser by means of JavaScript.
It seems to me that in Android it is possible to make JavaScript calls from the Java (Android) side, so probably this is also possible in plain Java.
Thanks for any pointer !
With Java FX 2 you can. You get a webkit webview there. Can interact with it back and forth with java<->javascript.
For an example embedding google maps see: http://java-buddy.blogspot.se/2012/03/embed-google-maps-in-javafx-webview.html
You can embed java fx in swing with JFXPanel if you don't want to go with 100% JavaFX yet.
If you can use swt, take a look at SWT Browser widget
For javascript you can use
http://www.mozilla.org/rhino/
what is the current "state of art" to render a webpage in firefox into an image file (saved on disk). I want to implement something like "browsershots.org"
1.) Does firefox provide some API to interact with it?
2.) Does the new Canvas (HTML5) Element help here?
The programming language does not matter.
If you know any more information about this topic or a concrete solution, please help.
Uupdate: Yes, the Idea is to do this programatically, only using Technologies "within" Firefox. Further Ideal requirements: Multithreaded (allow rendering of several Websites in parallel on one machine)
Thanks very much, Markus
update: Yes, the Idea is to do this
programatically, only using
Technologies "within" Firefox.
See: https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas#Rendering_Web_Content_Into_A_Canvas
Mozilla's canvas is extended with the
drawWindow() method. This method draws
a snapshot of the contents of a DOM
window into the canvas.
Sounds good, but note that:
This feature is only available for
code running with Chrome privileges.
It is not allowed in normal HTML
pages. Read why.
Why reinvent the wheel?
Fireshot does exactly that: https://addons.mozilla.org/en-US/firefox/addon/fireshot/
Even if you want to implement that yourself, looking at that add-on might help.
Selenium RC is a good choice.
It allows you to control Firefox (and other browsers) using Java (for instance).
For example:
http://seleniumexamples.com/blog/examples/capturing-screenshots-from-remote-selenium-rc/
Is it possible to take a screen shot (using the Print Screen) and paste it from the System Clipboard directly into a web pages text area field (which I would create)? Do I need a browser plug-in? Can Flash do this?
**The solution only has to work in Internet Explorer.
This is not possible without a plugin.
It's not possible in Flash or Silverlight either, although it is possible in AIR.
I think you will have to write a custom ActiveX Control in order to do this. The control should automatically take a screenshot and send captured image to server-side code..
There is one more option - create a java applet, which will do the job, and also will help you to avoid cross browser issue.