pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1705729 - /pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/tools/PDFDebugger.java
Date Mon, 28 Sep 2015 17:39:17 GMT
Author: lehmi
Date: Mon Sep 28 17:39:17 2015
New Revision: 1705729

URL: http://svn.apache.org/viewvc?rev=1705729&view=rev
Log:
PDFBOX-2905: add a new comandline parameter to activate "View Pages" mode on startup

Modified:
    pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/tools/PDFDebugger.java

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/tools/PDFDebugger.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/tools/PDFDebugger.java?rev=1705729&r1=1705728&r2=1705729&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/tools/PDFDebugger.java (original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/tools/PDFDebugger.java Mon Sep 28
17:39:17 2015
@@ -113,6 +113,7 @@ public class PDFDebugger extends JFrame
                                  COSName.CALRGB, COSName.LAB));
 
     private static final String PASSWORD = "-password";
+    private static final String VIEWPAGES = "-viewpages";
 
     private static final int SHORCUT_KEY_MASK =
             Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
@@ -153,6 +154,15 @@ public class PDFDebugger extends JFrame
      */
     public PDFDebugger()
     {
+        this(false);
+    }
+
+    /**
+     * Constructor.
+     */
+    public PDFDebugger(boolean viewPages)
+    {
+        isPageMode = viewPages;
         initComponents();
     }
 
@@ -379,7 +389,14 @@ public class PDFDebugger extends JFrame
     private JMenu createViewMenu()
     {
         JMenu viewMenu = new JMenu("View");
-        viewModeItem = new JMenuItem("Show Pages");
+        if (isPageMode)
+        {
+            viewModeItem = new JMenuItem("Show Internal Structure");
+        }
+        else
+        {
+            viewModeItem = new JMenuItem("Show Pages");
+        }
         viewModeItem.addActionListener(new ActionListener()
         {
             @Override
@@ -1025,11 +1042,10 @@ public class PDFDebugger extends JFrame
             }
         });
         
-        final PDFDebugger viewer = new PDFDebugger();
-        
         // open file, if any
         String filename = null;
         String password = "";
+        boolean viewPages = false;
         
         for( int i = 0; i < args.length; i++ )
         {
@@ -1042,11 +1058,17 @@ public class PDFDebugger extends JFrame
                 }
                 password = args[i];
             }
+            else if( args[i].equals( VIEWPAGES ) )
+            {
+                viewPages = true;
+            }
             else
             {
                 filename = args[i];
             }
         }
+        final PDFDebugger viewer = new PDFDebugger(viewPages);
+        
         
         if (filename != null)
         {



Mime
View raw message