-
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
webContents.print() causes margin on printed page #15375
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Try this in your global
|
Hello. Thanks for the answer and sorry for the late response. |
Thank you for taking the time to report this issue and helping to make Electron better. The version of Electron you reported this on has been superseded by newer releases. If you're still experiencing this issue in Electron v4.2.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know. I'm setting the Thanks in advance! Your help is appreciated. |
@sofianguy Edit: Oh and just so you know, this behaviour is not the same when printing to PDF. It seems that those two functionalities work quite differently. |
this issue still persist in version 8.0.0 as well. i would say most of electron issues are in printing and i wish you would look at them sooner cause some issues have been around since version 0.3 System : Windows x64 Ultimate |
Same here any fixes? |
@akash-rajput hi did you find a fix? |
The Electron version reported on this issue is no longer supported. See our supported versions documentation. If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know. Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated. |
node_modules/.bin/electron --version
: 3.0.5node_modules/.bin/electron --version
on last known working Electron version (if applicable): i dont knowExpected Behavior
I have an html page needs to print on electron. When i print using chrome browser it works fine.
Actual behavior
When i print on electron it adds some margin on the top and left of the page. I tried a lot of tricks on CSS but i think it is not about css or design of the page.
Here is a simple page that prints with same margins :
`
<title>print test for electron</title> <style> body{ margin:0; padding:0; }@media print
{
body.A4{ width: 210mm;}
}
@page
{
size: A4;
margin: 0mm;
padding : 0mm;
}
.sheet
{
width:210mm;
height:297mm;
border:1px solid #000;
page-break-after: always;
}
</style>
test
test
To Reproduce
Create a single electron app
open the page above and call window.print() or BrowserWindow.webContents.print()
print on any printer.
Note : I am not an expert to prepare printing styles on css. But my pages prints on the chrome browser as expected.
The text was updated successfully, but these errors were encountered: