XPSDocument is a class that renders XPS documents in WPF (Windows Presentation Foundation)
Questions tagged [xpsdocument]
113 questions
20
votes
3 answers
How to create an XPS document?
I'd like to create an XPS document for storing and printing.
What is the easiest way to create an XPS document (for example with a simple grid with some data inside) in my program, and to pass it around?

Sam
- 28,421
- 49
- 167
- 247
19
votes
1 answer
FileFormatException when serializing a FixedDocument
When serializing a FixedDocument to XPS I sometimes get a FileFormatException telling me that the format of a font (I assume) does not conform to the expected file format specification (see exception further down).
The mysterious part is:
The…

Daniel
- 471
- 5
- 28
11
votes
0 answers
How use a DocumentPaginator asynchronously via GetPageAsync with XpsDocumentWriter?
The idea here is that I have a DocumentPaginator that I want to use with an XpsDocumentWriter or PrintDialog as both have the option of printing given a paginator. When I use either, i.e. XpsDocumentWriter.Write[Async] or PrintDialog.PrintDocument,…

Faury
- 111
- 3
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
0 answers
Add header and footer to XPS print output
XpsDocument is loaded from disk
Create a FixedDocumentSequence via XpsDocument.GetFixedDocumentSequence Method ()
Display the via a DocumentViewer
Would like to add to add header and footer to print
I don't need to add the header and footer back…

paparazzo
- 44,497
- 23
- 105
- 176
10
votes
1 answer
Value of a string for file's location is nil but a stored value says it isn't
I'm trying to convert secured PDFs to XPS and back to PDF using FreeSpire and then combine them using iTextSharp. Below is my code snippet for converting various files.
char[] delimiter = { '\\' };
string WorkDir =…

LampPost
- 856
- 11
- 30
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
How do I get WPF's DocumentViewer to release its file lock on the source XPS Document?
After showing an XPS file in the WPF DocumentViewer, and closing the DocumentViewer instance, the XPS file is locked and I cannot delete it. I need to release the lock on the XPS file so I can delete it, write another one with the same name, and…

Tim Erickson
- 2,323
- 2
- 22
- 27
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
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
2 answers
How do you hide a WPF DocumentViewer's menu bars?
At the moment I have a DocumentViewer in a WPF window that displays an XPS file. I have created my own "Next Page" and "Previous Page" buttons and have set the DocumentViewer.Background property to be completely transparent.
All that is left of the…

Siyfion
- 416
- 1
- 6
- 17
6
votes
1 answer
GetPrintJobInfoCollection() Exception sometimes
This code that might seem useless it reproduces the problem. Another application is using
http://printqueuewatch.codeplex.com/ to be notified when a print job is sent to printer.
It works but sometimes when you send a print job it crashes here…

GorillaApe
- 3,611
- 10
- 63
- 106
5
votes
1 answer
Any suggestions for dealing with XpsDocument GetFixedDocumentSequence performance issues?
I'm trying to provide a live preview of XPS documents without hanging my UI thread. Opening the document is fast enough, but when I call GetFixedDocumentSequence(), my UI becomes unresponsive for several seconds while the document chugs away.
//…

tacovan
- 81
- 9
5
votes
3 answers
XPS with Windows Forms
What is the best way to display and print XPS files in a Windows Forms application?

Michael Damatov
- 15,253
- 10
- 46
- 71
5
votes
2 answers
How can I stream an XPS document to a browser and embed it in a webpage?
I'm looking for some suggestions on how to go about this. Any input is appreciated!
Currently, I have an ASP.NET MVC application. On the client, I have a link with an ID of an XPS document. When the user clicks the link, they are taken to a page…
user1228