Details
-
Bug
-
Status: Resolved
-
Resolution: Fixed
-
1.0
-
None
-
None
-
Operating System: Windows XP
Platform: PC
-
51836
Description
A NullPointerException was encountered when trying to generate a PDF from a modified FOP IF file. The IF file was systematically manipulated to delete some of the <page-sequence> and <page> elements. The exception was the result of <nav:> elements that reference content that no longer exists in the IF file. Stripping all <nav:> elements from the IF file avoids the exception. There may be a more graceful way of handling this than a NullPointerException.
The specific error I get when trying to generate the PDF is:
Caused by: java.lang.NullPointerException
at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.updateTargetLocation(PDFDocumentNavigationHandler.java:188)
at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.getAction(PDFDocumentNavigationHandler.java:160)
at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.renderLink(PDFDocumentNavigationHandler.java:108)
at org.apache.fop.render.intermediate.extensions.DocumentNavigationHandler.endElement(DocumentNavigationHandler.java:186)
[rest of stack omitted]
I believe the NullPointerException occurs on this line in PDFDocumentNavigationHandler.java:
action.getTargetLocation().x / 1000.0