com.icesoft.faces.component.dataexporter

## Class PDFOutputHandler

- java.lang.Object
- - com.icesoft.faces.component.dataexporter.OutputTypeHandler
  - - com.icesoft.faces.component.dataexporter.PDFOutputHandler

-     public class PDFOutputHandler
      extends OutputTypeHandler

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `cellFont`
    `protected int` | `cellFontSize`
    `protected java.util.ArrayList` | `footers`
    `protected java.lang.String` | `headerFont`
    `protected int` | `headerFontSize`
    `protected java.util.ArrayList` | `headers`
    `protected java.lang.String` | `orientation`
    `protected java.lang.String` | `pageSize`
    `protected java.util.ArrayList` | `rowsOfData`
    `protected java.lang.String` | `title`

    - ### Fields inherited from class com.icesoft.faces.component.dataexporter.OutputTypeHandler

      `file, mimeType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFOutputHandler(java.lang.String path, java.lang.String title)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `applyDocumentProperties(java.lang.Object document)`
    `protected int` | `calculateColumnCount()`
    `protected float` | `calculateColumnWidth(int index)`
    `void` | `flushFile()`
    `protected static java.lang.String` | `nvl(java.lang.String stringValue)`
    `protected void` | `printHeaderTitle(java.lang.Object document, java.lang.String headerText)`
    `protected void` | `printPDF(java.io.OutputStream osPDF)`
    `protected int` | `printTableContents(java.lang.Object table, boolean wasHeader)`
    `protected void` | `printTableData(java.lang.Object document)`
    `protected boolean` | `printTableHeadersOrFooters(java.lang.Object table, java.lang.Object font, java.awt.Color backGroundColor, java.util.ArrayList headersOrFooters, int row)`
    `protected float` | `returnPDFWidth(int colLength)`
    `void` | `writeCell(java.lang.Object output, int col, int row)` The row indexing is zero based, from the perspective of the row data, ignoring how many rows were used for the header
    `void` | `writeFooterCell(java.lang.Object output, int col, int row)` The row indexing is zero based, from the perspective of the row data, ignoring how many rows were used for the header
    `void` | `writeHeaderCell(java.lang.String text, int col)`

    - ### Methods inherited from class com.icesoft.faces.component.dataexporter.OutputTypeHandler

      `getFile, getMimeType`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### title

          protected java.lang.String title

    - #### headers

          protected java.util.ArrayList headers

    - #### footers

          protected java.util.ArrayList footers

    - #### rowsOfData

          protected java.util.ArrayList rowsOfData

    - #### orientation

          protected java.lang.String orientation

    - #### pageSize

          protected java.lang.String pageSize

    - #### headerFont

          protected java.lang.String headerFont

    - #### cellFont

          protected java.lang.String cellFont

    - #### headerFontSize

          protected int headerFontSize

    - #### cellFontSize

          protected int cellFontSize

  - ### Constructor Detail

    - #### PDFOutputHandler

          public PDFOutputHandler(java.lang.String path,
                                  java.lang.String title)

  - ### Method Detail

    - #### writeCell

          public void writeCell(java.lang.Object output,
                                int col,
                                int row)

      The row indexing is zero based, from the perspective of the row data, ignoring how many rows were used for the header
      Specified by:
        `writeCell` in class `OutputTypeHandler`

    - #### writeHeaderCell

          public void writeHeaderCell(java.lang.String text,
                                      int col)

      Specified by:
        `writeHeaderCell` in class `OutputTypeHandler`

    - #### writeFooterCell

          public void writeFooterCell(java.lang.Object output,
                                      int col,
                                      int row)

      The row indexing is zero based, from the perspective of the row data, ignoring how many rows were used for the header
      Overrides:
        `writeFooterCell` in class `OutputTypeHandler`

    - #### flushFile

          public void flushFile()

      Specified by:
        `flushFile` in class `OutputTypeHandler`

    - #### printPDF

          protected void printPDF(java.io.OutputStream osPDF)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### applyDocumentProperties

          protected void applyDocumentProperties(java.lang.Object document)
                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### printHeaderTitle

          protected void printHeaderTitle(java.lang.Object document,
                                          java.lang.String headerText)
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### printTableData

          protected void printTableData(java.lang.Object document)
                                 throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### printTableHeadersOrFooters

          protected boolean printTableHeadersOrFooters(java.lang.Object table,
                                                       java.lang.Object font,
                                                       java.awt.Color backGroundColor,
                                                       java.util.ArrayList headersOrFooters,
                                                       int row)
                                                throws java.lang.Exception

      Parameters:
        `table` -
        `font` -
        `backGroundColor` -
        `headersOrFooters` -
        `row` -
      Returns:
        If there was a header/footer row printed
      Throws:
        `java.lang.Exception`

    - #### printTableContents

          protected int printTableContents(java.lang.Object table,
                                           boolean wasHeader)
                                    throws java.lang.Exception

      Parameters:
        `table` -
      Returns:
        Number of rows of data added to the table
      Throws:
        `java.lang.Exception`

    - #### calculateColumnCount

          protected int calculateColumnCount()

    - #### calculateColumnWidth

          protected float calculateColumnWidth(int index)
                                        throws java.lang.Exception

      Returns:
      Throws:
        `java.lang.Exception`

    - #### returnPDFWidth

          protected float returnPDFWidth(int colLength)

      Parameters:
        `colLength` -
      Returns:

    - #### nvl

          protected static java.lang.String nvl(java.lang.String stringValue)

Copyright 2025 ICEsoft Technologies Canada, Corp. All Rights Reserved.