AnnotationDocumentPaginator Třída

Definice

DocumentPaginator Umožňuje tisk dokumentu společně s přidruženými poznámkami.

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
Dědičnost
AnnotationDocumentPaginator

Příklady

Následující příklad ukazuje použití AnnotationDocumentPaginator třídy.

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

Poznámky

Třída AnnotationDocumentPaginator zabalí DocumentPaginator zadaný AnnotationDocumentPaginator konstruktor, aby přidala poznámky uživatele na stránky pro tisk.

Konstruktory

Name Description
AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

Inicializuje novou instanci AnnotationDocumentPaginator třídy na základě zadaného DocumentPaginatorAnnotationStore, a text FlowDirection.

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

Inicializuje novou instanci AnnotationDocumentPaginator třídy na základě zadaného DocumentPaginator a AnnotationStore.

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

Inicializuje novou instanci AnnotationDocumentPaginator třídy na základě zadaného DocumentPaginatorúložiště poznámek Streama textu FlowDirection.

AnnotationDocumentPaginator(DocumentPaginator, Stream)

Inicializuje novou instanci AnnotationDocumentPaginator třídy na základě zadaného DocumentPaginator úložiště Streama poznámek .

Vlastnosti

Name Description
IsPageCountValid

Získá hodnotu, která určuje, zda PageCount je celkový počet stránek.

PageCount

Získá hodnotu, která označuje počet stránek, které jsou aktuálně formátovány.

PageSize

Získá nebo nastaví navrženou šířku a výšku každé stránky.

Source

Získá zdrojový dokument, který se stránkuje.

Metody

Name Description
CancelAsync(Object)

Zruší všechny asynchronní operace iniciované daným userState objektem.

ComputePageCount()

Vynutí stránkování obsahu, aktualizuje PageCount se novým součtem a nastaví IsPageCountValid na true.

ComputePageCountAsync()

Asynchronně vynutí stránkování obsahu, aktualizuje PageCount se s novým součtem a nastaví IsPageCountValid na true.

(Zděděno od DocumentPaginator)
ComputePageCountAsync(Object)

Spustí asynchronní stránkování obsahu, aktualizuje PageCount se s novým součtem a nastaví IsPageCountValid se na true po dokončení.

Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetPage(Int32)

DocumentPage Vrátí společně s přidruženými poznámkami uživatele pro zadané číslo stránky.

GetPageAsync(Int32, Object)

Asynchronně vrátí DocumentPage společně s přidruženými uživatelskými poznámkami pro zadané číslo stránky.

GetPageAsync(Int32)

Asynchronně vrátí (prostřednictvím GetPageCompleted události) DocumentPage zadané číslo stránky.

(Zděděno od DocumentPaginator)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
OnComputePageCountCompleted(AsyncCompletedEventArgs)

ComputePageCountCompleted Vyvolá událost.

(Zděděno od DocumentPaginator)
OnGetPageCompleted(GetPageCompletedEventArgs)

GetPageCompleted Vyvolá událost.

(Zděděno od DocumentPaginator)
OnPagesChanged(PagesChangedEventArgs)

PagesChanged Vyvolá událost.

(Zděděno od DocumentPaginator)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Událost

Name Description
ComputePageCountCompleted

Nastane po ComputePageCountAsync dokončení operace.

(Zděděno od DocumentPaginator)
GetPageCompleted

Nastane po GetPageAsync dokončení.

(Zděděno od DocumentPaginator)
PagesChanged

Nastane při změně obsahu dokumentu.

(Zděděno od DocumentPaginator)

Platí pro