Dear Ram,

On Fri, Sep 17, 2010 at 6:29 AM, ramgopal mettu
<chocolate.cu...@gmail.com> wrote:
> Hi All,
>  I've just started using RDKit and am finding it extremely useful,
> particularly for generating for depictions. I have a rather simple

I'm glad to hear it.

> question about generating PDFs. Is it possible to generate a PDF that
> is sized according to the molecule depicted? For example, if I
> execute:
>
> from rdkit.Chem import AllChem
> from rdkit.Chem import Draw
>
> smiles = "CN1C=NC2=C1C(=O)N(C(=O)N2C)C"
> mol = AllChem.MolFromSmiles(smiles)
> Draw.MolToFile(mol,"caffeine.pdf")
>
> I will get a PDF file that is a single letter size page - using the
> size option simply crops the image on the page. I'd like to use the
> figures I depict within a latex document, so being able to resize
> would be incredibly useful. Thanks!

If you install pycairo, Draw.MolToFile will use cairo to draw the
molecules and the pdfs should behave as you wish.

-greg

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to