mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
PrintToPDFOptions - PageSize: Object width and height = Invalid Page Size error #882
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@FlorianRappl commented on GitHub (Nov 1, 2025):
Part of
ElectronNET.Core0.1.0.