fixed attribute

This commit is contained in:
Dolan Miu
2016-04-05 01:49:12 +01:00
parent d197a2c717
commit d4c2b10285
9 changed files with 46 additions and 24 deletions

View File

@ -1,5 +1,6 @@
import * as archiver from "archiver";
import * as fs from "fs";
import * as xml from "xml";
import {Formatter} from "../formatter";
import {Document} from "../../docx";
import {Style} from "../../style";
@ -36,16 +37,20 @@ export abstract class Packer {
]);
//this.archive.directory(__dirname + "/template", "/");
this.archive.append(this.document, {
var xmlDocument = xml(this.formatter.format(this.document));
//var xmlStyle = xml(this.style);
var xmlProperties = xml(this.formatter.format(this.properties));
console.log(JSON.stringify(this.formatter.format(this.document), null, " "));
console.log(xmlDocument);
this.archive.append(xmlDocument, {
name: 'word/document.xml'
});
this.archive.append(this.style, {
name: 'word/newStyle.xml'
});
//this.archive.append(xmlStyle, {
// name: 'word/newStyle.xml'
//});
this.archive.append(this.properties, {
this.archive.append(xmlProperties, {
name: 'docProps/core.xml'
});