Yes, there's a way! You have to call
PrintDialog
on the beginning of the process, then you have to loop through the "WPF pages".
For example:
PrintDialog pd = new PrintDialog();
FixedDocument document = new FixedDocument();
document.DocumentPaginator.PageSize = new Size(pd.PrintableAreaWidth, pd.PrintableAreaHeight);
foreach(var p in YourPages)
{
FixedPage page1 = new FixedPage();
page1.Width = document.DocumentPaginator.PageSize.Width;
page1.Height = document.DocumentPaginator.PageSize.Height;
}
See:
WPF Printing Part 2 – The Fixed Document[
^]