Visual Basic (Declaration) | |
---|---|
Public ReadOnly Property DocumentPaginator As DocumentPaginator |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As FlowDocument Dim value As DocumentPaginator value = instance.DocumentPaginator |
C# | |
---|---|
public DocumentPaginator DocumentPaginator {get;} |
Delphi | |
---|---|
public read-only property DocumentPaginator: DocumentPaginator; |
JScript | |
---|---|
public function get DocumentPaginator : DocumentPaginator |
Managed Extensions for C++ | |
---|---|
public: __property DocumentPaginator* get_DocumentPaginator(); |
C++/CLI | |
---|---|
public: property DocumentPaginator^ DocumentPaginator { DocumentPaginator^ get(); } |
FlowDocument should be contained within UXFlowDocumentViewer, UXFlowDocumentPageViewer, or UXFlowDocumentScrollViewer. All viewers have built-in printing capability which allows users to easily print the flow document. If you don't want to use the built-in capability, you can print a document programmatically.
CS | ![]() |
---|---|
private void Print() { PrintDocument pd = new PrintDocument(); pd.Print(viewer1.Document.DocumentPaginator, "Employee Document"); } |
PrintDocument class will use the Print method to print the document. Print method needs two parameters, DocumentPaginator object and the document name. DocumentPaginator is an abstract base class that supports creation of multiple-page elements from a single document. By default, each FlowDocument has DocumentPaginator property that contain DocumentPaginator object for the flow document.
When FlowDocument is in page mode, the document content will flow according to the specified page configuration. If FlowDocument is in scroll mode, the document content will flow according to the available view port. In Silverlight application, you can choose a page size in the Print dialog window. In this case, the DocumentPaginator will create multiple page elements, despite of whether the FlowDocument is in page mode or scroll mode, for printing purpose with the selected page size. Unlike Silverlight application, the selected page size in the Print dialog window is not used in WPF application. If you need to specify different page size for printing purpose, it is recommended that you use custom paginator.
You can specify a custom paginator class to add custom elements for printing purpose only, such as header or footer. To learn more about how to implement custom paginator class for printing purpose, see How-to: Use Custom Paginator to Print FlowDocument.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family