-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
feat: add MacOS print options #1259
Conversation
Currently, when printing on a MacOS, it defaults to a quite big margin, which does not reflect the side of it when printing on the web. The current code just creates a new NSPrintInfo from the default, which for some reason has a large margin. This changes so that the default margin is 0 and add the option to change it when printing the webview on MacOs. This is not a field that can be changed by the user on the appkit modal, so it has to be defined before the modal is open. Other options could be added on top of these ones, but for this initial commit/PR decided to go with adding the margins since it seems to be the one with bigger discrepancy compared to the web version. References: - https://developer.apple.com/documentation/appkit/nsprintinfo
Hi, can you add a changelog (https://github.com/tauri-apps/wry/tree/dev/.changes) and do a |
Done! ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Description
Currently, when printing on a MacOS, it defaults to a quite big margin, which does not reflect the side of it when printing on the web. The current code just creates a new NSPrintInfo from the default, which for some reason has a large margin.
This changes so that the default margin is 0 and add the option to change it when printing the webview on MacOs. This is not a field that can be changed by the user on the appkit modal, so it has to be defined before the modal is open.
Other options could be added on top of these ones, but for this initial commit/PR decided to go with adding the margins since it seems to be the one with bigger discrepancy compared to the web version.
Closes #713 (Not sure if should mark this as really close it since it really fixes only the margin part. The difference on the modal doesn't seem to be customisable as far as I understood from the docs).
References:
Screenshots:
Using the new
print.rs
in the examples folder.Current default print
Default print with these changes