-
Notifications
You must be signed in to change notification settings - Fork 15k
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
Printing a page cuts off the contents halfway and does not continue on next page. #8351
Comments
Could you provide the html file being print here? Please note that you should call |
Yea, everything is done after did-finish-load completes. Printing is done far into my app's life cycle. The HTML is being generated by react. The html being printed is a modal, so there is also html in the background. However the modal spans the entire width and height of the page at the time of printing. Maybe something is going on with the other, non-modal-related, html on the page? However the same thing prints just fine using chrome and window.print(). I'd also like to point out that a similar issue occurs with Electron's Demos app in the printing example. In that example, the first page is printed just fine, but it cuts off and then the second page is completely blank. While the issue isn't exactly the same as the one im experiencing (since i'm not even getting a second page), they're similar enough that they might be related or caused by the same underlying issue. Anyways, here's the modal html.
|
I ended up using a workaround since I couldn't get printToPdf to work properly. I basically ended up using fs to write a custom html page to temp dir. In that html page, I call window.print() on load. After writing the html page to memory, I use I guess it might be because of the format of the html itself but I don't have time to test it right now. Maybe if I created a new electron window with this html and then fired print from it, it would work. |
I'm closing this since I can't reproduce this on v1.7.x. |
When I try to print a page that contains a large table and I use the printToPdf module, it gets cut off halfway and does not print a second page. Is there a workaround for this?
I'm essentially using the code from the electron examples, here it is. This specific print job is done in landscape mode:
This is what my web content looks like when I start the print job:
And this is what the print to pdf page looks like. As you can see, it is cut off and there is no second page:
The text was updated successfully, but these errors were encountered: