Bad SVG output - difference between menu and automated

User 9d72be7cd4

16-07-2007 22:05:44

Having trouble with SVG output.





Structures with shortcut groups have strange things happen with SVG output via the API:





Code:
// Get molecule from MarvinSketch (ie, bean_73)


var mol = elements.bean_73.getMol()


// Convert to SVG


var SVG_image = mol.toBinFormat("svg:scale40,H_hetero,atsiz.6,wireThickness.1,mono");


// Later javascript saves it to a file.











When saving as image (SVG) via the Marvin Sketch window, they work great! Molecules without shortcut groups work fine, too.





When using the API for SVG (tobinFormat), however, the shortcut group doesn't seem to matter - it exports them expanded, messed up, or coordinates / angles are strange.





I've included a sample - a marvin file, an SVG from the menu, and an SVG via the API. I can provide further samples as well if it would help track down the problem.





What is going on here? Is there another method to better export SVG automatically via the API?





Thank you,





Nolan M.


Frontier Scientific





PS MarvinBeans we purchased work GREAT in our embedded application otherwise. Thanks for the great work!

ChemAxon e500b51457

17-07-2007 15:16:10

Dear Nolan,





That's certainly a bug in shortcut group handling. We are checking this problem. Could you provide further sample(s) to track down this problem? I tried to reproduce this behavior without success. Which version are you using?





Best regards,


Erika.

User 9d72be7cd4

17-07-2007 18:39:21

Erika,





Attached are more samples - both just simple rings with a single shortcut group added.





Again, the API output is garbled...while using the menu system works fine.





We're using 4.1.5, but I'll download the latest and try it in a test app with the api to see if there is the same behavior.





It seems as if the toBinFormat SVG method is "cleaning" the molecule, expanding Sgroups, but not correctly placing coordinates.





We'd rather have it not clean, and leave shortcut groups unexpanded unless they are on the canvas as well.





Thanks for any further info...I'll post here on my attempts with the latest version.





Thanks,





Nolan


Frontier Scientifc

User 9d72be7cd4

17-07-2007 19:58:54

Downloaded and test 4.1.10 and the SVG output is correct with no problems.





Re-tested using my original 4.1.5 download, and same problems.





Whatever it is, it's fixed in the current version.





I'll take the time and update our application with the new beans.





Thank you!





Nolan


Frontier Scientific, Inc.