Custom XML to PDF generation
Hello,
Here in my project, we have a requirement that involves PDF generation from a specific template. We are considering the OOTB functionality, by configuring our on rewriter (/apps/my_project/config/rewriter). The problem is that the mechanism uses a XML representation from the current node to get XSL-FO and after get the PDF. We need information from other nodes (that in normal HTML we use a WCMUse class to retrieve these information). Let me illustrate:
Node from Page A:
- path: path_to_page_b
- someTextField: some_text
Node from Page B:
- title: page_b_title
In this basic scenario, our PDF from Page A must contain the "some_text" and "page_b_title", but we are not able to access "page_b_title" because it is in another node.
Do you have a clue of how we could achieve this? After some research, I came up with the idea of generating a custom XML (from a Sling Servlet). This way, we could access other nodes using ResourceResolver and then, retrieve all data needed. However, I do not know how to inform the rewriter mechanism to consider my custom XML instead of the default one.
Relevant information:
- AEM Sites 6.1
- XSLT 1.0
Thank you in advance.