1.0.27 • Published 6 years ago

docx-officegen v1.0.27

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

#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);
            }); 
         }   
              
1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago