Currently, users have specific requests regarding the processing of different aspects of PDF exporting, such as coloring specific words and attributes (see #83). Meeting all these requirements can be quite challenging.
To address this, we propose designing a hooks/interceptor framework that allows for custom HTML processing before sending it to WeasyPrint. The PDF exporter will collect and invoke all registered hooks. The integration mechanism can be based on Hivemodule, OSGi services or external Web Hooks.
The input arguments for the hook method will include the HTML stream and context variables. In future steps, it would be beneficial to support not only Java-based hooks but also hooks written in scripting languages.
Motivation
Give flexibility to the users to process exporting HTML using custom code
Description
Currently, users have specific requests regarding the processing of different aspects of PDF exporting, such as coloring specific words and attributes (see #83). Meeting all these requirements can be quite challenging.
To address this, we propose designing a hooks/interceptor framework that allows for custom HTML processing before sending it to WeasyPrint. The PDF exporter will collect and invoke all registered hooks. The integration mechanism can be based on Hivemodule, OSGi services or external Web Hooks.
The input arguments for the hook method will include the HTML stream and context variables. In future steps, it would be beneficial to support not only Java-based hooks but also hooks written in scripting languages.
Motivation
Give flexibility to the users to process exporting HTML using custom code
Proposed Solution (optional)
No response