Hi, If I render the attached FO file into IF XML with the attached configuration file, then render the xml file into PDF, then I get the following error: SEVERE: Exception java.lang.NullPointerException: fontName must not be null at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.lang.NullPointerException: fontName must not be null at org.apache.fop.render.pdf.PDFPainter.getTypeface(PDFPainter.java:246) at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:269) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endElement(IFParser.java:487) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:277) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) ... 3 more
To reproduce: put the config file at the root of a FOP local copy, then run the following: fop -c config.xconf test.fo -if if.xml fop -c config.xconf -ifin if.xml test.pdf Did I miss anything? Thanks, Vincent
<?xml version="1.0"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="page" page-height="220pt" page-width="320pt" margin="10pt"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="page" language="en" country="GB"> <fo:flow flow-name="xsl-region-body" hyphenate="true" text-align="justify" font-family="DejaVu"> <fo:block>Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL formatting objects (XSL-FO) and an output independent formatter. It is a Java application that reads a formatting object (FO) tree and renders the resulting pages to a specified output.</fo:block> </fo:flow> </fo:page-sequence> </fo:root>
<?xml version="1.0" encoding="UTF-8"?> <fop version="1.0"> <use-cache>false</use-cache> <font-base>test/resources/fonts/</font-base> <renderers> <renderer mime="application/pdf"> <filterList> <value>null</value> </filterList> <filterList type="image"> <value>flate</value> <value>ascii-85</value> </filterList> <fonts> <font embed-url="DejaVuLGCSerif.ttf"> <font-triplet name="DejaVu" style="normal" weight="normal"/> </font> </fonts> </renderer> <renderer mime="application/X-fop-intermediate-format"> <fonts> <font embed-url="DejaVuLGCSerif.ttf"> <font-triplet name="DejaVu" style="normal" weight="normal"/> </font> </fonts> </renderer> </renderers> </fop>