AnnotationDocumentPaginator Klasse

Definition

Stellt ein DocumentPaginator Dokument zusammen mit den zugehörigen Anmerkungen zum Drucken bereit.

public ref class AnnotationDocumentPaginator sealed : System::Windows::Documents::DocumentPaginator
public sealed class AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator
type AnnotationDocumentPaginator = class
    inherit DocumentPaginator
Public NotInheritable Class AnnotationDocumentPaginator
Inherits DocumentPaginator
Vererbung
AnnotationDocumentPaginator

Beispiele

Das folgende Beispiel zeigt die Verwendung der AnnotationDocumentPaginator Klasse.

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);
}
Dim prntDialog As New PrintDialog()
If CBool(prntDialog.ShowDialog()) Then
    ' 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().
    Dim docDir As String = Directory.GetCurrentDirectory()

    ' Create and XpsDocumentWriter for the selected printer.
    Dim xdw As XpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(prntDialog.PrintQueue)

    ' Print the document with annotations.
    Try
        xdw.Write(_annotHelper.GetAnnotationDocumentPaginator(_xpsDocument.GetFixedDocumentSequence()))
    Catch e1 As 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.
    End Try

    ' Restore the original document directory to "current".
    Directory.SetCurrentDirectory(docDir)
End If
// ------------------ 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);
}
' ------------------ 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 Function GetAnnotationDocumentPaginator(ByVal fds As FixedDocumentSequence) As AnnotationDocumentPaginator
    Return New AnnotationDocumentPaginator(fds.DocumentPaginator, _annotService.Store)
End Function

Hinweise

Die AnnotationDocumentPaginator Klasse umschließt den DocumentPaginatorAnnotationDocumentPaginator angegebenen Konstruktor, um die Benutzeranmerkungen zu den Seiten zum Drucken hinzuzufügen.

Konstruktoren

Name Beschreibung
AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

Initialisiert eine neue Instanz der AnnotationDocumentPaginator Klasse basierend auf einem angegebenen DocumentPaginator, AnnotationStoreund Text FlowDirection.

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

Initialisiert eine neue Instanz der AnnotationDocumentPaginator Klasse basierend auf einem angegebenen DocumentPaginator und AnnotationStore.

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

Initialisiert eine neue Instanz der AnnotationDocumentPaginator Klasse basierend auf einem angegebenen DocumentPaginatorAnmerkungsspeicher Streamund Text FlowDirection.

AnnotationDocumentPaginator(DocumentPaginator, Stream)

Initialisiert eine neue Instanz der AnnotationDocumentPaginator Klasse basierend auf einem angegebenen DocumentPaginator und Anmerkungsspeicher Stream.

Eigenschaften

Name Beschreibung
IsPageCountValid

Ruft einen Wert ab, der angibt, ob PageCount es sich um die Gesamtanzahl der Seiten handelt.

PageCount

Ruft einen Wert ab, der die Anzahl der aktuell formatierten Seiten angibt.

PageSize

Ruft die vorgeschlagene Breite und Höhe jeder Seite ab oder legt sie fest.

Source

Ruft das Quelldokument ab, das aus paginiert wird.

Methoden

Name Beschreibung
CancelAsync(Object)

Bricht alle asynchronen Vorgänge ab, die mit einem bestimmten userState Objekt initiiert wurden.

ComputePageCount()

Erzwingt eine Paginierung des Inhalts, aktualisiert PageCount sich mit der neuen Summe und legt sie IsPageCountValid auf truefest.

ComputePageCountAsync()

Erzwingt asynchron eine Paginierung des Inhalts, aktualisiert PageCount mit der neuen Summe und legt diese IsPageCountValid fest auf true.

(Geerbt von DocumentPaginator)
ComputePageCountAsync(Object)

Startet eine asynchrone Paginierung des Inhalts, aktualisiert PageCount sich mit der neuen Summe und legt IsPageCountValid fest, true wann sie abgeschlossen ist.

Equals(Object)

Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht.

(Geerbt von Object)
GetHashCode()

Dient als Standardhashfunktion.

(Geerbt von Object)
GetPage(Int32)

Gibt eine DocumentPage Zusammen mit zugehörigen Benutzeranmerkungen für eine angegebene Seitenzahl zurück.

GetPageAsync(Int32, Object)

Gibt asynchron eine DocumentPage Zusammen mit zugehörigen Benutzeranmerkungen für eine angegebene Seitenzahl zurück.

GetPageAsync(Int32)

Gibt asynchron (durch das GetPageCompleted Ereignis) die DocumentPage für die angegebene Seitenzahl zurück.

(Geerbt von DocumentPaginator)
GetType()

Ruft die Type der aktuellen Instanz ab.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie der aktuellen Object.

(Geerbt von Object)
OnComputePageCountCompleted(AsyncCompletedEventArgs)

Löst das ComputePageCountCompleted-Ereignis aus.

(Geerbt von DocumentPaginator)
OnGetPageCompleted(GetPageCompletedEventArgs)

Löst das GetPageCompleted-Ereignis aus.

(Geerbt von DocumentPaginator)
OnPagesChanged(PagesChangedEventArgs)

Löst das PagesChanged-Ereignis aus.

(Geerbt von DocumentPaginator)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Ereignisse

Name Beschreibung
ComputePageCountCompleted

Tritt auf, wenn ein ComputePageCountAsync Vorgang abgeschlossen ist.

(Geerbt von DocumentPaginator)
GetPageCompleted

Tritt auf, wenn GetPageAsync der Vorgang abgeschlossen ist.

(Geerbt von DocumentPaginator)
PagesChanged

Tritt auf, wenn der Dokumentinhalt geändert wird.

(Geerbt von DocumentPaginator)

Gilt für: