ngx-extended-pdf-viewer: Print in Electron crashes

Environment:

  1. Windows: 10 64x.
  2. ngx-extended-pdf-viewer: 0.9.54
  3. Angular: 8.1.1
  4. angular-cli: 8.1.1
  5. electron: 5.0.6
  6. pdf.js: 2.2 (2.1 fails to even render the pdf in electron, delete window["process"] in pollyfiller.ts makes it render, but same printing problem as below.)

Print function is not working in Electron:

  1. click print will pop up system print dialog
  2. if cancel the print dialog without printing, the black “Preparing document for printing” shows at 100%, clicking cancel button offer no response, angular app non responsive, had to refresh window to regain control.
  3. if select a printer, it would print as normal, but electron crash and quit without any warning.

Thanks for the great lib.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

@stephanrauh I forked the report angular-electron, installed ngx-extended-pdf-view and displayed a pdf file downloaded from your demo page, tried printing in electron, shockingly, no crashes, everything works just fine!

What is different in my own project where electron crashes:

  1. instead of give a pdf to the src, I use pdfMake to generate blob/dataUrl and give them straight to [src] input. It may be a pdfMake or blob/dataUrl issue.
  2. package versions are newer than the ones in angular-electron.

I will try to find a reproducer in with angular-electron and report back here later.

PS: @timvandermeij it may be because pdf.js works with electron out of the box so you don’t have much demand/contributions. Let’s see.

https://github.com/electron/electron/issues/19108 The crash is already reported. I guess we can let go here.