google-labs-jules[bot] a1463dfeb9 Output:
Fix: Correct print scaling for Win2D PDF printing

Issue:
When you're printing pages using Win2D, especially when dealing with PDF documents that are rendered to CanvasBitmaps, you might run into some problems if your Windows display scaling isn't set to 100%. You might find that the edges of your printed PDF page are cut off, or the content might look like it's spilling out of the paper boundaries.

Cause:
The problem was happening because a part of the code, `PdfDocument.GetPage().RenderToStreamAsync()`, was being used without specifying certain rendering options (`PdfPageRenderOptions`). This meant the PDF page was being turned into an image stream using a default resolution (probably assuming 96 DPI for the PDF's original size) and wasn't taking into account the printer's actual DPI or your system's display scaling factor (`RawPixelsPerViewPixel`). Because of this, the `CanvasBitmap` created from this stream had pixel dimensions that didn't accurately match the intended physical size on paper when display scaling was active. This led to an incorrect layout by `CanvasPrintDocument`.

Solution:
I've made changes to the `LoadPDFPageBitmapsAsync` method in `Wino.Core.UWP/Services/PrintService.cs` to address this. Here's what I did:
1. I now get the printer's DPI from the `CanvasPrintDocument` (`sender.Dpi`).
2. I also get your current system display scaling factor (`DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel`).
3. For each page in your PDF, I calculate the target pixel dimensions needed to print the page at its correct physical size, using the printer's DPI.
4. Then, I figure out the necessary `DestinationWidth` and `DestinationHeight` (in DIPs) for `PdfPageRenderOptions` by dividing those target pixel dimensions by the `rawPixelsPerViewPixel`.
5. Finally, I call `PdfPage.RenderToStreamAsync()` using these calculated options.

This makes sure that the `CanvasBitmap` objects are created with pixel dimensions that are right for the printer's resolution and are correctly scaled according to your system's display settings. I ran some checks by simulating how this would work with display scaling at 100%, 125%, and 150%, and it confirmed that the calculations are now correct.
2025-05-20 18:48:21 +00:00
2024-01-20 18:03:58 +01:00
2025-05-18 14:06:25 +02:00
2025-05-18 14:06:25 +02:00
2025-05-20 18:48:21 +00:00
2025-02-15 12:53:32 +01:00
2025-05-03 19:08:22 +02:00
2025-02-16 11:54:23 +01:00
2024-04-18 01:44:37 +02:00
2024-04-18 01:44:37 +02:00
2025-04-21 10:15:05 +02:00
2024-04-18 01:19:30 +02:00
2024-07-01 22:48:45 +02:00
2025-02-15 12:53:32 +01:00
2025-03-15 15:23:26 +01:00
2025-02-15 12:53:32 +01:00
2025-02-14 01:43:52 +01:00

Wino Mail

Native mail client for Windows device families.


pdark

Motivation

I'm a big fan of Windows Mail & Calendars due to its simplicity. Personally, I find it more intuitive for daily use cases compared to Outlook desktop and the new WebView2 powered Outlook version. Seeing Microsoft deprecating it dragged me into starting to work on Wino a couple of years ago. Wino's main motivation is to bring all the existing functionality from Mail & Calendars over time without changing the user experience that millions have loved since the Windows 8 days in Mail & Calendars

Features

  • API integration for Outlook and Gmail
  • IMAP/SMTP support for custom mail servers
  • Send, receive, mark as (read,important,spam etc), move mails.
  • Linked/Merged Accounts
  • Toast notifications with background sync.
  • Instant startup performance
  • Offline use / search.
  • Modern and responsive UI
  • Lots of personalization options
  • Dark / Light mode for mail reader

Download

Download latest version of Wino Mail from Microsoft Store for free.

Beta Releases

Stable releases will always be distributed on Microsoft Store. However, beta releases will be distributed in GitHub Releases. Please keep in mind that beta releases might not be for daily use, only for testing purposes and recommended for experienced users or developers. Beta releases are also managed manually. Therefore, code in the repository might be ahead of the released Beta version at the moment. Make sure to compare versions before tryout out the Beta version.

These releases are distributed as side-loaded packages. To install them, download the .msixbundle file in GitHub releases and follow the steps explained here.

Contributing

Check out the contribution guidelines before diving into the source code or opening an issue. There are multiple ways to contribute and all of them are explained in detail there.

Donate

Your donations will motivate me more to work on Wino in my spare time and cover the expenses to keep project's website alive.

  • You can donate via Paypal by clicking here
  • You can buy Unlimited Accounts add-on in the application. It's a one-time payment for lifetime, not a monthly recurring payment.
Description
Built-in Mail & Calendars app clone for Windows.
Readme 12 MiB
Languages
C# 92.9%
JavaScript 6.8%
HTML 0.3%