Hi,
I am new to fop and have the following problem:
I have an .xml and an .xsl file along with a fop configuration file:
<?xml version="1.0"?>
<fop version="1.0">
<!-- Base URL for resolving relative URLs -->
<base>.</base>
<renderers>
<renderer mime="application/pdf">
<fonts>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
When I use the fop command line tool to create pdf, then everything is
ok, the pdf output looks perfect.
Now I want to do the same from java:
File xmlfile = new File("Export.xml");
File xsltfile = new File("Export.xsl");
File pdffile = new File("Export.pdf");
File fopconf = new File("fop.xconf");
final FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
OutputStream out=null;
try {
out = new java.io.FileOutputStream(pdffile);
out = new java.io.BufferedOutputStream(out);
Fop fop;
try {
fop = fopFactory.newFop(MimeConstants.MIME_PDF,
foUserAgent, out);
fopFactory.setUserConfig(fopconf);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new
StreamSource(xsltfile));
Source src = new StreamSource(xmlfile);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
} finally {
out.close();
}
} catch (Exception e) {
e.printStackTrace();
}
When I run it, I get the following errors:
Apr 05, 2013 9:04:18 AM org.apache.fop.events.LoggingEventListener
processEvent
WARNING: Font "Arial,normal,400" not found. Substituting with
"any,normal,400".
Apr 05, 2013 9:04:19 AM org.apache.fop.events.LoggingEventListener
processEvent
WARNING: Glyph "ű" (0x171, udblacute) not available in font "Times-Roman".
Apr 05, 2013 9:04:19 AM org.apache.fop.events.LoggingEventListener
processEvent
WARNING: Glyph "ő" (0x151, odblacute) not available in font "Times-Roman".
In the pdf output the named characters are replaced with #.
Could you please give me any hint what I am missing or doing wrong here?
Thank you for your help!
Áron Takács
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org