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
8
votes
2 answers

WPF - FlowDocument - Stretch Table to Entire Width?

I have a DataTable containing an arbitrary number of columns and rows which I am trying to print out. The best luck I've had so far is by putting the data into a Table and then adding the table to a FlowDocument. So far so good. The problem I have…
Sonny Boy
  • 7,848
  • 18
  • 76
  • 104
8
votes
1 answer

Binding a list in a FlowDocument to List?

I have a FlowDocument containing stuff bound to my ViewModel like this: Now I want to…
Sam
  • 28,421
  • 49
  • 167
  • 247
8
votes
2 answers

Insert contents from the one FlowDocument into another when using XamlReader and XamlWriter

I use FlowDocument with BlockUIContainer and InlineUIContainer elements containing (or as base classes) some custom blocks - SVG, math formulas etc. Because of that using Selection.Load(stream, DataFormats.XamlPackage) wont work as the serialization…
too
  • 3,009
  • 4
  • 37
  • 51
8
votes
1 answer

How to convert FlowDocument to FixedDocument using FlowDocument's IDocumentPaginatorSource DocumentPaginator?

I have: DocumentPaginator dp = ((IDocumentPaginatorSource)document).DocumentPaginator; and: FlowDocument document = new FlowDocument(); // create a flow document... How do a convert the FlowDocument to a FixedDocument using the DocumentPaginator? …
Wes
  • 486
  • 3
  • 15
8
votes
2 answers

Copying one FlowDocument to Second FlowDocument

How can i copy the contents of one FlowDocument to another FlowDocument below is what i tryed foreach (var blk in fd1.Blocks) { fd2.Blocks.Add(blk); } fd1 is FlowDocument1 and fd2 is FlowDocument2. But i get the below error. Collection was…
ARV
  • 1,111
  • 5
  • 22
  • 46
8
votes
3 answers

How to adjust the space between paragraph in a flow document by programming

I'm a beginer in C# Wpf and I want to make a flow document with few paragrah by programming. The problem is that there is a big space between pagraphs and i want to resize it to its minimum. I found a solution by using a Xml statement, but i want to…
Walid A
  • 81
  • 1
  • 2
8
votes
2 answers

How do you erase all content of a flowdocument

I have created a flowdocument and added numerous paragraphs to it programmically. Now in the I would like to be able to reset the flow document to a blank slate resulting in everything being erased. I have looked for things like Clear, Reset,…
Jack
  • 241
  • 4
  • 12
7
votes
2 answers

Keeping the FlowDocument cursor centered vertically in the RichTextBox

I am having a bit of trouble figuring this one out, hopefully someone can help. I have a WPF project with a RichTextBox. As I edit the text, I would like the cursor in document to always stay centered vertically. For example as a push up or down…
shenku
  • 11,969
  • 12
  • 64
  • 118
7
votes
2 answers

WPF/XAML: Typography.Capitals seems to have no effect

All of these bits of text look the same, but I am trying to get them to look different. I want small caps text. What am I missing here to get the small caps typography effect to work? To reproduce this, open Visual Studio 2008, Do File|New Project,…
Anthony
  • 5,176
  • 6
  • 65
  • 87
7
votes
1 answer

How can I vertically align a TableCell (or its content) of a FlowDocument

Is there any way to align the content of a TableCell to the bottom? I thought this was easy, but obviously, it is not. The situation: Inside a FlowDocument I have the following (simplified) Table:
wkl
  • 1,896
  • 2
  • 15
  • 26
7
votes
1 answer

Implementing footnotes in a WPF FlowDocument

What would be the best approach to display footnotes for FlowDocument content in a FlowDocumentPageViewer? My first thought was to have the contents of the footnote follow immediately after the footnote anchor within the FlowDocument, with the…
yclevine
  • 990
  • 3
  • 9
  • 20
7
votes
1 answer

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)) { …
David Veeneman
  • 18,912
  • 32
  • 122
  • 187
7
votes
4 answers

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…
Jakob Christensen
  • 14,826
  • 2
  • 51
  • 81
7
votes
3 answers

Highlight parts of text in FlowDocument

I want to highlight some parts of text in a FlowDocument based on the search results. What I am doing is getting the indexes where the searched word occures in the text of the FlowDocument and then apply background color on the text range starting…
kzub
  • 232
  • 3
  • 13
7
votes
4 answers

Setting WPF text to TextBlock

I know that TextBlock can present a FlowDocument, for example: Courier New 24 I would like to know how to set a FlowDocument that is…
Elad
  • 19,079
  • 18
  • 62
  • 71
1 2
3
37 38