How to use the word/document.xml function in word

To help you get started, we’ve selected a few word examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alonrbar / easy-template-x / dist / easy-template-x.js View on Github external
DocxParser.prototype.mainFilePath = function (zip) {
        if (zip.files["word/document.xml"]) {
            return "word/document.xml";
        }
        if (zip.files["word/document2.xml"]) {
            return "word/document2.xml";
        }
        return undefined;
    };
    DocxParser.prototype.splitTextNode = function (textNode, splitIndex, addBefore) {
github dolanmiu / docx / src / import-dotx / import-dotx.ts View on Github external
public async extract(data: Buffer): Promise {
        const zipContent = await JSZip.loadAsync(data);

        const stylesContent = await zipContent.files["word/styles.xml"].async("text");
        const stylesFactory = new ExternalStylesFactory();
        const styles = stylesFactory.newInstance(stylesContent);

        const documentContent = zipContent.files["word/document.xml"];
        const documentRefs: IDocumentRefs = this.extractDocumentRefs(await documentContent.async("text"));
        const titlePageIsDefined = this.titlePageIsDefined(await documentContent.async("text"));

        const relationshipContent = zipContent.files["word/_rels/document.xml.rels"];
        const documentRelationships: IRelationshipFileInfo[] = this.findReferenceFiles(await relationshipContent.async("text"));

        const media = new Media();

        const headers: IDocumentHeader[] = [];
        for (const headerRef of documentRefs.headers) {
            const relationFileInfo = documentRelationships.find((rel) => rel.id === headerRef.id);
            if (relationFileInfo === null || !relationFileInfo) {
                throw new Error(`Can not find target file for id ${headerRef.id}`);
            }

            const xmlData = await zipContent.files[`word/${relationFileInfo.target}`].async("text");
github alonrbar / easy-template-x / src / templateSpec / docxTemplateSpec.ts View on Github external
public mainFilePath(zip: JSZip): string {
        if (zip.files["word/document.xml"]) {
            return "word/document.xml";
        }
        if (zip.files["word/document2.xml"]) {
            return "word/document2.xml";
        }
        return undefined;
    }
}
github zVolodymyr / docxjs / src / DocumentParser.ts View on Github external
parseDocumentAsync(zip) {
            return zip.files["word/document.xml"]
                .async("string")
                .then((xml) => this.parseDocumentFile(xml));
        }
github gitlabhq / gitlabhq / app / assets / javascripts / index.js View on Github external
.then(asyncResult => {
        this.asyncResult = asyncResult;
        return asyncResult.files['word/document.xml'].async('string')
      })
      .then((content) => {

word

Word Processing Document library

Apache-2.0
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis