Huge refactoring to use new compiler and deprecate all other Packers
Add new PdfPacker
This commit is contained in:
@ -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!');
|
||||
|
Reference in New Issue
Block a user