aboutsummaryrefslogtreecommitdiffstats
path: root/fop-core/src/main
diff options
context:
space:
mode:
authorSimon Steiner <ssteiner@apache.org>2023-03-30 07:45:01 +0100
committerSimon Steiner <ssteiner@apache.org>2023-03-30 07:45:01 +0100
commit45f68e349e3f870fee5d4604fcc8115938484c52 (patch)
tree6aa0d98d4e1bdaf161d1bd36c7764531014b59c7 /fop-core/src/main
parent8641fc6f0befc627895c1d54703186f4e17ee939 (diff)
downloadxmlgraphics-fop-45f68e349e3f870fee5d4604fcc8115938484c52.tar.gz
xmlgraphics-fop-45f68e349e3f870fee5d4604fcc8115938484c52.zip
FOP-3125: NPE when using broken link and PDF 1.5
Diffstat (limited to 'fop-core/src/main')
-rw-r--r--fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java1
-rw-r--r--fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java6
2 files changed, 7 insertions, 0 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
index ae2053061..09eb12c54 100644
--- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
+++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
@@ -183,6 +183,7 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
/** {@inheritDoc} */
public void endDocument() throws IFException {
+ documentNavigationHandler.registerIncompleteActions();
pdfDoc.getResources().addFonts(pdfDoc, fontInfo);
try {
if (pdfDoc.isLinearizationEnabled()) {
diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java
index 005c82a6f..552139980 100644
--- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java
+++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java
@@ -29,6 +29,7 @@ import org.apache.fop.pdf.PDFDocument;
import org.apache.fop.pdf.PDFFactory;
import org.apache.fop.pdf.PDFGoTo;
import org.apache.fop.pdf.PDFLink;
+import org.apache.fop.pdf.PDFObject;
import org.apache.fop.pdf.PDFOutline;
import org.apache.fop.pdf.PDFReference;
import org.apache.fop.pdf.PDFStructElem;
@@ -214,4 +215,9 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler
return action.getID();
}
+ public void registerIncompleteActions() {
+ for (Object action : incompleteActions.values()) {
+ getPDFDoc().addObject((PDFObject) action);
+ }
+ }
}