Reputation: 73998
I have this demo app, I need to print FlowDocument without pop-up the Printing Dialogue from the operational system. Do you have any idea how to do it? Or you know other possible posolution?
private void Button_Click(object sender, RoutedEventArgs e)
{
PrintDialog pd = new PrintDialog();
pd.ShowDialog();
if (pd.ShowDialog() != true) return;
flowDocument.PageHeight = pd.PrintableAreaHeight;
flowDocument.PageWidth = pd.PrintableAreaWidth;
IDocumentPaginatorSource idocument = flowDocument as IDocumentPaginatorSource;
pd.PrintDocument(idocument.DocumentPaginator, "Printing Flow Document...");
}
Upvotes: 0
Views: 2638
Reputation: 6491
delete this lines:
pd.ShowDialog();
if (pd.ShowDialog() != true) return;
Upvotes: 4