flowdocument

Why is this flowdocument table always printing 2 columns

I have a ListView in my WPF app that is bound to a collection of tasks to perform (A to-do list). I want the user to be able to print their list and have created the following code based on the MSDN guidelines. (This my first foray into printing) public FlowDocument GetPrintDocument() { FlowDocument flowDoc = new FlowDocument(); ...

How to insert inline content from one FlowDocument into another?

I'm building an application that needs to allow a user to insert text from one RichTextBox at the current caret position in another one. I spent a lot of time screwing around with the FlowDocument's object model before running across this technique - source and target are both FlowDocuments: using (MemoryStream ms = new MemoryStream())...

Missing images in FlowDocument saved as XPS document

I am having some difficulties getting images contained in a FlowDocument to show when the FlowDocument is saved as an XPS document. Here is what I do: Create an image using the Image control of WPF. I set the image source bracketed by calls to BeginInit/EndInit. Add the image to the FlowDocument wrapping it in a BlockUIContainer. Sa...

Saving FlowDocument to SQL Server

I need to save WPF FlowDocuments to SQL Server. What is the best format for doing that? String? Blob? Does it matter in a document less than 5K words or so? ...

What is the best substitute for FlowDocument in Silverlight?

I'm porting an application from WPF to Silverlight and was saddened to read of the lack of FlowDocument support. What is the best way in Silverlight then to display text with markup? I just need the basics, e.g. bold italic hyperlink colors font sizes Added: I don't mean a RichTextBox (as in the Vectorlight demo) but a way to for...

Creating blob properties with Entity Framework 4?

I am creating an EF4 model-first application with a WPF UI. One of the controls on my UI is a RichTextDocument, which outputs a WPF FlowDocument. I can either serialize the FlowDocument to a byte array, or extract its XAML markup as a string. I would prefer to use binary serialization, if I can. Here are my questions: If I serialize t...

Paragraph formatting in a WPF RichTextBox?

I need to apply paragraph formatting to a selection in a rich text box. My RTB will behave the same way as the rich text boxes on StackOverflow--the user can type text into the RTB, but they can also enter code blocks. The RTB will apply very simple formatting to the code block--it will change the font and apply a background color to the...

FlowDocument Repeating table header

Hi How can I know if am at the end of a page and insert a break? I'm trying to print a wpf document with repeated header. Regards ...

Is it possible to vertical align listitem marker in a flowdocument?

I want to to align listitem marker to the top, default is alignment to the bottom of the first block. My faulty code: <Grid> <FlowDocumentScrollViewer> <FlowDocument> <List MarkerStyle="Decimal"> <ListItem> <BlockUIContainer> <Grid> ...

WPF FlowDocument - Absolute Character Position

I have a WPF RichTextBox that I am typing some text into and then parsing the whole of the text to do processing on. During this parse, I have the absolute character positions of the start and end of each word. I would like to use these character positions to apply formatting to certain words. However, I have discovered that the FlowDoc...

Typographic entities in WPF FlowDocument

Is it a way to add to FlowDocument content specific typographic symbols (dashes, greek symbols, etc)? ...

Cleanup for control inside a FlowDocument

I have a custom control that I use inside a FlowDocument. The control uses a System.Drawing.ImageAnimator to display transparent, animated GIF images. Why is this such a pain in the butt in WPF anyway? :P In my original implementation, this was causing memory leaks when a paragraph containing the control was being deleted from the docum...

WPF FlowDocument - Fonts only black and white

Our app has a WPF FlowDocumentScrollViewer that shows a flowdocument with text in three font colors: Lavender, #FFFFFFE8, and Orange. The background of the Viewer is set to transparent, with the window behind it having a Black background. This works fine for everybody except for one customer. For him, the Lavender colored text shows u...

How to print WPF FlowDocument within local report?

Hi, in one of our applications we're using alocal RDLC-report (displaying using a ReportViewer control) to print some tables and text entered by the user. We'd like to give the user the ability of formatting the text. I thought I might use the respective WPF controls (embedded into the Windows Forms application) to make things easy. Q...

Rotate Windows.Documents.Table

I need to rotate a table clockwise up to 90 degrees. It's one of the blocks of a FlowDocument. Is there a way to apply some kind of rotation to a Table? The possible solution of creating TextEffect like this: var table = new Table(); ... // fill the table here var effect = new TextEffect { ...

WPF: How to justify all lines within paragraphs (lines with line breaks too)

Hello, i have a some paragraphs within a FlowDocument, and what i need is to justify all lines (even lines with line breaks) Here's a code sample: <Paragraph TextAlignment="Justify"> "One of the most important operations necessary when text materials are prepared for printing or display is the task of dividing long paragraphs into in...

Opening FlowDocument saved as XPS document with XPS viewer?

I am saving a WPF FlowDocument to the file system, using this code and a fileName with an xps extension: // Save FlowDocument to file system as XPS document using (var fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { var textRange = new TextRange(m_Text.ContentStart, m_Text.ContentEnd); textRange.Sav...

How to use 2 or more columns with FlowDocumentScrollReader (WPF) ?

Hi, I would like to use at the same time multiple columns and scrollbar with FlowDocument. Is that possible ? Actually, I can only have multiple column in page mode but no scrollbar. Thanks !! ...

Add Table to FlowDocument In Code Behind

Hi, I have tried this..... _doc = new FlowDocument(); Table t = new Table(); for (int i = 0; i < 7; i++) { t.Columns.Add(new TableColumn()); } TableRow row = new TableRow(); row.Background = Brushes.Silver; row.FontSize = 40; row.FontWeight = FontWeights.Bold; row.Cells.Add(new TableCell(new Paragraph(new Run("I span 7 columns")...

Convert XAML to FlowDocument to display in RichTextBox in WPF

I have some HTML, which i am converting to XAML using the library provided by Microsoft string t = HtmlToXamlConverter.ConvertHtmlToXaml(mail.HtmlDataString,true); now, from http://stackoverflow.com/questions/1449121/how-to-insert-xaml-into-richtextbox i am using the following: private static FlowDocument SetRTF(string xamlString) ...