Depiction { public final String toPsStr() { return toVecStr(PS_FMT, UNITS_MM); } Depiction(RendererModel model); abstract BufferedImage toImg(); final String toSvgStr(); final String toSvgStr(String units); final String toPsStr(); final String toEpsStr(); final String toPdfStr(); final List<String> listFormats(); final void writeTo(String fmt, OutputStream out); final void writeTo(String fmt, File file); final void writeTo(String fmt, String path); final void writeTo(String path); static final String SVG_FMT; static final String PS_FMT; static final String EPS_FMT; static final String PDF_FMT; static final String JPG_FMT; static final String PNG_FMT; static final String GIF_FMT; static final String UNITS_MM; static final String UNITS_PX; }
@Test public void depictAsPs() throws CDKException { DepictionGenerator dg = new DepictionGenerator(); SmilesParser sp = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer ac = sp.parseSmiles("[nH]1cccc1"); String eps = dg.depict(ac).toPsStr(); String nl = System.getProperty("line.separator"); String lines[] = eps.split(nl,3); assertEquals("%!PS-Adobe-3.0", lines[0]); assertEquals("%%Creator: FreeHEP Graphics2D Driver", lines[1]); }