JPedal includes a method to allow users to replace certain aspects of the program with their own functionality for specialised situations. JPedal provides a method call and a set of interfaces to achieve this.
How it works
TheaddExternalHandler(Object newHandler,int type)method in PdfDecoder allows the user to pass in their own object which implements a predefined interface.
If this object is set, it will be called internally by JPedal at specific points allowing the object to replace or augment certain functions.
Some values are used internally and not listed here. Recommended values are:
- Options.CustomMessageOutputGives the developer control over the general messages in Viewer which can all be disabled . Object newHandler needs to implementorg.jpedal.external.CustomMessageHandler. There is an example inViewer code
- Options.CustomFormPrintallows the user to take control of printing of form widgets. Method is called for each value and boolean value is returned telling JPedal if it should print the widget. Object newHandler needs to implementorg.jpedal.external.CustomFormPrint.
- Options.CustomPrintHintingHandlerallows the user to take control of hinting used for printing. Methods are called before and after printing. Object newHandler needs to implementorg.jpedal.external.CustomPrintHintingHandler.
- Options.FormFactoryallows the user to replace forms widgets with their own. Object newHandler needs to implementorg.jpedal.objects.acroforms.creation.FormFactory.
- Options.ImageHandlerallows the user to access the image decoding functions. Object newHandler needs to implementorg.jpedal.external.ImageHandler. There is an example atorg.jpedal.examples.handlers.ExampleImageHandler.javaand code to enable it in theViewer example.
- Options.LinkHandlerallows the user to link their own code into link handlingcode. Object newHandler needs to implement org.jpedal.external.LinkHandler.
- Options.ShapeTrackerprovides a way to access the Shapes in a PDF as they are created. Object newHandler needs to implement org.jpedal.external.ShapeTracker.
- Options.RenderChangeListenerprovides a way to monitor when the page is rendered or updated. This listener is also a useful way to monitor when a page change happens. Object newHandler needs to implementorg.jpedal.external.RenderChangeListener.
This feature is provided as a service for commercial clients. It is not part of the official api and subject to change. It should only be used in consultation with IDRsolutions Ltd