### To PDF

To export the results of a report to PDF file, follow the steps below:

1. In JReport Designer, open the report set that contains the report you want to export.
2. On the report tab bar, click the tab that represents the report.
3. Click File > Export To > PDF.
4. In the Export to PDF dialog, specify the settings as required. See the dialog.

5. When done, click OK to generate the file.

See also Export to PDF dialog for detailed explanations about options in this dialog.

The following example shows how to export the results of a report to PDF format and view the exported result file, taking the sample report set CustomerAnalysis.cls in SampleReports.cat as an example:

1. Click File > Open on the menu bar.
2. In the Open Report Set dialog, click the Browse button to open the catalog file SampleReports.cat in `<install_root>\Demo\Reports\SampleReports`, then open CustomerAnalysis.cls in the catalog.
3. Click File > Export To > PDF to open the Export to PDF dialog.
4. Specify the path where the files will be exported and the file name as required. Here we use the default path `C:\JReport\Designer\Demo\Reports\SampleReports\` and default name CustomerAnalysis_CustomerAnalysis.pdf.
5. Make sure that TOC, Drilldown and Generate charts and barcodes using vector graphics are checked.
6. Check the Encrypt option to set the document open password and permissions password in the Encrypt dialog. See the dialog.

7. Check the Sign option to set a digital ID for the PDF file in the Sign Digital ID dialog. See the dialog.

8. When done, click OK to generate the files.
9. Open the directory `C:\JReport\Designer\Demo\Reports\SampleReports\` and fine the exported files.
10. Open the file CustomerAnalysis_CustomerAnalysis.pdf with the inputted document open password or permissions password using the Adobe Acrobat software.
11. The Table of Contents (TOC) is displayed in the left Bookmarks panel, and includes the names of both groups and subgroups. If you click a group, the contents will be shown in the right pane.
12. The signature is displayed in the left Security Settings panel, and all information you set can be found there.
13. Place the mouse pointer over a summary field. When it becomes a hand, click to view the details of the summary. See illustration.

    Note that summaries should be inserted into the report in advance. They cannot be hidden or suppressed; otherwise you will not be able to get the drill-down files.

    Also, since the option Generate charts and barcodes using vector graphics is checked when exporting the report, when zooming in the chart, you will find that the chart is a vector graphic which never distorts.

Notes:

- If you check Compress Image in the Export to PDF dialog, the transparent image will be compressed, but the transparent attribute will be ignored.
- JReport stores the finished pages in RAM before the pages are finally written to a PDF file. When the result file is too large, you may find that you are low on RAM, leading to an OutOfMemoryError. You can solve this problem by changing the maximum heap size (-Xmx100m). Also, you can use the old method (Simulated Printing).
- If the color mode of your display adapter is less than 256 colors, when you export to PDF file using the standard method, charts cannot be compressed. This is because JReport catches an image with less than 256 colors as a GIF image. A GIF image cannot be compressed.
- When you export a report which has summary fields, if the Drill Down checkbox is checked, every summary field in this report will generate a new file which is linked in the main file.
- In the Sign Digital ID dialog, by default, the information of Digital ID File and Password are checked. If there are any problems, the error messages will prompt you, such as Unable to import the chosen Digital ID file! or Incorrect password! and so on.
- Before exporting a report using true type fonts, you should select a report name in the Report Inspector, and then set Embeddedfonts equal to all true type fonts that you have used in the report. Otherwise the PDF files may not be displayed correctly.
- When you export a web control object, barcode or UDO to PDF, if you select Generate charts and barcodes using vector graphics, the results will be the vector graphic; if you select the Generate charts and barcodes using images, the results will be the bitmap.
- When a report, in which there is an object beyond its container, is exported to PDF, the overstepped part will be ignored in PDF file, but the overstepped part of objects in a paragraph can still be exported to PDF.
- In order to get a better effect, Acrobat Reader 6.0 is recommended.