Closed rosman21 closed 5 years ago
Any time I attempt to open a word document, I get a error showing this
works on my local server but not in my production enviorment. Not sure what the issue is.
Here is my code and version
Version: "officegen": "^0.4.5",
"officegen": "^0.4.5",
Code:
requestify.get(url).then(function(response) { var data = JSON.parse(response.body); var docx = officegen ( 'docx' ); docx.on ( 'error', function ( err ) { console.log ( err ); }); var pObj = docx.createP (); pObj.addText ( "Results" ); pObj.addLineBreak (); for(var i = 0; i < data.hits.hits.length; i++){ var currObj = data.hits.hits[i]._source; var http ="http://T.T.T.com/"+currObj.meeting_url; pObj.addText ( "Topic: " + T , {link: http, color: '4284f5' } ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "Meeting: " + E ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "F: " + R ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "Q: " + T ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "Discussio: " + H ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "Action : " + J ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "V: " + K ); pObj.addLineBreak (); pObj.addLineBreak (); pObj.addText ( "A " + M ); pObj.addHorizontalLine (); } res.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.documentml.document"); res.setHeader("Content-Disposition", "attachment; filename=Results.docx"); docx.generate(res); console.log("Generated"); });
docx.generate(res);
This function is working async. You can find a working example in /examples/pptx_server.js
Any time I attempt to open a word document, I get a error showing this
works on my local server but not in my production enviorment. Not sure what the issue is.
Here is my code and version
Version:
"officegen": "^0.4.5",
Code: