Mandatory Sections

This commit is contained in:
Dolan Miu
2019-07-31 08:48:02 +01:00
parent bf80311ef7
commit ac5b15d0e3
63 changed files with 1194 additions and 1588 deletions

View File

@ -12,16 +12,16 @@ fs.readFile(filePath, (err, data) => {
}
importDotx.extract(data).then((templateDocument) => {
// This any needs fixing
const sectionProps = {
titlePage: templateDocument.titlePageIsDefined,
} as any;
const doc = new Document(undefined, sectionProps, {
const doc = new Document(undefined, {
template: templateDocument,
});
const paragraph = new Paragraph("Hello World");
doc.add(paragraph);
doc.addSection({
properties: {
titlePage: templateDocument.titlePageIsDefined,
},
children: [new Paragraph("Hello World")],
});
const packer = new Packer();
packer.toBuffer(doc).then((buffer) => {