function GenerateLayout(Layout: TPdfLayoutDocument; out Plan: TPdfLayoutPlan; AllowSignedDocument: Boolean = False): Boolean;
Measures text and paginates every item before changing the destination, then appends the complete plan with native PDFium page and page-object APIs
TPdfLayoutDocument supports wrapped text, spacers, rules, images, reusable page XObjects, explicit page breaks, headers, footers, page settings, keep-together paragraphs, and alignment
Use {page} and {pages} in text, headers, or footers
The measure pass reserves ReservedPageDigits widest-digit placeholders, so final page numbers cannot change wrapping or page count during emission
Plan reports final pages, commands, measured text calls, content counts, and page-reference counts
The destination is unchanged when measuring fails or when any append operation fails
An active signed destination is rejected unless AllowSignedDocument is set
The source passed to AddPageXObject must remain active until emission completes