This documentation is archived and is not being maintained.
AnnotationDocumentPaginator Class
Visual Studio 2008
Provides a DocumentPaginator for printing a document together with its associated annotations.
Assembly: PresentationFramework (in PresentationFramework.dll)
The AnnotationDocumentPaginator class wraps the DocumentPaginator specified to the AnnotationDocumentPaginator constructor to add the user annotations to the pages for printing.
The following example shows use of the AnnotationDocumentPaginator class. For the full sample, see theDocumentViewer with Annotations XPS-Store Sample.
PrintDialog prntDialog = new PrintDialog(); if ((bool)prntDialog.ShowDialog()) { // XpsDocumentWriter.Write() may change the current // directory to "My Documents" or another user selected // directory for storing the print document. Save the // current directory and restore it after calling Write(). string docDir = Directory.GetCurrentDirectory(); // Create and XpsDocumentWriter for the selected printer. XpsDocumentWriter xdw = PrintQueue.CreateXpsDocumentWriter( prntDialog.PrintQueue); // Print the document with annotations. try { xdw.Write(_annotHelper.GetAnnotationDocumentPaginator( _xpsDocument.GetFixedDocumentSequence())); } catch (PrintingCanceledException) { // If in the PrintDialog the user chooses a file-based // output, such as the "MS Office Document Image Writer", // the user confirms or specifies the actual output // filename when the xdw.write operation executes. // If the user clicks "Cancel" in the filename // dialog a PrintingCanceledException is thrown // which we catch here and ignore. // MessageBox.Show("Print output cancelled"); } // Restore the original document directory to "current". Directory.SetCurrentDirectory(docDir); }
// ------------------ GetAnnotationDocumentPaginator ------------------ /// <summary> /// Returns a paginator for printing annotations.</summary> /// <param name="fds"> /// The FixedDocumentSequence containing /// the annotations to print.</param> /// <returns> /// An paginator for printing the document's annotations.</returns> public AnnotationDocumentPaginator GetAnnotationDocumentPaginator( FixedDocumentSequence fds) { return new AnnotationDocumentPaginator( fds.DocumentPaginator, _annotService.Store); }
System.Object
System.Windows.Documents.DocumentPaginator
System.Windows.Annotations.AnnotationDocumentPaginator
System.Windows.Documents.DocumentPaginator
System.Windows.Annotations.AnnotationDocumentPaginator
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: