de.vc.report.storages.pdf

## Class PDFMergeStorage

- java.lang.Object
- - de.vc.report.ReportStorage
  - - de.vc.report.storages.pdf.PDFMergeStorage

-     public class PDFMergeStorage
      extends ReportStorage

  The `PDFMergeStorage` concatenates single PDF reports to one large PDF file.
  This class uses the third party library iText.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFMergeStorage(java.io.OutputStream pdfOutput)` Creates a new `PDFMergeStorage`.
    `PDFMergeStorage(java.io.OutputStream pdfOutput, boolean startReportsOnOddPageNumber)` Creates a new `PDFMergeStorage`.
    `PDFMergeStorage(java.lang.String pdfOutputFile)` Creates a new `PDFMergeStorage`.
    `PDFMergeStorage(java.lang.String pdfOutputFile, boolean startReportsOnOddPageNumber)` Creates a new `PDFMergeStorage`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Deprecated. This method is invoked automatically by the report engine after all reports have been created.
    `protected void` | `finish()` Invoked by the report engine when all reports have been created.
    `int` | `getTotalNumberOfPages()` Gets the total number of pages.
    `void` | `storeReport(Report report, ReportContext info)` Invoked by the report engine to store a report.

    - ### Methods inherited from class de.vc.report.ReportStorage

      `init`

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

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

- - ### Constructor Detail

    - #### PDFMergeStorage

          public PDFMergeStorage(java.io.OutputStream pdfOutput)

      Creates a new `PDFMergeStorage`.
      Parameters:
        `pdfOutput` - Stream to merged PDF.

    - #### PDFMergeStorage

          public PDFMergeStorage(java.lang.String pdfOutputFile)
                          throws java.io.FileNotFoundException

      Creates a new `PDFMergeStorage`.
      Parameters:
        `pdfOutputFile` - Stream to merged PDF.
      Throws:
        `java.io.FileNotFoundException`

    - #### PDFMergeStorage

          public PDFMergeStorage(java.io.OutputStream pdfOutput,
                         boolean startReportsOnOddPageNumber)

      Creates a new `PDFMergeStorage`.
      Parameters:
        `pdfOutput` - Stream to merged PDF.
        `startReportsOnOddPageNumber` - Start each report on an odd page number (for duplex printing).

    - #### PDFMergeStorage

          public PDFMergeStorage(java.lang.String pdfOutputFile,
                         boolean startReportsOnOddPageNumber)
                          throws java.io.FileNotFoundException

      Creates a new `PDFMergeStorage`.
      Parameters:
        `pdfOutputFile` - Stream to merged PDF.
        `startReportsOnOddPageNumber` - Start each report on an odd page number (e.g. for duplex printing).
      Throws:
        `java.io.FileNotFoundException`

  - ### Method Detail

    - #### close

          public void close()
                     throws java.io.IOException

      Deprecated. This method is invoked automatically by the report engine after all reports have been created.
      Closes this storage and the PDF output stream. This method must always be called after all reports were generated.
      Throws:
        `java.io.IOException`

    - #### storeReport

          public void storeReport(Report report,
                         ReportContext info)
                           throws ReportException

      Description copied from class: `ReportStorage`
      Invoked by the report engine to store a report.
      Specified by:
        `storeReport` in class `ReportStorage`
      Parameters:
        `report` - Report
        `info` - Context of report
      Throws:
        `ReportException`

    - #### finish

          protected void finish()
                         throws ReportException

      Description copied from class: `ReportStorage`
      Invoked by the report engine when all reports have been created.
      Overrides:
        `finish` in class `ReportStorage`
      Throws:
        `ReportException`

    - #### getTotalNumberOfPages

          public int getTotalNumberOfPages()

      Gets the total number of pages.
      Returns:
        Total number of pages.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.