AnnotationDocumentPaginator Třída

Definice

Poskytuje možnost DocumentPaginator pro 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ý do konstruktoru AnnotationDocumentPaginator a přidá poznámky uživatele na stránky pro tisk.

Konstruktory

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

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

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

Inicializuje novou instanci AnnotationDocumentPaginator třídy na základě zadaného DocumentPaginatortextu FlowDirection, AnnotationStorea .

AnnotationDocumentPaginator(DocumentPaginator, Stream)

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

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

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

Vlastnosti

IsPageCountValid

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

PageCount

Získá hodnotu, která označuje počet stránek aktuálně formátovaných.

PageSize

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

Source

Získá zdrojový dokument, který je stránkován.

Metody

CancelAsync(Object)

Zruší všechny asynchronní operace zahájené s daným userState objektem.

ComputePageCount()

Vynutí stránkování obsahu, aktualizuje PageCount se s 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čí, zda se zadaný objekt rovná aktuálnímu objektu.

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

Slouží jako výchozí hashovací funkce.

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

DocumentPage Vrátí 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) hodnotu DocumentPage pro zadané číslo stránky.

(Zděděno od DocumentPaginator)
GetPageAsync(Int32, Object)

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

GetType()

Získá aktuální Type instanci.

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

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

(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

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