If there is only one page, then page contains header, layout and footer. (It works)
If there is two pages, then the header and layouts on the first page are required and layout and footer on the second page.
If there is three or more in the document, then the header and layouts on the first page are required, only the layouts on the middle page and layout and footer on the last page.
We need to create a Lx-Pdf node.js configuration and or modifications that generates one output pdf file with multiple pages and headers and footers as defined above. If the current page does not have a header and footer, then the layouts are increased accordingly.
Source library: [login to view URL] based on PDFKit ([login to view URL])