Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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