PDF Bookmarks and Hyperlinks
PDF format supports bookmarks. Bookmarks are basically a hyperlinked Table of Contents displayed in a separate view than the document. Users can use the bookmark items to navigate the document. To produce a PDF files with bookmarks, use PDF3Generator.
import inetsoft.report.pdf.*;
...
FileOutputStream pdffile = ;
PDF3Generator pdf =
PDF3Generator.getPDFGenerator(pdffile);
ReportSheet report = ;
pdf.generate(report);
// no close() necessary
To prevent the generation of bookmarks entirely, use the PDF3Printer instead of PDF3Generator.
If the report contains heading elements, including heading elements in subreports, these are converted into PDF bookmarks. To ignore heading elements in subreports, set the selectiveBookmarks property to true.
PDF3Generator.setSelectiveBookmarks(true);
boolean selective = PDF3Generator.isSelectiveBookmarks();
To initialize PDF bookmarks in their “open” state, set the pdf.open.bookmark property to true by using the setOpenBookmark() method of PDFPrinter. To check the current value of the pdf.open.bookmark property, use the isOpenBookmark() method of PDFPrinter.
PDFPrinter.setOpenBookmark(true);
boolean openBookmark = PDFPrinter.isOpenBookmark();
Similarly, to initialize PDF thumbnails in their “open” state, set the pdf.open.thumbnail property to true by using the setOpenThumbnail() method of PDFPrinter. To check the current value of the pdf.open.thumbnail, use the isOpenThumbnail() method of PDFPrinter.
PDFPrinter.setOpenThumbnail(true);
boolean openThumbnail = PDFPrinter.isOpenThumbnail();
Note that the pdf.open.bookmark and pdf.open.thumbnail properties are mutually exclusive. In the case where both are set to true, the pdf.open.bookmark setting will take priority.
The PDF document can also reproduce hyperlinks contained the report. A report property, pdf.generate.links, controls whether the hyperlinks will be generated. This property is set to true by default. If set to false, the generation time of the file will be decreased.
| << Embedded Fonts | © 1996-2013 InetSoft Technology Corporation (v11.4) | CJK Characters in PDF >> |