Cookbook

Generate different headers and footers for sections

If you need to create headers and footers dynamically for sections, you have to use the MultiMerge class with the mergeDocx method, available in the Advanced and Premium licenses.

This way, instead of generating a single document with different types of headers and footers, you may create a document for each combination of headers and footers and them merge them all in a single DOCX.

As an example, let's prepare a cover page with no headers or footers as a first page, a second page with only a footer and the rest of the pages filled with both headers and footers.

Premium licenses allow doing all these steps using in-memory DOCX to get the best performace.