docx
    Preparing search index...

    Function layoutDocument

    • Lays out a document's pages as Word does, and gives what is on each page: the lines of its paragraphs, with their text and where they are, the rows of its tables, its footnotes and endnotes, and which of its section's headers and footers it shows.

      const { pages } = layoutDocument(new Document({ sections: [...] }));
      

      The pages are laid out as estimatePageNumbers lays them out, with the same fonts and rules, and the page numbers of tables of contents and page references are laid out as it writes them. Where it can't lay out something yet, such as a text box, it stops, and gives the pages up to there, with why in stoppedAt.

      Parameters

      • document: File

        The document to lay out. It is laid out as it would be written

      Returns DocumentLayout