-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Margin on top of printed page #2
Comments
Thanks for the feedback! I'm not entirely sure about the issue can you provide a codesandbox to this example? I'll look into it |
Sure, I'm not sure it's even necessarily related to my implementation or even react-to-print. But here it is:
It's pretty simple. The label itself is a simple component that doesn't have any special margins. Actually, what I've tested is putting multiple components within the targeted div and it prints them each out on a separate page perfectly. Only the first has a top margin of 8px I believe, the following ones don't. Thanks! |
Ok I'll try to look into this. Thanks! |
@gregnb The repo seems to be working fairly well for me, but I have a component that gets split to multiple pages when I go to print. I am having an issue with the margins on the pages, when printed, cut off some information. Is there a way to account for this in my code to make sure everything is printed correctly? I think the sides can be accounted for easily enough by adding padding, but the repo seems to automatically split the component into multiple pages, so with no real way to know where the page breaks will be is there a way to account for the top and bottom dead space? |
I am having the same issue as ShawnKoga, components will split in an ugly way over multiple pages. Is there a way to determine a page break. Even manually setting one would be good. Something like:
I realize this is probably hard to do. Overall react-to-print is very good and is working well for me also. |
One can control page breaks with CSS: https://www.w3schools.com/cssref/pr_print_pageba.asp |
Thanks simon I was not aware of this. |
First and foremost thank you very much for this repo, it's by far the easiest React printer to use/implement that I've tested.
I had one question though: when I print the same component multiple times (i.e. the same component several times within a div, and the ref is to the div), there is a small 8px margin on top of only the first printed component (each is printing to a different page by the way).
I read that setting the @media print body margin-top to 0 would fix it but so far that hasn't changed anything. (link: https://stackoverflow.com/questions/5024393/page-margins-for-printing-in-css).
Any suggestions?
The text was updated successfully, but these errors were encountered: