docx-officegen

This module can generate Office Open XML files for Microsoft Office 2007 and later. Also the output is a stream and file, not dependent on any output tool. This module should work on any environment that supports Node.js 10.3.0 or later including Windows.

Package no longer supported. Contact support@npmjs.com for more info.
Last updated 2 years ago by milad_ebp .
ISC · Original npm · Tarball · package.json
$ cnpm install docx-officegen 
SYNC missed versions from official npm registry.

#docx

This module can generate Office Open XML files for Microsoft Office 2007 and later. Also the output is a stream and file, not dependent on any output tool. This module should work on any environment that supports Node.js 10.3.0 or later including Windows.

This module generate Word (.docx) document and stream.

#Feature :

  • Generating Microsoft Word document (.docx file):

    • Create Word document.
    • You can add one or more paragraphs to the document and you can set the fonts, colors, alignment, etc.
    • You can add one or more table to the document and you can set the fonts, colorFont , backgroundCell, etc.
    • Support Merge in Table.
  • Generating Microsoft Word document (stream):

    • You can generate word document in the format stream.
  • Generating Microsoft Word document (pdf):

    • You can generate word document in the format pdf.

#Installation :

via Git:

  https://github.com/Favana/docx-officegen.git

via npm:

  $npm i -g npm
  $npm i --save docx-officegen

This module is depending on:

  • @salishq/loadash
  • @types/archiver
  • @types/node
  • loadash
  • archiver
  • express

#Public API :

  • generate word document (.docx file):

    var docx_officegen =  require('docx-officegen'); 
    
    var docx = new docx_officegen.Docx(fileName, filePath);
    docx.createTable(data);
    docx.createP();
    docx.addContentP(data, styleObject);
    
    var out = docx.generate();
    
        if(out == false){
          // your syntax
        }else{
           console.log(out)
           // OR generate file OR Stream and Pdf    
        }
    
  • generate word document (stream):

      var docx_officegen =  require('docx-officegen'); 
      var express  = require('express');
      var app = express(); 
             
      var docx = new docx_officegen.Docx(fileName, filePath);
      docx.createTable(data);
      docx.createP();
      docx.addContentP(data, styleObject);
              
      var out = docx.generate();
              
         if(out == false){
            // your syntax
         }else{ 
            // create stream //
            app.get(url, function(request, response){
                 
                 out.pipe(res);
                 
                 response.writeHead(200, {
                     "Content-Type": "application/docx",
                     "Content-Disposition": "attachment; filename=filename.docx"
                 }); 
                  
            });  
            var server = app.listen(3000, function () {
                    console.log('Listining On', server_1.address().port);
            }); 
         }   
    

Current Tags

  • 1.0.27                                ...           latest (2 years ago)

25 Versions

  • 1.0.27 [deprecated]           ...           2 years ago
  • 1.0.26 [deprecated]           ...           2 years ago
  • 1.0.25 [deprecated]           ...           2 years ago
  • 1.0.21 [deprecated]           ...           2 years ago
  • 1.0.20 [deprecated]           ...           2 years ago
  • 1.0.19 [deprecated]           ...           2 years ago
  • 1.0.18 [deprecated]           ...           2 years ago
  • 1.0.17 [deprecated]           ...           2 years ago
  • 1.0.16 [deprecated]           ...           2 years ago
  • 1.0.15 [deprecated]           ...           2 years ago
  • 1.0.14 [deprecated]           ...           2 years ago
  • 1.0.13 [deprecated]           ...           2 years ago
  • 1.0.12 [deprecated]           ...           2 years ago
  • 1.0.11 [deprecated]           ...           2 years ago
  • 1.0.10 [deprecated]           ...           2 years ago
  • 1.0.9 [deprecated]           ...           2 years ago
  • 1.0.8 [deprecated]           ...           2 years ago
  • 1.0.7 [deprecated]           ...           2 years ago
  • 1.0.6 [deprecated]           ...           2 years ago
  • 1.0.5 [deprecated]           ...           2 years ago
  • 1.0.4 [deprecated]           ...           2 years ago
  • 1.0.3 [deprecated]           ...           2 years ago
  • 1.0.2 [deprecated]           ...           2 years ago
  • 1.0.1 [deprecated]           ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 29
Last Day 0
Last Week 27
Last Month 34
Dependencies (12)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |