Exporting from Jmol applet or JSmol an image of the current view
cloning the Jmol model in a larger, resizable, pop-up window
Updated to JSmol 14.4
Older versions of this proof-of-concept page.
- Windows XP/7: Firefox ≥4?, ≥16, Chrome ≥8?, ≥12, Opera ≥9.5, Internet Explorer ≥9
However, some Jmol modes are not available (nothing to do with the image capture mechanism):
- JSmol WebGL image capture in Chrome requires a patch in JSmolGLmol.js
- JSO-HTML5 and JSO-WebGL are not working in Opera
- JSO-WebGL is not working in IE≤9 -- reportedly there is no WebGL support in IE≤10
- JSO-HTML5 is not working in IE≤8
- JSO-WebGL is not working in Safari 5.1.7 -- reportedly there is no WebGL support in Safari except for Mac OS Snow Leopard
- JSO-Java is not working in Safari 5.1.7
- Mac OSX: ? hopefully it should work in Safari, Chrome and Firefox
- Linux: ? hopefully it should work in Chrome and Firefox
- Test results in other browsers and operating systems are welcome; please report to angel.herraez[at]uah.es
- If it does not work in your browser, please report so that we can improve this mechanism; provide browser name, version nr., and the value of navigator.userAgent
(get this value)
On-line / Off-line
- No access to server configuration is needed (i.e., no need to install server-side scripts).
- If the browser is MS Internet Explorer, it needs online access to a PHP-enabled server that will return the image using a php page which is part of this package.
- If the browser is another, inline base64-encoded images will be used first (understood by Firefox and Opera, at least). This method works both online and off-line (e.g., from hard disk, USB disk or CDROM).
- Note, however, that JSmol (non-Java JSO) may not work from hard disk and need a server (or a local server)
- The image may be copied to clipboard using the browser's pop-up menu on it. Some browsers also allow to save the image to disk, from the same pop-up menu.
Copies applet size
- The size of the applet is automatically used for the image (tested from 50 to 1000 pixels, may be more depending on Java memory). The applet may be square or rectangular, and may be sized in pixels or percent.
- This work has been authored by Angel Herráez, from Universidad de Alcalá in Spain. Some ideas came from "Base64 encoded images for Internet Explorer", by Dean Edwards, others from generic web searching and, over all, much head scratching and testing. Version 3 of base64.php is the result of a modification by Steven Spilatro, from Marietta College in the USA, and is shared between this page and Steven's.
- I have put the resulting code under Creative Commons License, so that others can
- use it for free,
- modifiy it to suit their needs as long as it is kept under the same licence terms,
- not make any money out of it.
- Any other use must have the previous approval of the author.
- Not yet available for this version (but you can check the page source code).
“Exporting an image of the current view from Jmol applet” and “Cloning the Jmol model in a larger, resizable, pop-up window” by
Angel Herráez are licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 Spain License.
Permissions beyond the scope of this license may be available at
http://biomodel.uah.es/, where you may contact the author.