Skip to content
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

WKWebView inconsistent print margins #1873

Closed
lubos opened this issue Jan 8, 2021 · 1 comment · Fixed by #1875
Closed

WKWebView inconsistent print margins #1873

lubos opened this issue Jan 8, 2021 · 1 comment · Fixed by #1875
Labels
Milestone

Comments

@lubos
Copy link
Contributor

lubos commented Jan 8, 2021

It seems like new WKWebView is injecting undesirable print margins which is not consistent with how web-browsers are behaving.

For example, consider printing this HTML:

<div style="background-color: #000; height: 100px"></div>

When printing this HTML from WKWebView, here is the print preview:

wkwebview

When printing this HTML from Safari, here is the print print preview:

safari

Notice inconsistent print margins between those two.

I think it has something to do with:

var printInfo = NSPrintInfo.SharedPrintInfo;

Where the legacy WebView component had the margins hardcoded as per:

const float margin = 24f;
var printOperation = frameView.GetPrintOperation(new NSPrintInfo
{
VerticallyCentered = false,
LeftMargin = margin,
RightMargin = margin,
TopMargin = margin,
BottomMargin = margin
});

@cwensley
Copy link
Member

cwensley commented Jan 8, 2021

Hey @lubos,

Thanks for reporting the issue! Looks like (another) easy fix.

@cwensley cwensley added the bug label Jan 8, 2021
@cwensley cwensley added this to the 2.5.10 milestone Jan 8, 2021
cwensley added a commit to cwensley/Eto that referenced this issue Jan 10, 2021
cwensley added a commit to cwensley/Eto that referenced this issue Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants