AvaloniaUI.PrintToPDF
AvaloniaUI.PrintToPDF copied to clipboard
how print usercontrol without show in windows
i create some report use usercontrol,i want print it without show
I don't how how to print without showing it.
If this is acceptable, you can wrap your control inside a window and just show the window during printing.
var window = new Window
{
Content = new SomeReportUserControl(),
SizeToContent = SizeToContent.WidthAndHeight
};
window.IsVisible = true;
await Print.ToStreamAsync(stream, window);
window.IsVisible = false;