Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Document Assembler: Ability to merge in whole documents or sub-templates #241
As some interest was shown in this feature here is the pull request.
From issue 191;
Implementation is as follows;
With the above in place what I do is take a two pass approach.
Firstly I process the Document and DocumentTemplate elements converting all to a Document element which contains a Data attribute with the base64 encoded content of the Document or assembled DocumentTemplate.
Then I have introduced a second step and as such a dependency on DocumentBuilder in DocumentAssembler. I am not sure if this will be frowned upon or not :)
This second step is largely based on this post from Eric White;
Although in my practical experience (been using this code in production for months) the Word documents generated are valid I had issues with the Unit Tests. I think this is because we are using Office 365 and it looks like the validator only supports up-to 2013 at the minute? I could re-author my test files in 2013 but don't have access to a copy.
Any comments and feedback appreciated, this is my first pull request on an open-source project so be gentle :)