Hello, It seems to be working for me. http://chemutils.florida.scripps.edu:8080/cdkexporter?structure=Cc1cc(O) no1&export=format:png,width:150,height:150
However, I have seen that kind of broken picture from time to time, particularly when the width/height is large. E.g. http://chemutils.florida.scripps.edu:8080/cdkexporter?structure=Cc1cc(O) no1&export=format:jpeg,width:3000,height:2000 but I don't see any exceptions being throw in the servlet log and haven't started to track it down. Has anyone seen this from the Cdk when using Renderer2D and Renderer2DModel outside of this code? ~Mark. -----Original Message----- From: Duan Lian [mailto:[EMAIL PROTECTED] Sent: Friday, June 27, 2008 11:26 PM To: Mark Southern Cc: [email protected]; Rajarshi Guha Subject: Re: [Cdk-user] Image export demo Hi Mark, I found a bug of this servlet. One instance of this servlet can not handle different kind of image size. By using ?structure=Cc1cc(O)no1&export=format:png,width:100,height:100, I got a normal image. But If I use ?structure=Cc1cc(O)no1&export=format:png,width:150,height:150 on the same servlet to get a bigger picture, I got a broken image(see attachment broken.png). Maybe you forget to set the background color to white again when image size changes. Hope you can fix it. Best Regards, Duan 2008/6/12 Mark Southern <[EMAIL PROTECTED]>: > Dear all, > > I've been playing around with some image/file generation from CDK, > starting with examples from Rajarshi's site. > > Highlights: > - There is an ExportFormat class to adjust the properties of the > Renderer2DModel class via a name/value pair string. The names closely > correspond to the methods of the Renderer2DModel class. Pairs are > separated by ',' and delimited by ':' so they can easily be used in a > Url. > - You can highlight a portion of the molecule. > - You can use ExportFormatHandler instances to register lots of > different image types. Implemented are those from javax.imageio (jpeg, > png, bmp, wbmp, gif) and org.freehep.vectorgrahics (emf, pdf, svg, > swf, ps), and also structure file based export for Molfiles and Smiles > (mol and smi). > - There is a Servlet example that you can GET/POST to. Examples below. > - LGPL'd Code is available as a maven based eclipse project: > http://chemutils.florida.scripps.edu:8080/cdkexporter/cdkexporter.zip > > I hope you find this interesting. > > Best regards, > > ~Mark. > > > Examples: > > A png image, with width and height specified > http://chemutils.florida.scripps.edu:8080/cdkexporter?structure=N1([CH > ]( > C(N[CH](C1=O)CCCC)=O)Cc1cc(c(cc1)O)O)C[CH]([CH](C(O)=O)Br)Br&highlight > =C 1=CC=CC=C1&export=format:png,width:350,height:350 > > A Molfile: > http://chemutils.florida.scripps.edu:8080/cdkexporter?structure=N1([CH > ]( > C(N[CH](C1=O)CCCC)=O)Cc1cc(c(cc1)O)O)C[CH]([CH](C(O)=O)Br)Br&export=fo > rm > at:mol > > An Extended MetaFile > http://chemutils.florida.scripps.edu:8080/cdkexporter?structure=N1([CH > ]( > C(N[CH](C1=O)CCCC)=O)Cc1cc(c(cc1)O)O)C[CH]([CH](C(O)=O)Br)Br&highlight > =C > 1=CC=CC=C1&export=format:emf,width:350,height:350,BondWidth:2.5 > > A PubChem CID: > http://chemutils.florida.scripps.edu:8080/cdkexporter?id=123456&type=c > id > > A PubChem SID: > http://chemutils.florida.scripps.edu:8080/cdkexporter?id=123456&type=s > id > > > ---------------------------------------------------------------------- > --- Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for just about anything > Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Cdk-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/cdk-user > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

