I have a FlowDocument that varies in height due to an ItemsControl in a BlockUIContainer. In some cases, the ItemsControl extends beyond the page height. Is there a way to scale the FlowDocument to fit a page (8.5" X 11") right before printing if needed?
As of right now, the FlowDocument is named 'doc' and the method for printing I am using is:
private void Print_Click(object sender, RoutedEventArgs e)
{
PrintDialog pd = new PrintDialog();
doc.PageHeight = pd.PrintableAreaHeight;
doc.PageWidth = pd.PrintableAreaWidth;
doc.ColumnGap = 0;
doc.ColumnWidth = pd.PrintableAreaWidth;
IDocumentPaginatorSource dps = doc;
pd.PrintDocument(dps.DocumentPaginator, "Sheet");
}