我使用FOP 2.2在Eclipse中创建了一个项目。项目创建的PDF文件中需要条形码和QR码。 Barcode4j能够创建条形码,但是,只有存在zxing核心才会创建qr代码,基于此,需要从CVS Repository下载Apache FOP 1.1 QRCodes with zxing。我做了这篇文章中所说的所有内容,但是当我尝试创建一个qr代码时
<fo:block>
<fo:instream-foreign-object>
<barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="test">
<barcode:qr/>
</barcode:barcode>
</fo:instream-foreign-object>
</fo:block>
我收到错误。
org.krysalis.barcode4j.BarcodeException: No barcode configuration element not found
at org.krysalis.barcode4j.BarcodeUtil.createBarcodeGenerator(BarcodeUtil.java:110)
at org.krysalis.barcode4j.BarcodeUtil.createBarcodeGenerator(BarcodeUtil.java:146)
at org.krysalis.barcode4j.fop.BarcodeElement.getDimension(BarcodeElement.java:76)
at org.apache.fop.fo.flow.InstreamForeignObject.prepareIntrinsicSize(InstreamForeignObject.java:112)
at org.apache.fop.fo.flow.InstreamForeignObject.getIntrinsicWidth(InstreamForeignObject.java:125)
at org.apache.fop.layoutmgr.inline.AbstractGraphicsLayoutManager.getInlineArea(AbstractGraphicsLayoutManager.java:60)
at org.apache.fop.layoutmgr.inline.AbstractGraphicsLayoutManager.getNextKnuthElements(AbstractGraphicsLayoutManager.java:116)
at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:698)
at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:627)
at org.apache.fop.layoutmgr.BlockLayoutManager.getNextChildElements(BlockLayoutManager.java:141)
at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:289)
at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:113)
at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105)
at org.apache.fop.layoutmgr.table.TableCellLayoutManager.getNextKnuthElements(TableCellLayoutManager.java:191)
at org.apache.fop.layoutmgr.table.RowGroupLayoutManager.createElementsForRowGroup(RowGroupLayoutManager.java:120)
at org.apache.fop.layoutmgr.table.RowGroupLayoutManager.getNextKnuthElements(RowGroupLayoutManager.java:63)
at org.apache.fop.layoutmgr.table.TableContentLayoutManager.getKnuthElementsForRowIterator(TableContentLayoutManager.java:270)
at org.apache.fop.layoutmgr.table.TableContentLayoutManager.getNextKnuthElements(TableContentLayoutManager.java:212)
at org.apache.fop.layoutmgr.table.TableLayoutManager.getNextKnuthElements(TableLayoutManager.java:272)
at org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:223)
at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:147)
at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:116)
at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69)
at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:251)
at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:770)
at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:178)
at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:158)
at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:389)
at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:141)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:263)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1401)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253)
at embedding.ExampleXML2PDF.main(ExampleXML2PDF.java:99)
我想了解此错误的原因,并了解是否有其他方法可以使用FOP生成条形码和qr代码。