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

Closed
opened 2026-01-29 16:51:07 +00:00 by claunia · 1 comment
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:07 +00:00
Author
Owner

@FlorianRappl commented on GitHub (Nov 1, 2025):

Part of ElectronNET.Core 0.1.0.

@FlorianRappl commented on GitHub (Nov 1, 2025): Part of `ElectronNET.Core` 0.1.0.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#882