Advice, please? I did search StackOverflow and this forum before asking.
I load a plain ASCII text file into RichTextBox, set a small fixed font size, then print. BullZip is installed in Win64 with default settings.
BullZip always uses 2 columns per page, when the RichTextBox only has one column, with short lines. This happens even if the font size is smaller (example Consola mono , making each line of text much less than page width. I also tried entering text by hand, explicitly using <Return> at the end of each short line.
Example code below. It creates a copy of the text first, to work-around the "RichTextBox displays as blank after print" problem :-
private void MnuFilePr_Click(object sender, RoutedEventArgs e)
}
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog() == true)
{
MemoryStream stream = new MemoryStream();
TextRange sourceDocument = new TextRange(rtbMain.Document.ContentStart, rtbMain.Document.ContentEnd);
sourceDocument.Save(stream, DataFormats.Xaml);
FlowDocument flowDocumentCopy = new FlowDocument();
TextRange copyDocumentRange = new TextRange(flowDocumentCopy.ContentStart, flowDocumentCopy.ContentEnd);
copyDocumentRange.Load(stream, DataFormats.Xaml);
pd.PrintDocument(((IDocumentPaginatorSource)flowDocumentCopy).DocumentPaginator,
"Printing Richtextbox Content");
}
}
Any thoughts on what I'm doing wrong, please?
Roops
BullZip prints 2 columns. C# WPF RichTextBox plain text
Moderator: jr
-
- Posts: 2
- Joined: Wed Jan 04, 2023 1:39 pm
-
- Posts: 2
- Joined: Wed Jan 04, 2023 1:39 pm
Re: BullZip prints 2 columns. C# WPF RichTextBox plain text
*should say "Consola mono 8", of course. Accidental smiley.