Huge refactoring to use new compiler and deprecate all other Packers

Add new PdfPacker
This commit is contained in:
Dolan
2018-08-14 01:46:48 +01:00
parent 675192b86f
commit a38abeb4c2
19 changed files with 760 additions and 345 deletions

View File

@ -1,4 +1,5 @@
const docx = require('../build');
const fs = require('fs');
var doc = new docx.Document();
@ -10,7 +11,10 @@ paragraph.addRun(dateText);
doc.addParagraph(paragraph);
var exporter = new docx.LocalPacker(doc);
exporter.pack('My Document');
var packer = new docx.Packer();
packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync('My Document.docx', buffer);
});
console.log('Document created successfully at project root!');