0.0.7 • Published 9 years ago

node-msoffice-pdf v0.0.7

Weekly downloads
161
License
MIT
Repository
github
Last release
9 years ago

node-msoffice-pdf

Uses edge.js + a bit of C# code to export office documents as pdfs, using Office remoting.

Depends on office 2013 + windows.

Installation

npm install node-msoffice-pdf

Usage

var msopdf = require('node-msoffice-pdf');

msopdf(null, function(error, office) { 

    if (error) {
      console.log("Init failed", error);
      return;
    }

   /*
     There is a queue on the background thread, so adding things is non-blocking.
   */

   office.word({input: "infile.doc", output: "outfile.pdf"}, function(error, pdf) {
      if (error) {
           /* 
               Sometimes things go wrong, re-trying usually gets the job done
               Could not get remoting to repiably not crash on my laptop
           */
           console.log("Woops", error);
       } else {
           console.log("Saved to", pdf);
       }
   });


   office.excel({input: "infile.xlsx", output: "outfile.pdf"}, function(error, pdf) {
       if (error) {
           console.log("Woops", error);
       } else {
           console.log("Saved to", pdf);
       }
   });


   office.powerPoint({input: "infile.pptx", output: "outfile.pdf"}, function(error, pdf) {
       if (error) {
           console.log("Woops", error);
       } else {
           console.log("Saved to", pdf);
       }
   });

   /*
     Word/PowerPoint/Excel remain open (for faster batch conversion)

     To clean them up, and to wait for the queue to finish processing
   */

   office.close(null, function(error) {
       if (error) {
           console.log("Woops", error);
       } else {
           console.log("Finished & closed");
       }
   });
});

Contributing

Github for issues & PR, MIT license, yada yada

Release History

  • 0.0.7 Rly works nao
  • 0.0.5 ...
  • 0.0.4 Update README.md (x2)
  • 0.0.3 Update README.md
  • 0.0.2 (Mostly?) working prototype
0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago