Cover by Morgan Skinner, Karli Watson, Jay Glynn, Bill Evjen, Christian Nagel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 37

Creating Documents with WPF

WHAT’S IN THIS CHAPTER?

  • Creating flow documents
  • Creating fixed documents
  • Creating XPS documents
  • Printing documents

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at http://www.wrox.com/remtitle.cgi?isbn=1118314425 on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Show Fonts
  • Text Effects
  • Table
  • Flow Documents
  • Create XPS
  • Printing

INTRODUCTION

Creating documents is a large part of WPF. The namespace System.Windows.Documents supports creating both flow documents and fixed documents. This namespace contains elements with which you can have a rich Word-like experience with flow documents, and create WYSIWYG fixed documents.

Flow documents are geared toward screen reading; the content of the document is arranged based on the size of the window and the flow of the document changes if the window is resized. Fixed documents are mainly used for printing and page-oriented content and the content is always arranged in the same way.

This chapter teaches you how to create and print flow documents and fixed documents, and covers the namespaces System.Windows.Documents, System.Windows.Xps, and System.IO.Packaging.

TEXT ELEMENTS

To build the content of documents, you need document elements. The base class of these elements is TextElement. This class defines common properties for font settings, foreground and background, and text effects. TextElement is the base ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required