now we print the javascript variable in the canvasįor(int i=0 isplit MoleculeString into multiple lines to enable explicit printout of \n Chemical drawing and publishing software for desktop, web and mobile. Writer.addChemObjectIOListener(listener) PropertiesListener listener = new PropertiesListener(customSettings) ICHEMLABS SERVICES ChemDoodle Web Components has built in access to the entire ChemDoodle desktop API through AJAX XMLHttpRequest Level 2 (XHR2) calls to our server. Properties customSettings = new Properties() ĬtProperty("ForceWriteAs2DCoordinates", "true") Our logos and links must be clearly visible on this page when requesting support.
MDLV2000Writer writer = new MDLV2000Writer(baos) The molecule (variable name "molecule" is assumed to have 2D coordinates, if it only has 3D coordinates it will not look very nice, and without coordinates it will not work at all.īyteArrayOutputStream baos = new ByteArrayOutputStream()
What ChemDoodle web components needs is actually a molfile with 2D coordinates on one line without line breaks (and explicit \n in place of the line breaks).
A very short description of how to get your CDK java code to output a canvas that can be displayed using the ChemDoodle web components java script library.