What I haven't figured out yet is a) how to include this in a PDF generated using Jasper reports and iReport (4.5.0), or b) how to tie my specific element to trigger such code.
Having all the functionality available to standard report text elements would indeed be impossible to achieve given the current PDF exporter code.
To see it in action, add the following line to jasperreports_extension.properties:
and then out a generic element with genericElementType namespace="urn:me:me" name="print" in a report.
The most important part that is missing is the text font. JRPdfExporter.getFont() is protected unfortunately, if required you might be able to duplicate some code from there.
The text itself can be easily given as a generic element parameter.
Not possible with the current code. Log a feature request in the trackers.
You can still achieve that by implementing a generic element PDF handler. That would involve writing a class that implements GenericElementPdfHandler, registering the handler as an extension and including a generic element in the report. The handler would do something similar to what JRPdfExporter.setHyperlinkInfo() does.
you can have a PDF Generating & Reading Add-On,which provides standard options to process PDF document, including:
- Create and sort a new PDF document
- Add, delete and duplicate page of PDF file
- Merge, split, and append PDF document file
- Add annotations on PDF document
- Rotate one or more pages of PDF file
- Extract text from PDF document
- Print PDF document file