added style/properties into packer
This commit is contained in:
@ -9,10 +9,14 @@ export abstract class Packer {
|
|||||||
protected archive: any;
|
protected archive: any;
|
||||||
private formatter: Formatter;
|
private formatter: Formatter;
|
||||||
protected document: Document;
|
protected document: Document;
|
||||||
|
private style: Style;
|
||||||
|
private properties: Properties;
|
||||||
|
|
||||||
constructor(document: Document, style: Style, properties: Properties) {
|
constructor(document: Document, style: Style, properties: Properties) {
|
||||||
this.formatter = new Formatter();
|
this.formatter = new Formatter();
|
||||||
this.document = document;
|
this.document = document;
|
||||||
|
this.style = style;
|
||||||
|
this.properties = properties;
|
||||||
this.archive = archiver.create("zip", {});
|
this.archive = archiver.create("zip", {});
|
||||||
|
|
||||||
this.archive.on('error', (err) => {
|
this.archive.on('error', (err) => {
|
||||||
@ -33,6 +37,18 @@ export abstract class Packer {
|
|||||||
|
|
||||||
//this.archive.directory(__dirname + "/template", "/");
|
//this.archive.directory(__dirname + "/template", "/");
|
||||||
|
|
||||||
|
this.archive.append(this.document, {
|
||||||
|
name: 'word/document.xml'
|
||||||
|
});
|
||||||
|
|
||||||
|
this.archive.append(this.style, {
|
||||||
|
name: 'word/newStyle.xml'
|
||||||
|
});
|
||||||
|
|
||||||
|
this.archive.append(this.properties, {
|
||||||
|
name: 'docProps/core.xml'
|
||||||
|
});
|
||||||
|
|
||||||
this.archive.finalize();
|
this.archive.finalize();
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user