renderFlow
Function renderFlow
renderFlow(pdf: PDFDocument, nodes: Node[], options?: FlowOptions): Promise<{ pages: PDFPage[] }>Render a sequence of top-level nodes onto one or more pages, breaking to a
new page when the next node would overflow. Each child is rendered atomically
(no mid-child splits). Returns the populated PDFDocument.
When header or footer is provided, two passes run: the content pass
reserves space at the top and/or bottom of every page, and a second pass
draws the header/footer once the final page count is known.
Parameters
-
pdf: PDFDocument -
nodes: Node[] -
options?: FlowOptions
Returns Promise<{ pages: PDFPage[] }>