Class PDFDebugger

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Callable<Integer>, EventListener, Accessible, HyperlinkListener, RootPaneContainer, WindowConstants

public class PDFDebugger extends JFrame implements Callable<Integer>, HyperlinkListener
PDF Debugger.
See Also:
  • Field Details

    • LOG

      private static org.apache.commons.logging.Log LOG
    • SPECIALCOLORSPACES

      private static final Set<COSName> SPECIALCOLORSPACES
    • OTHERCOLORSPACES

      private static final Set<COSName> OTHERCOLORSPACES
    • PDF_FILTER

      private static final FileFilter PDF_FILTER
    • shortcutKeyMask

      private int shortcutKeyMask
    • OS_NAME

      private static final String OS_NAME
    • IS_MAC_OS

      private static final boolean IS_MAC_OS
    • documentPanel

      private final JPanel documentPanel
    • statusPane

      private TreeStatusPane statusPane
    • recentFiles

      private RecentFiles recentFiles
    • windowPrefs

      private WindowPrefs windowPrefs
    • document

      private PDDocument document
    • currentFilePath

      private String currentFilePath
    • jScrollPaneRight

      private JScrollPane jScrollPaneRight
    • jSplitPane

      private JSplitPane jSplitPane
    • jTextPane

      private JTextPane jTextPane
    • statusBar

      private ReaderBottomPanel statusBar
    • tree

      private Tree tree
    • saveAsMenuItem

      private JMenuItem saveAsMenuItem
    • recentFilesMenu

      private JMenu recentFilesMenu
    • printMenuItem

      private JMenuItem printMenuItem
    • printDpiMenu

      private JMenu printDpiMenu
    • reopenMenuItem

      private JMenuItem reopenMenuItem
    • findMenu

      private JMenu findMenu
    • findMenuItem

      private JMenuItem findMenuItem
    • findNextMenuItem

      private JMenuItem findNextMenuItem
    • findPreviousMenuItem

      private JMenuItem findPreviousMenuItem
    • currentTreeViewMode

      private String currentTreeViewMode
    • SYSERR

      private final PrintStream SYSERR
    • usageHelpRequested

      boolean usageHelpRequested
    • password

      private String password
    • viewstructure

      private boolean viewstructure
    • infile

      private File infile
    • configuration

      public static final Properties configuration
    • spec

      picocli.CommandLine.Model.CommandSpec spec
  • Constructor Details

    • PDFDebugger

      public PDFDebugger()
      Constructor.
    • PDFDebugger

      public PDFDebugger(String initialViewMode)
      Constructor.
      Parameters:
      initialViewMode - initial view mode for the tree view on the left hand side.
  • Method Details

    • main

      public static void main(String[] args)
      Entry point.
      Parameters:
      args - the command line arguments
    • call

      public Integer call()
      Specified by:
      call in interface Callable<Integer>
    • getTreeViewMode

      public String getTreeViewMode()
      Provide the current view mode of the tree view. see TreeViewMenu for valid values
    • setTreeViewMode

      public void setTreeViewMode(String viewMode)
      Set the current view mode of the tree view. see TreeViewMenu for valid values
      Parameters:
      viewMode - the view mode to be set
    • hasDocument

      public boolean hasDocument()
    • loadConfiguration

      private void loadConfiguration()
      Loads the local configuration file, if any.
    • initComponents

      private void initComponents()
      This method is called from within the constructor to initialize the form.
    • initGlobalEventHandlers

      protected void initGlobalEventHandlers()
      Initialize application global event handlers. Protected to allow subclasses to override this method if they don't want the global event handler overridden.
    • createFileMenu

      private JMenu createFileMenu()
    • createEditMenu

      private JMenu createEditMenu()
    • createFindMenu

      private JMenu createFindMenu()
    • getFindMenu

      public JMenu getFindMenu()
      Returns the File menu.
      Returns:
      the File menu
    • getFindMenuItem

      public JMenuItem getFindMenuItem()
      Returns the Edit > Find > Find menu item.
      Returns:
      the Find menu
    • getFindNextMenuItem

      public JMenuItem getFindNextMenuItem()
      Returns the Edit > Find > Find Next menu item.
      Returns:
      the FindNext menu
    • getFindPreviousMenuItem

      public JMenuItem getFindPreviousMenuItem()
      Returns the Edit > Find > Find Previous menu item.
      Returns:
      the FindPrevious menu
    • osxOpenFiles

      private void osxOpenFiles(String filename)
      This method is called via reflection on Mac OS X.
    • osxQuit

      private void osxQuit()
      This method is called via reflection on Mac OS X.
    • saveAsMenuItemActionPerformed

      private void saveAsMenuItemActionPerformed(ActionEvent evt)
    • openMenuItemActionPerformed

      private void openMenuItemActionPerformed(ActionEvent evt)
    • jTree1ValueChanged

      private void jTree1ValueChanged(TreeSelectionEvent evt)
    • isSpecialColorSpace

      private boolean isSpecialColorSpace(Object selectedNode)
    • isOtherColorSpace

      private boolean isOtherColorSpace(Object selectedNode)
    • isPage

      private boolean isPage(Object selectedNode)
    • isFlagNode

      private boolean isFlagNode(Object selectedNode, Object parentNode)
    • isEncrypt

      private boolean isEncrypt(Object obj)
    • isFontDescriptor

      private boolean isFontDescriptor(Object obj)
    • isAnnot

      private boolean isAnnot(Object obj)
    • isStream

      private boolean isStream(Object selectedNode)
    • isString

      private boolean isString(Object selectedNode)
    • isFont

      private boolean isFont(Object selectedNode)
    • isCIDFont

      private boolean isCIDFont(COSDictionary dic)
    • showColorPane

      private void showColorPane(Object csNode) throws IOException
      Show a Panel describing color spaces in more detail and interactive way.
      Parameters:
      csNode - the special color space containing node.
      Throws:
      IOException
    • showPage

      private void showPage(Object selectedNode)
    • showFlagPane

      private void showFlagPane(Object parentNode, Object selectedNode)
    • showStream

      private void showStream(COSStream stream, TreePath path) throws IOException
      Throws:
      IOException
    • showFont

      private void showFont(Object selectedNode, TreePath path)
    • replaceRightComponent

      private void replaceRightComponent(Component pane)
    • showString

      private void showString(Object selectedNode)
    • getNodeKey

      private COSName getNodeKey(Object selectedNode)
    • getUnderneathObject

      private COSBase getUnderneathObject(Object selectedNode)
    • convertToString

      private String convertToString(Object selectedNode)
    • exitMenuItemActionPerformed

      private void exitMenuItemActionPerformed(ActionEvent ignored)
    • performApplicationExit

      protected void performApplicationExit()
      Exit the application after the window is closed. This is protected to let subclasses override the behavior.
    • printMenuItemActionPerformed

      private void printMenuItemActionPerformed(ActionEvent evt)
    • readPDFFile

      private void readPDFFile(String filePath, String password) throws IOException, URISyntaxException
      Throws:
      IOException
      URISyntaxException
    • readPDFFile

      private void readPDFFile(File file, String password) throws IOException, URISyntaxException
      Throws:
      IOException
      URISyntaxException
    • readPDFurl

      private void readPDFurl(String urlString, String password) throws IOException, URISyntaxException
      Throws:
      IOException
      URISyntaxException
    • initTree

      public void initTree()
    • addRecentFileItems

      private void addRecentFileItems()
    • getPageLabel

      public static String getPageLabel(PDDocument document, int pageIndex)
      Convenience method to get the page label if available.
      Parameters:
      document - the current document
      pageIndex - 0-based page number.
      Returns:
      a page label or null if not available.
    • textDialog

      private void textDialog(String title, URL resource)
    • hyperlinkUpdate

      public void hyperlinkUpdate(HyperlinkEvent he)
      Specified by:
      hyperlinkUpdate in interface HyperlinkListener