PDF layer (Beta 1.0)
RReport provides a class called PDFLayer which can interface with several
PDF libraries in order to export your report to PDF. The current implementation
of the PDFLayer uses a slightly modified version of the library iText.
The library iText and the PDFLayer class for RReport are provided
under the GNU LIBRARY GENERAL PUBLIC LICENSE. A copy of the terms of licenses
are included in the downloadble zip file.
Features
The following limitations must be taken into account when exporting to PDF
using iText:
- The library requires jdk 1.2 or later.
- Images: the following images are not supported (according to the author
of the library):
- Gifs without a global colortable interlaced gifs
- gifs using local color table.
- JPG with of which the number of 'Bits Per Component' != 8
- JPG with 'invalid JPEG markers' (see the code of class Jpeg)
- PNGs with BitDepth == 16
- PNGs with another colortype than 0, 2 or 3
- interlaced PNGs
- Lines: dotted and dashed lines are not supported.
Download and installation
In order to install the library you must:
- download the zip file here.
The documentation of the library itself can be found here,
however you will not need it unless you want to change the PDFLayer class.
- unzip the downloaded file.
- copy the file rpdf.zip to the same directory where you installed
RReport.
Example
In order to export to PDF you must:
- set the name of the file with RReport.setPDFFile() method
- print or preview the report. The pdf file will be created at the same time
you preview or print the report.
- if you don't want to print nor preview the report, use the RReport.disablePrinting()
method.
A complete example can be found in the examplePDFOrder.java included in the
downloaded zip file. In order to run the example you must:
- Copy the files: runExamplePDF.Bat and examplePDFOrder.class
to the directory where RReport is installed.
- execute runExamplePDF.Bat.
- the file example.pdf will be created.
Changes to iText
The provided version of iText contains the following modifications:
- PdfDocument class: ability to print a table on specific absolute coordinates.
- PdfDocument class: deactivate the creation of new pages in the carriageReturn()
function.