Skip to content

Generate multiple invoices in one docx, one invoice per page #182

Open
@aetna-softwares

Description

The current features of this library are great to generate a "single item" output file, such as for example editing an invoice.

I am looking to an enhancement that allow us to work with the same template but give it an array of data and obtain a document containing all items in one file (such as a mailing in word with an xls file).

the idea is to create each individual files and to concatenate them in a final document with a page break between each item.

I try to get this result by using loop syntax with in page-break inside :

 {#invoices} 
... contents ...
[page break here]
{/invoice} 

but it has 2 drawbacks :
1/ from a user point of view the {#invoices} tag is difficult to understand as he is creating a template for a single invoice
2/ as I force a page break at the end of content, I have a white page at the end of generated document

A workaround for this 2 point should be to automatically add the {#invoices} tags to the user template before starting the merge and to remove the last page break from the generated file but I would prefer a clean feature than to do this kind of quick hack ;)

do you think that it could be a good feature for your lib ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions