Writing my very first WPF app and am having trouble getting printing to work like I want.
I have a very simple text document that need to print with a color border around the edge of the page.
I am printing in landscape orientation and want this to fill the page with a color border around the edge of the whole page. It prints in landscape, but the content still appears to be formatted in portrait orientation and the border is cut off at the bottom of the page and from sided to side it does not come close to filling the document.
How do I get it to print the whole page and not cut off the bottom?
The code for this is;
string strPrintText = "FedEx Standard Overnight"; PrintDialog pdHeader = new PrintDialog(); Run runHeader = new Run(strPrintText); runHeader.FontFamily = new FontFamily("Arial"); Paragraph paHeader = new Paragraph(); paHeader.FontSize = 140; paHeader.BorderThickness = new Thickness(50); paHeader.BorderBrush = Brushes.Brown; paHeader.Inlines.Add(runHeader); FlowDocument fdHeader = new FlowDocument(paHeader); fdHeader.PagePadding = new Thickness(100); IDocumentPaginatorSource dpHeader = fdHeader; pdHeader.PrintTicket.PageOrientation = PageOrientation.Landscape; pdHeader.PrintDocument(dpHeader.DocumentPaginator, "");
And the output looks like;