That's exactly what I'd like -- to have an API and to be able to use that
API with JMol embedded in another application, in this case a JSP/Servlet
web application.

a very simple API would be something like
    byte[] imgData = JMol.renderJPEG(moleFileString);

Then I'd have the raw image byte data to stream back through the Servlet's
response.getOutputStream() method.
    response.setContentType("image/jpg");
    response.write(imgData);

Thanks,
Chris

On Dec 7, 2007 4:07 PM, Bob Hanson <[EMAIL PROTECTED]> wrote:

> Chris Stockton wrote:
>
> > Is there anyway of generating static images pro grammatically using
> JMol.
> >
> > I can generate them manually, using a command like: jmol.bat -s
> > script.spt -n -g200x200 JPEG:image.jpg -x
> > but I'm hoping that there is an API somewhere in JMol that would allow
> > me to generate a static image from a molfile or smiles string that I
> > could then stream to a web page.
> >
> >
> >
> say more about how you would want to interface with Jmol -- you mean a
> Java API with Jmol embedded in some other program? Do you mean having
> your server run Jmol "headless" and like above generating the JPEG? What
> would you like to do exactly? It's probably possible.
>
> Bob Hanson
>
> >------------------------------------------------------------------------
> >
> >-------------------------------------------------------------------------
> >SF.Net email is sponsored by:
> >Check out the new SourceForge.net Marketplace.
> >It's the best place to buy or sell services for
> >just about anything Open Source.
> >http://sourceforge.net/services/buy/index.php
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Jmol-users mailing list
> >Jmol-users@lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/jmol-users
> >
> >
>
>
> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to