Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to default print preference to A5 when printing flowdocument

$
0
0

Hello,

I'm having a problem. I need my printer to default to A5 print out without altering the print preferences but by doing it through code.

here is my print Code:

 System.Windows.Controls.PrintDialog pd = new System.Windows.Controls.PrintDialog();
           
            if (pd.ShowDialog() == true)
            {
              

                myFlowDocument.PageHeight = pd.PrintableAreaHeight;                
                myFlowDocument.PageWidth = pd.PrintableAreaWidth;
                myFlowDocument.PagePadding = new Thickness(45, 40, 30, 30);                
                //myFlowDocument.PagePadding = new Thickness(50);
                myFlowDocument.ColumnGap = 0;
                myFlowDocument.ColumnWidth = pd.PrintableAreaWidth;
                HeaderedFlowDocumentPaginatorResult paginator = new HeaderedFlowDocumentPaginatorResult(myFlowDocument);                    
                pd.PrintDocument(paginator, "flow doc");

}

Thank you in advance


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>