Class PDFPanel

    • Field Detail

      • m_Controller

        protected org.icepdf.ri.common.SwingController m_Controller
        the component controller.
      • m_ViewerComponentPanel

        protected JPanel m_ViewerComponentPanel
        the viewer itself.
      • m_HasDocument

        protected boolean m_HasDocument
        whether a document is present.
    • Constructor Detail

      • PDFPanel

        public PDFPanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • setDocument

        public void setDocument​(String filename)
        Sets the document to display.
        Parameters:
        filename - the PDF document to display
      • setDocument

        public void setDocument​(File file)
        Sets the document to display.
        Parameters:
        file - the PDF document to display
      • getDocument

        public org.icepdf.core.pobjects.Document getDocument()
        Returns the currently displayed document.
        Returns:
        the PDF document, can be null if none set yet
      • closeDocument

        public void closeDocument()
        Closes the document.
      • setScale

        public void setScale​(double value)
        Sets the scaling factor (1 = default).
        Parameters:
        value - the scaling factor
      • getScale

        public double getScale()
        Returns the scaling factor (1 = default).
        Returns:
        the scaling factor
      • hasDocument

        public boolean hasDocument()
        Whether a document is present.
        Returns:
        true if document present
      • saveTo

        public String saveTo​(File file)
        Saves the document to the specified file.
        Parameters:
        file - the output file
        Returns:
        null if successful, otherwise error message
      • print

        public void print​(boolean withDialog)
        Prints the PDF.
        Parameters:
        withDialog - whether to show the print dialog
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler