ElectronNET / Electron.NET

:electron: Build cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor).

Home Page:https://gitter.im/ElectronNET/community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wana211 opened this issue · comments

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.