hmm,

On Wed, Feb 12, 2014 at 5:01 PM, Michał Nowotka <[email protected]> wrote:

> import cairo
> from rdkit import Chem
> import StringIO
> from rdkit.Chem.Draw import cairoCanvas
>
> imageData = StringIO.StringIO()
> surf = cairo.SVGSurface(imageData,200,200)
> ctx = cairo.Context(surf)
> mol =
> Chem.MolFromSmiles("O=C(O)C2N3C(=O)C(NC(=O)C(c1ccc(O)cc1)NC(=O)C(N)CC(=O)NC)C3SC2(C)C")
> canv = cairoCanvas.Canvas(ctx=ctx, size=(200,200), imageType='svg')
> Chem.Draw.MolToImage(mol, size=(200,200), canvas=canv)
> canv.flush()
> surf.finish()
> imageData.getvalue()


Which version of the code are you using? I don't see the problem.

Here's the end of your example (pasted into an ipython prompt) on my Mac
using the github head:

In [13]: imageData.getvalue()
Out[13]: '<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="
http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";
width="200pt" height="200pt" viewBox="0 0 200 200"
version="1.1">\n<defs>\n<g>\n<symbol overflow="visible"
id="glyph0-0">\n<path style="stroke:none;" d=""/>\n</symbol>\n

....

67.949219 83.730469 L 64.964844 87.050781 "/>\n<path
style="fill:none;stroke-width:1.2;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,100%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 64.964844 87.050781 L 61.980469 90.371094 "/>\n</g>\n</svg>\n'

In [14]:

-greg
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to