Chapter 21. Documents
WPF documents can contain a wide variety of objects such as:
Paragraphs
Tables
Lists
Floaters
Figures
User interface elements such as
Buttons
andTextBoxes
Three-dimensional objects
WPF has two different kinds of documents: fixed documents and flow documents. This chapter describes these two kinds of documents. It explains the objects that each kind of document can hold and how they must be arranged to produce a valid result.
Fixed Documents
A fixed document displays its contents in exactly the same size and position whenever you view it. If you resize the control that holds the document, parts of the document may not fit, but they won't be moved. In that sense, this kind of document is similar to a PDF (Portable Document Format) file.
The following sections explain how you can build fixed documents and display them in your WPF applications.
Building XPS Documents
When it defined fixed documents, Microsoft also defined XML Paper Specification (XPS) files. An XPS file is a fixed document saved in a special format that can be read and displayed by certain programs such as recent versions of Internet Explorer.
One of the most flexible ways you can make an XPS document is to use Microsoft Word. Simply create a Word document containing any text, graphics, lists, or other content that you want, and then export it as an XPS document.
Microsoft Word 2007 can export files in XPS (or PDF) format, but you need to install an add-in first. As of this writing, you can install the add-in ...
Get WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.