Class PDFGenerator

    • Field Detail

      • m_PageSize

        protected PageSize m_PageSize
        the page size.
      • m_PageOrientation

        protected PageOrientation m_PageOrientation
        the page orientation.
      • m_Proclets

        protected PdfProclet[] m_Proclets
        the PDF processors.
      • m_Document

        protected com.itextpdf.text.Document m_Document
        the documentation that is being worked on.
      • m_Writer

        protected com.itextpdf.text.pdf.PdfWriter m_Writer
        the writer.
    • Constructor Detail

      • PDFGenerator

        public PDFGenerator()
        Initializes the PDF generator.
    • Method Detail

      • reset

        protected void reset()
        Resets the variables and counters.
      • resetVariables

        protected void resetVariables()
        Resets the variables.
      • resetState

        protected void resetState()
        Resets the counters.
      • setPageSize

        public void setPageSize​(PageSize value)
        Sets the page size.
        Parameters:
        value - the size
      • getPageSize

        public PageSize getPageSize()
        Returns the page size.
        Returns:
        the size
      • setPageOrientation

        public void setPageOrientation​(PageOrientation value)
        Sets the page orientation.
        Parameters:
        value - the orientation
      • getPageOrientation

        public PageOrientation getPageOrientation()
        Returns the page orientation.
        Returns:
        the orientation
      • setOutput

        public void setOutput​(PlaceholderFile value)
        Sets the output file.
        Parameters:
        value - the file
      • getOutput

        public PlaceholderFile getOutput()
        Returns the output file.
        Returns:
        the file
      • setProclets

        public void setProclets​(PdfProclet[] value)
        Sets the processors.
        Parameters:
        value - the processors
      • getProclets

        public PdfProclet[] getProclets()
        Returns the processors.
        Returns:
        the processors
      • getDocument

        public com.itextpdf.text.Document getDocument()
        The current PDF document.
        Returns:
        the document
      • getState

        public DocumentState getState()
        Returns the PDF document state.
        Returns:
        the state
      • getWriter

        public com.itextpdf.text.pdf.PdfWriter getWriter()
        Returns the PDF writer.
        Returns:
        the writer
      • newPage

        public boolean newPage()
        Adds a new page.
        Returns:
        true if successfully added (or not necessary)
      • determinePageSize

        protected com.itextpdf.text.Rectangle determinePageSize()
        Returns the PageSize object based on the current setup.
        Returns:
        the page size rectangle
      • open

        public void open()
                  throws Exception
        Opens the document for writing.
        Throws:
        Exception - if opening fails
      • append

        public void append()
                    throws Exception
        Opens the document for appending content.
        Throws:
        Exception - if opening fails
      • isOpen

        protected boolean isOpen()
        Checks whether the document is still open.
        Returns:
        true if the document is still open
      • addFile

        public void addFile​(File file)
                     throws Exception
        Adds the file. Chooses the type of import based on the extension of the file.
        Parameters:
        file - the file to add
        Throws:
        Exception - if adding fails
      • addFiles

        public void addFiles​(File[] files)
                      throws Exception
        Adds the files. Chooses the type of import based on the extension of the file.
        Parameters:
        files - the files to add
        Throws:
        Exception - if adding fails
      • close

        public void close()
        Closes the document again.