Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate word file in render process for one Electron app #400

Open
ecool2011 opened this issue Feb 21, 2022 · 0 comments
Open

Cannot generate word file in render process for one Electron app #400

ecool2011 opened this issue Feb 21, 2022 · 0 comments

Comments

@ecool2011
Copy link

ecool2011 commented Feb 21, 2022

Environment

  1. node -v: 13.14.0
  2. npm -v: 6.14.4
  3. npm ls officegen: 0.6.5
  4. Operating system: Win7
  5. Microsoft Office version: Office 2012
  6. Problem with Powerpoint, Excel or Word document: Word

Steps to Reproduce

I used following codes to generate a test word in render process, e.g: render.js
const officegen = require('officegen');
var docx = officegen('docx');
var out = fs.createWriteStream(“c:\\temp\\test.docx”);
out.on('close', function() {
console.log(' stream closed');
})
var p = docx.createP({ align: 'left' });
p.addText('Title:', { font_size: 15 });
docx.generate(out);

Expected Behavior

A test.docx will be generated under c:\temp folder

Actual Behavior

File is genereated, no error occurppted and file size is zero, or if the file size is not zero, but cannot open it in Office Word.
I debugged my codes, seems the stream out event always cannot be rasied.

I also test same codes in main processs, e.g: main.js, it works well.. >_<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant