Error trying to create PDF with accessibility

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error trying to create PDF with accessibility

Esteban R

Hello I'm working in a quite complex java (1.8.0_112) project, using apache-fop 2.2. Windows 10 OS.


It seems that the <accessibility> tag is ignored in the xconf file so I had to enable it programatically.


After that, I get the following exception when rendering pdf with accessibility enabled:


java.lang.NullPointerException
        at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:422)
        at org.apache.fop.render.intermediate.IFRenderer$TextUtil.flush(IFRenderer.java:1236)
        at org.apache.fop.render.intermediate.IFRenderer.renderText(IFRenderer.java:1063)
        at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:701)
        at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)
        at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:344)
        at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:308)
        at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)
        at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:263)
        at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:244)
        at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
        at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
        at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:226)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:145)
        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)
       ... (my classes)
nov 07, 2017 7:54:38 PM org.apache.fop.fo.FOTreeBuilder fatalError
GRAVE: org.xml.sax.SAXParseException; systemId: file:///C:/Users/complete_file_name.fo; lineNumber: 160; columnNumber: 82; java.lang.NullPointerException

The above-mentioned line 160 is:

      <fo:page-sequence master-reference="onlySeq" language="fr-FR" country="fr">



Maybe I'm missing something? I may try to create a full example if needed.


Esteban

Reply | Threaded
Open this post in threaded view
|

Error trying to create PDF with accessibility

Esteban R

Hello I'm working in a quite complex java (1.8.0_112) project, using apache-fop 2.2. Windows 10 OS.


It seems that the <accessibility> tag is ignored in the xconf file so I had to enable it programatically.


After that, I get the following exception when rendering pdf with accessibility enabled:


java.lang.NullPointerException
        at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:422)
        at org.apache.fop.render.intermediate.IFRenderer$TextUtil.flush(IFRenderer.java:1236)
        at org.apache.fop.render.intermediate.IFRenderer.renderText(IFRenderer.java:1063)
        at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:701)
        at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)
        at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:344)
        at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:308)
        at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)
        at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:263)
        at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:244)
        at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
        at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
        at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:226)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:145)
        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)
       ... (my classes)
nov 07, 2017 7:54:38 PM org.apache.fop.fo.FOTreeBuilder fatalError
GRAVE: org.xml.sax.SAXParseException; systemId: file:///C:/Users/complete_file_name.fo; lineNumber: 160; columnNumber: 82; java.lang.NullPointerException

The above-mentioned line 160 is:

      <fo:page-sequence master-reference="onlySeq" language="fr-FR" country="fr">



Maybe I'm missing something? I may try to create a full example if needed.


Esteban

Reply | Threaded
Open this post in threaded view
|

Re: Error trying to create PDF with accessibility

Szeak (Register Man)
In reply to this post by Esteban R
Hi Esteban,

It seems like an XML parsing error. Have you checked your FO file is well-formed? (Rename extension to XML and Open it in a browser ie: firefox or chrome)

By, Szeak

2017-11-08 00:13 keltezéssel, Esteban R írta:

Hello I'm working in a quite complex java (1.8.0_112) project, using apache-fop 2.2. Windows 10 OS.


It seems that the <accessibility> tag is ignored in the xconf file so I had to enable it programatically.


After that, I get the following exception when rendering pdf with accessibility enabled:


java.lang.NullPointerException
        at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:422)
        at org.apache.fop.render.intermediate.IFRenderer$TextUtil.flush(IFRenderer.java:1236)
        at org.apache.fop.render.intermediate.IFRenderer.renderText(IFRenderer.java:1063)
        at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:701)
        at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)
        at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:344)
        at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:308)
        at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)
        at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:263)
        at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:244)
        at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
        at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
        at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:226)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:145)
        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)
       ... (my classes)
nov 07, 2017 7:54:38 PM org.apache.fop.fo.FOTreeBuilder fatalError
GRAVE: org.xml.sax.SAXParseException; systemId: file:///C:/Users/complete_file_name.fo; lineNumber: 160; columnNumber: 82; java.lang.NullPointerException

The above-mentioned line 160 is:

      <fo:page-sequence master-reference="onlySeq" language="fr-FR" country="fr">



Maybe I'm missing something? I may try to create a full example if needed.


Esteban


--------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Error trying to create PDF with accessibility

Esteban R

I don't think so: the same .fo works fine when accessibility is disabled. Anyways I have renamed it and I could open it in Chrome without any errors.


Esteban




De: Szeak (Register Man) <[hidden email]>
Enviado: miércoles, 08 de noviembre de 2017 01:11 p.m.
Para: [hidden email]
Asunto: Re: Error trying to create PDF with accessibility
 
Hi Esteban,

It seems like an XML parsing error. Have you checked your FO file is well-formed? (Rename extension to XML and Open it in a browser ie: firefox or chrome)

By, Szeak

2017-11-08 00:13 keltezéssel, Esteban R írta:

Hello I'm working in a quite complex java (1.8.0_112) project, using apache-fop 2.2. Windows 10 OS.


It seems that the <accessibility> tag is ignored in the xconf file so I had to enable it programatically.


After that, I get the following exception when rendering pdf with accessibility enabled:


java.lang.NullPointerException
        at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:422)
        at org.apache.fop.render.intermediate.IFRenderer$TextUtil.flush(IFRenderer.java:1236)
        at org.apache.fop.render.intermediate.IFRenderer.renderText(IFRenderer.java:1063)
        at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:701)
        at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)
        at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:344)
        at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:308)
        at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)
        at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:263)
        at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:244)
        at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
        at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
        at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:226)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:145)
        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)
       ... (my classes)
nov 07, 2017 7:54:38 PM org.apache.fop.fo.FOTreeBuilder fatalError
GRAVE: org.xml.sax.SAXParseException; systemId: file:///C:/Users/complete_file_name.fo; lineNumber: 160; columnNumber: 82; java.lang.NullPointerException

The above-mentioned line 160 is:

      <fo:page-sequence master-reference="onlySeq" language="fr-FR" country="fr">



Maybe I'm missing something? I may try to create a full example if needed.


Esteban


--------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]