-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Getting a Blank Page along with the component to be printed #26
Comments
Hi @shyam2794 sorry for the delay. Try the new beta version which is going to rely on an iframe to solve the cross origin issues some people are experiencing.
and let me know the feedback if this solves issues |
There has been a rewrite pivoting away from popup windows.
|
I am facing the same issue with firefox, and neither of those versions fix the issue. Also tried using pageStyle to set the overflow property with no success. Works great on chrome |
Hello, is this problem already solved somehow? Having same issue here |
Hi @LucasBSC can you please create a new issue with more details if you are experiencing a problem? Thank you |
I am using the latest version and no working for me; is there and other proposed solution please |
@zainpros if you are having problems please create a new issue and describe your problem, as well as share the code you are using please, thank you. |
If anyone lands here, perhaps this will help: @media print {
html, body {
height: 100vh;
margin: 0 !important;
padding: 0 !important;
overflow: hidden;
}
} |
The solution from @srj-github almost solved my problem (thank you btw). I had to make a little change. In my case, I had a list which orginally had several rows but I wanted to print only the ones that were checked. If you write 100vh, the print won't take more than one page (it seems that it always prints one page), even when sometimes you actually need two or more pages to show all the rows. But if you write the value auto for the prop height, then it will automatically calculate the correct quantity of pages you need. |
Thanks, @srj-github, It has worked for me. |
For whoever needs dynamic content that can be more than 1 page, and @JavierVescio's solution didn’t work for him. I managed to remove the extra page with this- @media print {
html, body {
height: initial !important;
overflow: initial !important;
}
} |
It works for me!! |
* Add README FAQ note about #26 * Add `break-*` doc links to the README * Remove unused TravisCI config * Update LICENSE for 2022 * Improve default `pageStyle` and add page `size` FAQ entry * Add FAQ entry about setting `removeAfterPrint` to `false` sometimes * Add example of setting state in `onBeforeGetContent` to the README * Upgrade `devDependencies` * Add a `textarea` to the example component * Add note about an internal `handleRemoveIframe` call * Ensure we wait for `fonts` to load We currently load `fonts` but don't actually check to see if they have completed loading before printing. This fixes that. * Fix too strict error type for font load failure * Simplify loading logic, add more error information * Guard against handling a resource twice * Add gaurd to continue printing with custom `fonts` even if `FontFace` API is not supported
ya it is working only for one page but let suppose it page can be 100 page or some time it can be 1 page |
Thanks, this works @srj-github |
This works for me. It handles one page and multiple pages correctly. @srj-github 's solution will cut it to a dead one page. |
Not working |
Please share your code, ideally in a working Codesandbox or similar. Can't debug from pictures. |
Here is a codesandbox https://codesandbox.io/p/sandbox/quiet-pine-8behs |
For me this prints without issue, though it's hard to tell because the formatting is hard to understand |
Hi ,
I am trying to print the bill . And am facing some issues in handling it . I am able to get the bill component to be printed but am getting another blank page .
By Default it takes two pages . Am not sure how to resolve this .
The text was updated successfully, but these errors were encountered: