You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2025/02/10 18:48:01 UTC

svn commit: r1923709 - /pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java

Author: tilman
Date: Mon Feb 10 18:48:00 2025
New Revision: 1923709

URL: http://svn.apache.org/viewvc?rev=1923709&view=rev
Log:
PDFBOX-5951: ignore OpenAction that points to orphan page

Modified:
    pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java

Modified: pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java?rev=1923709&r1=1923708&r2=1923709&view=diff
==============================================================================
--- pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java (original)
+++ pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java Mon Feb 10 18:48:00 2025
@@ -570,6 +570,11 @@ public class PDFMergerUtility
                 if (page != null)
                 {
                     pageIndexOpenActionDest = srcCatalog.getPages().indexOf(page);
+                    if (pageIndexOpenActionDest == -1)
+                    {
+                        LOG.warn("OpenAction entry ignored because destination page doesn't exist");
+                        openAction = null;
+                    }
                 }
             }