That should be fo:root not fot:root Sent from my iPhone 6s
> On Jan 6, 2016, at 3:41 AM, Tunahan Coban <tunahan.co...@coconet.de> wrote: > > Hi Simon, > > Thanks for your answer. But it doesn’t work when I add > font-family=”DejaVuSans” to fot:root. I deleted the <auto-detect/> too. > > Maybe my java-code has a problem? > > // TODO:Fonts configuration in work > DefaultConfigurationBuilder cfgBuilder = new > DefaultConfigurationBuilder(); > Configuration cfg = cfgBuilder.buildFromFile(new > File("cfg.xml")); > FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new > File(".").toURI()).setConfiguration(cfg); > > > final FopFactory fopFactory = FopFactory.newInstance(new > File(".").toURI()); > > > FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); > foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); > // fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) > > > OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); > > try { > > Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, > pdfOut); > > TransformerFactory factory = TransformerFactory.newInstance(); > Transformer transformer = factory.newTransformer(styleSheet); > transformer.setParameter("versionParam", "2.0"); > > Result fopResult = new SAXResult(fop.getDefaultHandler()); > > transformer.transform(xml, fopResult); > > > } finally { > pdfOut.close(); > } > > } catch (Exception e) { > e.printStackTrace(System.err); > } > } > > Thanks