Using a better demo naming system

This commit is contained in:
Dolan
2019-08-06 23:08:21 +01:00
parent 82fef4c2b1
commit b741db3050
51 changed files with 22 additions and 15 deletions

19
demo/7-landscape.ts Normal file
View File

@ -0,0 +1,19 @@
// Example of how to set the document to landscape
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, PageOrientation, Paragraph } from "../build";
const doc = new Document();
doc.addSection({
size: {
orientation: PageOrientation.LANDSCAPE,
},
children: [new Paragraph("Hello World")],
});
const packer = new Packer();
packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});