Class DocumentState

  • All Implemented Interfaces:
    Serializable

    public class DocumentState
    extends Object
    implements Serializable
    Container class for storing state information about the document currently being processed.
    Version:
    $Revision: 13473 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_NewPageAdded

        protected boolean m_NewPageAdded
        whether a new page got added.
      • m_TotalFiles

        protected int m_TotalFiles
        the files added so far.
      • m_CurrentFiles

        protected int m_CurrentFiles
        the files added since last page break.
    • Constructor Detail

      • DocumentState

        public DocumentState()
        Initializes the state.
    • Method Detail

      • newPage

        public boolean newPage​(com.itextpdf.text.Document doc)
        Adds a new page only if none has been added so far.
        Parameters:
        doc - the document to add the page to
        Returns:
        true if successfully added (or not necessary)
      • newPageAdded

        public void newPageAdded()
        Stores that a new page got added.
      • contentAdded

        public void contentAdded()
        Stores that content was added.
      • isNewPage

        public boolean isNewPage()
        Returns whether a new page was just added.
        Returns:
        true if a new page was just added
      • addFile

        public void addFile()
        Increments the file counters.
      • resetCurrentFiles

        public void resetCurrentFiles()
        Resets the counter for the current files.
      • numTotalFiles

        public int numTotalFiles()
        Returns the number of files that have been added so far.
        Returns:
        the number of files
      • numCurrentFiles

        public int numCurrentFiles()
        Returns the number of files that have been added since the last page break.
        Returns:
        the number of files
      • toString

        public String toString()
        Returns a short representation of the document state.
        Overrides:
        toString in class Object
        Returns:
        the representation