Works out the page each bookmark of a document starts on, as estimatePageNumbers does, measuring text as the options say. Give what it returns to a document as its pageNumbers, or to patchDocument as its pageNumbers:
pageNumbers
patchDocument
new Document({ pageNumbers: estimatePageNumbersWith({ measureWidth: measureWithPretext(pretext) }), sections: [...] });const fonts = [{ data: await readFile("Aptos.ttf") }, { data: await readFile("Aptos-Bold.ttf") }];new Document({ pageNumbers: estimatePageNumbersWith({ fonts }), sections: [...] }); Copy
new Document({ pageNumbers: estimatePageNumbersWith({ measureWidth: measureWithPretext(pretext) }), sections: [...] });const fonts = [{ data: await readFile("Aptos.ttf") }, { data: await readFile("Aptos-Bold.ttf") }];new Document({ pageNumbers: estimatePageNumbersWith({ fonts }), sections: [...] });
It throws when a font file isn't a TrueType or OpenType font.
Works out the page each bookmark of a document starts on, as estimatePageNumbers does, measuring text as the options say. Give what it returns to a document as its
pageNumbers, or topatchDocumentas itspageNumbers:It throws when a font file isn't a TrueType or OpenType font.