Kekule.js
Kekule.js copied to clipboard
how can i get the img or base64 data from ChemWidget Viewer
hi i'm using ChemWidget Viewer with Tool Button editObject, i want to get the img or base64 like the CKEditor example, thanks
There is a method of Viewer encapsulating that function:
var dataUri = viewer.exportToDataUri();
imgElem.setAttribute('src', dataUri);
thanks patridgejiang my finall code
var chemViewer = getChemViewer(); console.log(chemViewer.exportToDataUri( 'image/png'));