Xsemmel/PrintEngine/Printing.cs
/// <summary>
/// Creates a FlowDocument from TextEditor text to print.
/// </summary>
Creates a FlowDocument from TextEditor text to print.
Creates a FlowDocument from TextEditor text to print .
static FlowDocument CreateFlowDocumentToPrint(TextEditor textEditor, PageSettings pageSettings, PrintTicket printTicket)
        {
            FlowDocument doc = CreateFlowDocumentForEditor(textEditor);
            doc.ColumnWidth = pageSettings.PrintableArea.Width;
            doc.PageHeight = (pageSettings.Landscape ? (int)printTicket.PageMediaSize.Width : (int)printTicket.PageMediaSize.Height);
            doc.PageWidth = (pageSettings.Landscape ? (int)printTicket.PageMediaSize.Height : (int)printTicket.PageMediaSize.Width);
            doc.PagePadding = ConvertPageMarginsToThickness(pageSettings.Margins);
            doc.FontFamily = textEditor.FontFamily;
            doc.FontSize = textEditor.FontSize;
           return doc;
        }
static FlowDocument CreateFlowDocumentToPrint ( TextEditor textEditor , PageSettings pageSettings , PrintTicket printTicket ) { FlowDocument doc = CreateFlowDocumentForEditor ( textEditor ) ; doc . ColumnWidth = pageSettings . PrintableArea . Width ; doc . PageHeight = ( pageSettings . Landscape ? ( int ) printTicket . PageMediaSize . Width : ( int ) printTicket . PageMediaSize . Height ) ; doc . PageWidth = ( pageSettings . Landscape ? ( int ) printTicket . PageMediaSize . Height : ( int ) printTicket . PageMediaSize . Width ) ; doc . PagePadding = ConvertPageMarginsToThickness ( pageSettings . Margins ) ; doc . FontFamily = textEditor . FontFamily ; doc . FontSize = textEditor . FontSize ; return doc ; }
Creates a FlowDocument from TextEditor text to print.
Creates a FlowDocument from TextEditor text to print .
// this baby has all settings to be printed or previewed in the PrintEngine.PrintPreviewDialog
textEditor
TextEditor
pageSettings
PageSettings
printTicket
PrintTicket