OKバーコード4j-2.1とzxing-0.1.2を使用してFOP1.1でQRコードを生成する際に問題が発生しました。<prefer-renderer>true</prefer-renderer>
現在、fop構成ファイルに追加することで、FOP1.0の実装が正しく機能しています。
バーコード4jバーコードは、優先レンダラーが設定されているかどうかに関係なく機能します。これは、barcode4j-2.1で修正されています。
私はすべての必要な依存関係を持っています:
- fop-zxing-0.1.2-jar-with-dependencies.jar
- バーコード4j-fop-ext-complete.jar
- saxon9he.jar-xslt2.0に使用..。
バーコードスニペットは次のとおりです。
<fo:block>
<fo:instream-foreign-object>
<qr:qr-code xmlns:qr="http://hobbut.ru/fop/qr-code/"
width="5cm"
message="TEST DATA"
correction="m"
encoding="UTF-8">
</qr:qr-code>
</fo:instream-foreign-object>
</fo:block>
優先レンダラーを変換しようとしても効果がないように見える場合、次のエラーが発生します。
SEVERE: Image not available. URI: (instream-object). Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for null (No context info available)
org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for null
at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:180)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:296)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:203)
at org.apache.fop.render.intermediate.IFRenderer.renderForeignObject(IFRenderer.java:1290)
at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:820)
at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:785)
at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:866)
at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:678)
at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:913)
at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:643)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:561)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:598)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:980)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:546)
at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:451)
at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:738)
at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:428)
at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:352)
at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:299)
at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:748)
at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:273)
at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:238)
at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:597)
at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:193)
at org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:174)
at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:146)
at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:191)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:115)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:128)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:347)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:181)
at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:395)
at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:208)
at net.sf.saxon.event.ComplexContentOutputter.endElement(ComplexContentOutputter.java:459)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:304)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)
at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:212)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1034)
at net.sf.saxon.Controller.transformDocument(Controller.java:1959)
at net.sf.saxon.Controller.transform(Controller.java:1805)
at cwc.fop.util.templates.FOPConvert.translate(FOPConvert.java:116)
at cwc.fop.util.conversion.XML2PDF.translate(XML2PDF.java:151)
at cwc.fop.util.conversion.XML2PDF.translate(XML2PDF.java:114)
at cwc.fop.util.conversion.XML2PDF.translate(XML2PDF.java:65)
at cwc.fop.server.work.WorkerRunnable.run(WorkerRunnable.java:144)
at cwc.util.threading.WorkQueue$PoolWorker.run(WorkQueue.java:59)
助けてくれてありがとう