Pasting a Screen shot into a text area on a web page - java

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.

Related

Generating a hardcopy or screen shot using GWT

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

file upload in form field for mobile web app

i am developing mobile web app using spring(spring mvc). I need to devlope a form which enables the user to upload file(resume) and on submit it will be stored in database.
I am not getting the idea how to finish that!
In the form when i use input type as file, it's working in diffrent manner on diffrent browser. If any one have did it ,please tell me the steps or some working demo at any site.
yes i don't want to use some third party tool.
thanx.
Sorry dude, your kinda SOL on this one. The file input type is a different beast than most. Each browser implements it in their own way, so it will never look the same on multiple browsers. Also, for security reasons, you can't trigger the file inputs with JavaScript, so you can't make an invisible file input that you would interact with through other standard inputs. Many before you have tried, all have failed. I spent days researching possible alternatives when I had nothing better to do, and they all came up against the security issue. Jquery provides the closest thing but still required a browser switch for one of the major browsers (can't remember which one off the top of my head).
So now that the bad news is out of the way, here's what you can do. Put a button on the screen and style it how you like. Put a file input on the screen and using absolute positioning and a higher z-index put it right over the top of your button. Now make it transparent (not display none, but using opacity and filter:alpha styles), now the user thinks they are interacting with your standard button, but the invisible file input above it intercepts the click. Will be the closes you can get to a file input that behaves and looks the same in all browsers.

Capturing image from webcam

I'm trying to capture images by using webcam in an applet. The applet makes use of JMF. But I managed to run applet without actually installing JMF. I kept a button in HTML webpage so that when the button gets clicked, the applet should capture the image.
But for me it is giving a java.lang.RuntimeException: No permission to capture from applets. How can this exception be resolved so an applet can capture image using webcam in HTML page?
In order to capture images in an applet, it is necessary:
For you to digitally sign the code.
For the user to click "OK" when prompted to run the signed code.
If the functionality is being called from a button using JavaScript, wrap the Java code in one of the AccessController.doPrivileged(PrivilegedAction) variants.
AFAIR the installer for JMF does not have the 'allow capture from applets' checked by default. That needs to be reconfigured in the JMF options. I forget how.
Update
I dont want to give client package to extra overhead of the installation of JMF.
That is just silly.
The components of the JMF must be available on the run-time class-path of the applet, for it to function. If they are downloaded by the JRE using the applet element (or whatever), then the user has incurred that 'overhead'.
But perhaps you mean you don't want to make the end user run the installer that advises to 'reboot' at the end. In that case, you are missing my point while avoiding answering my question. That question, again, is "How did you get the DLL?".
Applets run with very limited permissions and that might be causing the issue.. Here is an old post which has information about signing an applet to get the necessary permissions..hope this helps
I think flash is a much better option. There are really easy solutions for that even using Javascript + Flash.
Take a look at this: http://www.xarg.org/project/jquery-webcam-plugin/
This question asked Too many times in this forum..
Anyways..Here is the solution: Java swing Program to capture webcam images
you have to modify it for applet which takes only 30 minutes

Can I enable intranet users to take screenshot of the current page via the browser?

Is it possible to create a screenshot from the current page the user is on? (It's for an Intranet enviroment).
I know this is not possible with JavaScript alone, but is it possible with Flash or maybe an Java applet?
I have been searching around but I couldn't find anything.
Thanks.
It might be possible to do in a Java applet that is signed. The Robot class has a method that makes it possible to capture the screen; Robot.createScreenCapture
You can send the page url to server side script or to an app on the server and return the full page screenshot image
A software product like Easy Capture allows Windows users to take a screen shot of the full screen, which can be useful in debugging.

Headless HTML rendering to image on CentOS 5.4

I have a project requirement to render HTML and capture the rendered image as a file on a headless CentOS 5.4 server. My specific requirements are:
1) Input will be a URL to the page to render (or file:// URL to a local HTML file), output will be an image file containing the rendered image of the page
2) CSS must be supported by the renderer up to CSS level-1
3) Static images in the page must be displayed properly in the rendered image, including any transparent color in .GIF or .PNG files
4) Must be able to run on a headless CentOS 5.4 server.
5) Solution must not depend on any product or component that is not free for commercial use
I do not need to do anything with the page other than get the screen capture and save it to an image. The hard part seems to be doing this in a headless environment. Some of the solutions that I've seen discussed need a display in order to work.
Any suggestions?
Thanks in advance,
Jim
SOLUTION:
I ended up using the Standard Widget Toolkit library (www.eclipse.org/swt) for its embedded browser capabilities. This allowed me to programmatically open a window with a browser control in it, render the page, then capture the content of the window to an image file (usually a PNG). The only downside to this approach that cannot be avoided is a "flicker" when the window must be made visible for a moment in order to do the screen capture. I can live with it. The rest was just code to initialize the SWT objects that obtain system resources, a listener to check for a successful completion of the page load, and some code to clean up a hung connection (when the page load never completes for whatever reason).
I got a teammate to play around with xvfb (X virtual framebuffer) on CentOS Linux. The initial tests appear to work, so it looks like the advice from the poster below (who said to try xvfb) may be a viable solution for the headless server part of my issue.
You can start a virtual X-windows environment using xvfb . You can now start a regular browser to render the page and use a screencapture utility to capture the content of the window. It is not pretty, but straghtforward to do.
WebKit is open-source and embeddable, maybe you can use this in a small native app to render on a canvas and save it to disk?

Categories

Resources