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
Print in Electron crashes #108
Comments
I don't use Electron every day (although I love it!). May I kindly ask you for a reproducer? Otherwise, I have to figure out how to add Electron to Angular. AFAIK, this has become pretty simply, but still, it's an extra hour of investigation. |
@timvandermeij @Snuffleupagus This might be interesting to you, too. I've seen a surprisingly small number of issues concerning electron in your repository. Do you officially support it? |
No, we don't officially support Electron. If I recall correctly there have been one or two patches fixing polyfills for Electron, but other than that there has been no demand/contributions. |
If still interested, I will have a reproducer repo ready this week.
…On Sun, 14 Jul 2019 at 22:00, Stephan Rauh ***@***.***> wrote:
I don't use Electron every day (although I love it!). May I kindly ask you
for a reproducer? Otherwise, I have to figure out how to add Electron to
Angular. AFAIK, this has become pretty simply, but still, it's an extra
hour of investigation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#108?email_source=notifications&email_token=ACTDVBZVUMNOBV47DON2NWLP7OHXXA5CNFSM4IDR6PC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4NHSI#issuecomment-511235017>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACTDVBZKJBMEKCPPWLPYL5DP7OHXXANCNFSM4IDR6PCQ>
.
|
@timvandermeij OK, maybe that's a gap I can fill. However, I have to admit it's more likely your library plays well with electron, it's just my Angular integration that's causing trouble. I'll keep you tuned! |
@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:
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. |
@stephanrauh It is confirmed, it is Electron 5.0.6 and 5.0.5 bug. Electron 5.0.4 and under are fine with printing. Maybe I should raise an issue to Electron instead. |
Awesome analysis. I assume the Electron team will find it difficult to trace this bug, so I wonder how to help them. Two ideas: can you wrap the pdf.js showcase as an Electron app? Or, maybe even simpler: I assume Electron can display PDF files natively. What happens when you print the PDF file? |
@stephanrauh I could make a repo and build a app for them, showing the crash with 5.05/5.06. |
I see. It was worth a shot. :) |
I had this wired behavior when viewing and printing with ngx-extended-pdf-viewer. I have a set of actions that are set to be hidden on mobile view: While I am on this, can I ask if it is convinient to give two events: beforePrint and beforeDownload. I wanted to offer my user to upload a copy of the pdf to the server and save it as an attachment to a record before printing/downloading a pdf version of that record. |
Sort of. At least temporarily. In reality, "printing" is sort of cheating in a very clever way. The entire page is hidden via a media query (by adding the attribute After printing the CSS attribute Maybe this approach confuses the FlexLayouer CSS. |
Good to know @stephanrauh . As far as I know, flex-layout is all Javascript no css. The problem is it doesn’t react to the finishing off of printing in this case, resulting the actions to be hidden until a new media query change happens. I will try to find another way to hide the action buttons in this case. |
electron/electron#19108 The crash is already reported. I guess we can let go here. |
Whow, that's probably the shortest reproducer I've ever seen:
:) |
As for the flex-layout bit: oops, I didn't expect it to be all-JavaScript. That's interesting. It's the same approach I'm doing with #103. In my case, the reason is that the PDF viewer is meant to be embedded. That in turn means it has less than 100% window width. That in turn makes the standard media queries useless. I wonder what the rationale of flex-layout is? |
I certainly hope so because we keep environment-specific tweaks to the bare minimum (and we removed most of them since version 2.0) so the library works for any environment that implements the required JavaScript primitives. Thank you for researching this, and if in the future you find something can be improved in PDF.js, you can always open an issue. |
I've went over the print CSS again. When you update to version 9.0.0, brace yourself for breaking chances. In your case, that's not likely, but you never know. |
Environment:
window["process"]
in pollyfiller.ts makes it render, but same printing problem as below.)Print function is not working in Electron:
Thanks for the great lib.
The text was updated successfully, but these errors were encountered: