diff --git a/oform/format/Document.js b/oform/format/Document.js index 3d481c6..e54f23e 100644 --- a/oform/format/Document.js +++ b/oform/format/Document.js @@ -220,7 +220,11 @@ }; CDocument.prototype.toPkg = function(xmlPkg) { - + let xmlWriter = xmlPkg.getXmlWriter(); + let main = xmlPkg.addPart(AscCommon.openXml.Types.oformMain); + + xmlWriter.Seek(0); + main.part.setDataXml(this, xmlWriter); }; CDocument.prototype.fromXml = function(reader) { @@ -291,7 +295,7 @@ for (let fgIndex = 0, fgCount = this.FieldGroups.length; fgIndex < fgCount; ++fgIndex) { - this.FieldsGroups[fgIndex].toXml(writer); + this.FieldGroups[fgIndex].toXml(writer); } writer.WriteXmlNodeEnd("document"); diff --git a/oform/xml/XmlPackage.js b/oform/xml/XmlPackage.js index 715cc15..0e382b0 100644 --- a/oform/xml/XmlPackage.js +++ b/oform/xml/XmlPackage.js @@ -51,7 +51,7 @@ { let zip = this.zip; let pkg = this; - zip.files.forEach(function(path) + zip.getPaths().forEach(function(path) { if (!path.endsWith("/")) { @@ -78,6 +78,10 @@ { this.context = context; }; + XmlPackage.prototype.getXmlWriter = function() + { + return this.xmlWriter; + }; //--------------------------------------------------------export---------------------------------------------------- AscOForm.XmlPackage = XmlPackage;