While going through the SDN forum, I saw, some of us wanted to know how to generate a PDF file out of receiver file adapter in XI. While ideas from other SDN members include Java mapping or proxies, here we will see how to use the Module Processor to do the conversion job.
The advantage of using module processor exit is its flexibility to take variables in configuration, instead of hard coding as with mapping program or proxies
In the below example, we receive a simple XML file and transform it to XSL FO format using XSLT mapping. Then we use FOP (download source from Apache FOP ) for converting the XSL-FO to PDF format
Target schema is available in the source FOP directory srcfoschema, which was downloaded from apache.org. But this needs to be tweaked to upload successfully in XI. You can download the tweaked version from FOP XSD
On the receiver file adapter, we will use a module processor exit bean. The code snippet for the processor bean is provided below
This module references the following jar files fop.jar, avalon-framework-cvs-20020806.jar, batik.jar, xalan-2.4.1.jar, xercesImpl-2.2.1.jar and xml-apis.jar. These jar files are available in the build and lib directory of FOP download
That's it. You are now ready to test your interface. Data transfer using PDF offers various benefits on security and data integrity. By using Java cryptology, you can also encrypt the PDF file and secure it with a password for additional security
In my next blog, I will talk about how to build a module for reading content from a PDF file, in the sender adapter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 |