
Understanding the Role of the WPF Document API
WPF ships with many basic controls to display, and possibly edit, simple text.
• TextBlock and Label: Controls to display read-only text.
• TextBox and RichTextBox: Controls to display editable text.
Although these types are appropriate for small snippets of text, they can fall short when you need to display
large volumes of richly formatted text.
• For example, what if you need to have a large manuscript displayed over a series of columns?
• What if the document needed support for embedded images and graphics?
• What about reader annotations? Automatic resizing? Zoom capabilities?
• What about a WYSIWYG (a.k.a. print-ready) document similar to a PDF file?
To address such needs, WPF includes numerous document-centric controls that allow you to create a
dynamic layout system for rich documents. System.Windows.Documents is the key namespace for the
document types. System.Windows.Documents.Serialization is a related namespace that provides services
to save an edited document. Both namespaces reside in PresentationFramework.dll.
The WPF document API defines two broad categories of documents:
• Fixed documents: This, in a nutshell, is the equivalent of an Adobe PDF document. However, the
implementation is based on Microsoft’s XPS specification (XML Paper Specification). Data in a fixed
document is print ready, and positioning of content is fixed. This is the best choice for building applications
that make heavy use of printing APIs.
• Flow documents: Content can be laid out dynamically. This flavor of document is intended for
viewing on a computer. This is the best choice for building applications that need to display rich content at
runtime.
WPF Document API
Table of Contents
Copyright (c) 2008. Intertech, Inc. All Rights Reserved. This information is to be used exclusively as an
online learning aid. Any attempts to copy, reproduce, or use for training is strictly prohibited.
Courseware
Training Resources
Tutorials
Services