Questions tagged [flowdocument]

Microsoft's WPF FlowDocument technology allows to render embedded, dynamically adjusted and re-flowing document content that supports columns, pagination and search.

A flow document is designed to "reflow content" depending on window size, device resolution, and other environment variables. Flow content can be complex, consisting of various elements including text, images, tables. In addition, flow documents have a number of built in features including search, viewing modes that optimize readability, and the ability to change the size and appearance of fonts.

571 questions
10
votes
3 answers

How to convert FlowDocument to rtf

I have used a WPF RichTextBox to save a flowdocument from it as byte[] in database. Now i need to retrieve this data and display in a report RichTextBox as an rtf. when i try to convert the byte[] using TextRange or in XAMLReader i get a…
Arvind
10
votes
5 answers

Scroll a WPF FlowDocumentScrollViewer from code?

I have a FlowDocumentScrollViewer I want to automatically scroll to the bottom when text is added.
TimothyP
  • 21,178
  • 26
  • 94
  • 142
10
votes
1 answer

How to create a Xaml FlowDocument with Page Headers and Footers when rendered to XPS?

I am looking for an idea of a clean generic way to describe repeating page headers and footers in a XAML FlowDocument without any code behind. It only needs to show up correctly when rendered to XPS from C#.
jbtule
  • 31,383
  • 12
  • 95
  • 128
10
votes
1 answer

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…
Robert Rossney
  • 94,622
  • 24
  • 146
  • 218
9
votes
2 answers

Printing BlockUIContainer to XpsDocument/FixedDocument

Question How do you print a FlowDocument that have BlockUIContainer? How can I force a Measure/Update/Arrange on a FlowDocument? Background I have a generated FlowDocument with paragraphs of text with a few Rectangle elements filled DrawingBrushes…
Dennis
  • 20,275
  • 4
  • 64
  • 80
9
votes
2 answers

Avoid multiple columns in printing FlowDocument

I am writing code to print from a FlowDocument. PrintDialog printDialog = new PrintDialog(); bool? result = printDialog.ShowDialog(); if (result == true) { FlowDocument fd = new FlowDocument(); …
Nishant
  • 443
  • 3
  • 9
9
votes
3 answers

C# FlowDocument to HTML conversion

Basically, I have a RichTextBox and I want to convert the formatted contents of it to HTML so it can be sent as an email. The method I am currently using does not give any formatting at all: string message = new…
nevada_scout
  • 971
  • 3
  • 16
  • 37
9
votes
3 answers

What are my options for document layout in WPF?

Using WPF's FlowDocument, I have run in to a number of situations where I need more control over the layout of the document, from simple things (page headers and footers) to more complex (footnotes, magazine style story flow) to even more complex…
yclevine
  • 990
  • 3
  • 9
  • 20
9
votes
3 answers

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…
Alan Spark
  • 8,152
  • 8
  • 56
  • 91
9
votes
3 answers

Slow formatting of RichTextBox

I'm getting poor performance when formatting text in an rtb:
Johan Larsson
  • 17,112
  • 9
  • 74
  • 88
9
votes
1 answer

How can we show .rtf or .doc as flowdocument in WPF?

It is for the help section of the application. I am thinking to put flowdocumentReader to show the help document. But is it possible to show .rtf or any .doc to show in Flowdocument.Or is it neccesary to create a flow document in Xaml. Please…
Ershad
  • 947
  • 2
  • 20
  • 40
9
votes
1 answer

WPF RichTextBox - ScrollToEnd() method does not cause any scrolling to occur

The RichTextBox component in my WPF app is populated using a FlowDocument and the RichTextBox's Document property. rtb.ScrollToEnd(); doesn't seem to do anything, and i've even tried calling BringIntoView() on the last "row" added to the table that…
Kyle
  • 355
  • 1
  • 4
  • 13
8
votes
8 answers

FlowDocument Memory Issue in C#

I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't…
Jasson
  • 259
  • 5
  • 12
8
votes
1 answer

creating an XPS Document from a FlowDocument and attach it on the fly

I have a FlowDocument that I want to convert to an XPS Document and attach it to an e-mail and send it all together. I'm using this code public static MemoryStream FlowDocumentToXPS(FlowDocument flowDocument, int width, int height) { …
Musaab
  • 805
  • 2
  • 13
  • 30
8
votes
1 answer

flowdocument - inserting rich text at end creating extra paragraph breaks above insertion point

I am creating a flowdocument that consists of multiple records. Each record contains two tables at the top, and then some rich text that I'm pulling out of a database. The code that appends the rich text is found below (cp.Comments contains the rtf…
taglius
  • 1,237
  • 1
  • 10
  • 26
1
2
3
37 38