Reassemble Or Merge Multiple type of Document into One PDF File.

Hey Guys, I Have multiple Document with different type of Document (Like Some of Document as word Files, Some of Documents Excel, Some of Documents Word).I need to Collect data of all documents into One PDF File (Which Template Decided) As per Documents Sequence Number. How this will achievable. Please Share Your Views.   Thanks and Regards Disha Sharma
2 answers

Hi Disha,

Looks like a complicated requirement. It's possible but it would have to be a fixed flow of document transformation and pdf creation. Also, even if it's possible, doesn't mean you should do it.

That said, AFAIK you would need separate processes to extract information from different types of documents (excel, word, pdf, etc) and maybe a multi-step process.

You can use the excel importer module to extract information from .xls, .xlsx and .csv files. You can use the community commons module's java action – "StringFromFile” to extract text from word, pdf, txt files. You can then create a whole new document (pdf) using the Document generation in Mendix.

If you want to extract information from a specific file type with a fixed format, you could also build your own java action to do so. You could create an entity to store the information and pass both an empty object of that entity and the file itself to the java action and perform the transformation. For eg. you can use the apache poi java library to extract information from word files OR convert the word file to a PDF.

If you simply want to merge multiple pdfs, you can use the "MergeMultiplePdfs” java action from community commons module.

Hope this helps :)


For a requirement like this you need to do this outside of Mendix. See this marketplace content:

It provides an API to do stuff like this. But do note that you need a paid account to use those API's.