Kekule.js icon indicating copy to clipboard operation
Kekule.js copied to clipboard

how can i get the img or base64 data from ChemWidget Viewer

Open avrahamzvv opened this issue 5 years ago • 2 comments

hi i'm using ChemWidget Viewer with Tool Button editObject, i want to get the img or base64 like the CKEditor example, thanks

avrahamzvv avatar Apr 08 '20 18:04 avrahamzvv

There is a method of Viewer encapsulating that function:

var dataUri = viewer.exportToDataUri();
imgElem.setAttribute('src', dataUri);

partridgejiang avatar Apr 09 '20 09:04 partridgejiang

thanks patridgejiang my finall code

var chemViewer = getChemViewer(); console.log(chemViewer.exportToDataUri( 'image/png'));

avrahamzvv avatar May 02 '20 14:05 avrahamzvv