Intersoft.Client.Documents Namespace > FlowDocument Class : CustomPaginator Property |
Public Property CustomPaginator As DocumentPaginator
Dim instance As FlowDocument Dim value As DocumentPaginator instance.CustomPaginator = value value = instance.CustomPaginator
public DocumentPaginator CustomPaginator {get; set;}
public: property DocumentPaginator^ CustomPaginator { DocumentPaginator^ get(); void set ( DocumentPaginator^ value); }
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 |
Copy Code
|
---|---|
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 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2