Skip to content

Commit

Permalink
Fix Readme, office, path
Browse files Browse the repository at this point in the history
  • Loading branch information
skmp committed Nov 25, 2014
1 parent e9ee8a1 commit 45f4a90
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,58 @@ Depends on office 2013 + windows.
```ruby
var msopdf = require('node-msoffice-pdf');

msopdf(null, function(office) {
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 reliably not crash on my laptop
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("Finished & closed");
console.log("Woops", error);
} else {
console.log("Saved to", pdf);
console.log("Finished & closed");
}
});
});
Expand All @@ -73,7 +78,8 @@ msopdf(null, function(office) {
## Release History
* 0.0.4 Fix package.json
* 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
3 changes: 2 additions & 1 deletion lib.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var edge = require('edge');
var path = require('path');

module.exports = edge.func({
source: 'office.cs',
source: path.join(path.dirname(module.filename), 'office.cs'),
references: [
'C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.Office.Interop.Word\\15.0.0.0__71e9bce111e9429c\\Microsoft.Office.Interop.Word.dll',
'C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.Office.Interop.Excel\\15.0.0.0__71e9bce111e9429c\\Microsoft.Office.Interop.Excel.dll',
Expand Down
1 change: 0 additions & 1 deletion office.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public async Task<dynamic> powerPoint(dynamic opts) {

private void closeInternal() {
Delay(4);
Console.WriteLine("Time to quit now ..\n");

if (msword != null) {
try {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "node-msoffice-pdf",
"version": "0.0.5",
"version": "0.0.7",
"description": "Exports various microsoft office formats to pdfs",
"author": "Stefanos Kornilios Mitsis Poiitidis ([email protected])",
"files": [ "office.cs", "lib.js" ],
"main": "lib.js",
"scripts": {
"test": "node testrunner.js"
Expand Down

0 comments on commit 45f4a90

Please sign in to comment.