pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1846733 - /pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java
Date Fri, 16 Nov 2018 17:37:24 GMT
Author: tilman
Date: Fri Nov 16 17:37:24 2018
New Revision: 1846733

URL: http://svn.apache.org/viewvc?rev=1846733&view=rev
Log:
PDFBOX-4071: show outlines when opening (SO issue 53289020)

Modified:
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java?rev=1846733&r1=1846732&r2=1846733&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java
Fri Nov 16 17:37:24 2018
@@ -21,6 +21,7 @@ import java.io.IOException;
 
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.PageMode;
 import org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageDestination;
 import org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageFitWidthDestination;
 import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline;
@@ -84,6 +85,9 @@ public final class CreateBookmarks
                 }
                 pagesOutline.openNode();
                 outline.openNode();
+                
+                // optional: show the outlines when opening the file
+                document.getDocumentCatalog().setPageMode(PageMode.USE_OUTLINES);
 
                 document.save( args[1] );
             }



Mime
View raw message