Questions tagged [fixeddocument]
70 questions
13
votes
1 answer
WPF - Auto Line Number for FlowDocument?
I'm just starting on a contract generation routine for my current project and one of the requirements is that each of the lines in the contract must be numbered. The number should be located in the left margin with a vertical rule separating the…

Sonny Boy
- 7,848
- 18
- 76
- 104
11
votes
4 answers
WPF: FixedDocument in Visual Studio 2008 Designer
It's a well-known bug that Visual Studio shows an error when you try to construct a FixedDocument in XAML. For example, the following snippet

Heinzi
- 167,459
- 57
- 363
- 519
10
votes
2 answers
Saving a FixedDocument to an XPS file causes memory leak
I have created a .NET Windows Service which performs certain actions and generates reports. These reports are XPS documents which I save in a certain directory.
Being familiar with WPF, the way I have chosen to create the reports is to instantiate a…

Ross
- 4,460
- 2
- 32
- 59
10
votes
3 answers
WPF FixedDocument pagination
How do I get FixedDocument to automatically paginate? I have the following code that I can use to put prettified Panel into a DocViewer. The problem occurs when the Panel extends past a single page. Right now, we simply clip. Basically, I want…

Doo Dah
- 3,979
- 13
- 55
- 74
10
votes
1 answer
What's the correct way to add a PageContent/ FixedPage to a FixedDocument in WPF?
In WPF, in order to add a FixedPage to a FixedDocument in code one needs to:
var page = new FixedPage();
var pageContent = new PageContent();
((IAddChild)pageContent).AddChild(page);
This appears to be the only way, however:
The MSDN…

nicodemus13
- 2,258
- 2
- 19
- 31
8
votes
3 answers
Why am I losing my databinding when printing to an XpsDocument?
Update!
Binding works. The issue is that the XpsDocumentWriter doesn't properly write the first page of the first document of a FixedDocumentSequence. This seems to be an issue encountered by lots of people doing this sort of thing (i.e., five…
user1228
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
7
votes
4 answers
iTextSharp to generate PDF from WPF FixedDocument
I have a simple WPF app that displays and prints some
reports with a FixedDocument.
How can generate PDF's from that, with a free and open solution,
such as iTextSharp?

leo.Mayer
- 71
- 1
- 1
- 3
6
votes
1 answer
WPF TextBlock get lines after textwrapping
I have FixedDocument page and I want to place TextBlock on it, but it can be that Textblock doesn't fit on page by height.
So I want to take lines from generated TextBlock with TextWrapping, and then create new TextBlock, that fitted by height and…

Kalyaganov Alexey
- 1,701
- 1
- 16
- 23
5
votes
2 answers
remove page from fixed document?
How can I remove a page from a fixedDocument?
I add pages like this:
// Add page to pageContent
PageContent pageContent = new PageContent();
((IAddChild)pageContent).AddChild(fixedPage);
// Add pageContent to…

tinmac
- 2,357
- 3
- 25
- 41
5
votes
1 answer
Adding System.Drawing.Image to FixedDocument
I have 10 System.Drawing.Image. I need to add them to a FixedDocument. I tried the below code and the fixed document is procuded with all the 10 pages consists of only first image.
FixedDocument doc = new FixedDocument();
BitmapSource[] bmaps = new…

Uthistran Selvaraj.
- 558
- 2
- 11
- 29
5
votes
2 answers
How to set the Page Size for an Xps Document?
I am trying to save an XPS document with a FixedDocument. So far, I have failed to change the page size. How can I change it to a custom size?
I have based my code on the first answer to this question, more specifically, I am using this code:
…

O. R. Mapper
- 20,083
- 9
- 69
- 114
4
votes
1 answer
Why do I get "The property 'Pages' does not have an accessible setter" for a simple in Expression Blend 4?
I have a XAML file which I have pared down to find the cause of this issue to the following minimal case:
…

whybird
- 1,108
- 8
- 19
4
votes
1 answer
Set file name in "Microsoft Print to PDF" printer using System.Print
I want to save an IDocumentPaginatorSource, e.g. FixedDocument or XpsDocument, as a PDF by using the virtual printer "Microsoft Print to PDF":
var printServer = new System.Printing.PrintServer();
var queue = printServer.GetPrintQueue("Microsoft…

Sebastian Negraszus
- 11,915
- 7
- 43
- 70
4
votes
0 answers
Out of memory Exception while printing in WPF
I was trying to print the set of 70 images in WPF.
So I used Fixed document as I saw in many references and tried printing using the below code.
private void button1_Click(object sender, RoutedEventArgs e)
{
PrintDialog d = new…

Uthistran Selvaraj.
- 558
- 2
- 11
- 29