-
-
Notifications
You must be signed in to change notification settings - Fork 568
Closed
Description
Hi! Help, please. This simple example (copied from codepen.io HTML block) doesn't create filled TOC in downloaded docx and i have no ideas, why :(
`
<script>
function generate() {
const doc = new Document();
doc.addSection({
children: [
new TableOfContents("Summary", {
hyperlink: true,
headingStyleRange: "1-5",
}),
new Paragraph({
text: "Header #1",
heading: HeadingLevel.HEADING_1,
pageBreakBefore: true,
}),
]
});
Packer.toBlob(doc).then(blob => {
console.log(blob);
saveAs(blob, "example.docx");
console.log("Document created successfully");
});
}
</script>