flowToPdf
Function flowToPdf
flowToPdf(build: (pdf: PDFDocument) => Node[] | Promise<Node[]>, options?: FlowToPdfOptions): Promise<Uint8Array<ArrayBufferLike>>One-call convenience around the full renderFlow lifecycle: create a
PDFDocument, let you build the nodes against it (so fonts and images embed
into the same document), paginate them, and return the saved bytes.
The build callback receives the fresh document — embed fonts there and
return the top-level nodes. This is the shortest path from "nothing" to a
Uint8Array, with no pdf-lib import required:
Parameters
-
build: (pdf: PDFDocument) => Node[] | Promise<Node[]> -
options?: FlowToPdfOptions
Returns Promise<Uint8Array<ArrayBufferLike>>