PrintToPDFOptions - PageSize: Object width and height = Invalid Page Size error #879

Open
opened 2026-01-29 16:51:05 +00:00 by claunia · 0 comments
Owner

Originally created by @wana211 on GitHub (Apr 24, 2023).

The "PrintToPDFOptions" class which is passed to the "PrintToPDFAsync" method has a "PageSize" property.
In Electron you can pass in an object specifying a custom width and height.
However in Electron.NET this property must be a string.
When Electron.NET is deserializing the "PrintToPDFOptions" the "PageSize" property is being deserialized as a string and sent to Electron as a string rather than a JSON object. This results in Electron expecting the page size to be one of the pre-defined string ones (e.g. A4) rather than a custom size.

Originally created by @wana211 on GitHub (Apr 24, 2023). The "PrintToPDFOptions" class which is passed to the "PrintToPDFAsync" method has a "PageSize" property. In Electron you can pass in an object specifying a custom width and height. However in Electron.NET this property must be a string. When Electron.NET is deserializing the "PrintToPDFOptions" the "PageSize" property is being deserialized as a string and sent to Electron as a string rather than a JSON object. This results in Electron expecting the page size to be one of the pre-defined string ones (e.g. A4) rather than a custom size.
claunia added the bug label 2026-01-29 16:51:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#879