Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Printing in UWP results in crash #114

Open
ulbin opened this issue Jun 28, 2023 · 3 comments
Open

[Bug] Printing in UWP results in crash #114

ulbin opened this issue Jun 28, 2023 · 3 comments

Comments

@ulbin
Copy link

ulbin commented Jun 28, 2023

Description of the error

When printing from WebView application crashes in Forms9Patch.UWP in file Label_Renderer.cs in routine GetDesiredSize because heightConstraint is infinite or NaN as reported by the debugger.

   public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)

This is not detected by the if statement, and the application crashes after successfully printing the document.

It is Failed successfully error!

Workaround

It could not be resolved using the Nuget library, but an exception can be caught using source files. The If statement in the routine should be put in try...catch, so zero is returned (return new SizeRequest(Size.Zero);) in case of the exception.

@ulbin ulbin changed the title Printing in UWP results in crash[Bug] [Bug] Printing in UWP results in crash Jun 28, 2023
@baskren
Copy link
Owner

baskren commented Jun 28, 2023

@ulbin : My apologies, I am no longer actively developing this library.

@ulbin
Copy link
Author

ulbin commented Jun 28, 2023

@ulbin : My apologies, I am no longer actively developing this library.

It is OK, I am using it only for printing until I am still using Xamarin.Forms. Thank you for your good work.

@baskren
Copy link
Owner

baskren commented Jun 28, 2023

FWIW, I've been maintaining similar functionality for WinUI here: https://github.com/baskren/P42.Uno.HtmlExtensions/tree/main/P42.Uno.HtmlExtensions/Windows. You might find it useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants