AnnotationDocumentPaginator Sınıf

Tanım

Belgeyi ilişkili ek açıklamalarıyla birlikte yazdırmak için bir DocumentPaginator sağlar.

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
Devralma
AnnotationDocumentPaginator

Örnekler

Aşağıdaki örnekte sınıfının kullanımı gösterilmektedir AnnotationDocumentPaginator .

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

Açıklamalar

sınıfı, AnnotationDocumentPaginator yazdırma için sayfalara DocumentPaginator kullanıcı ek açıklamalarını eklemek için belirtilen öğesini oluşturucuya sarmalarAnnotationDocumentPaginator.

Oluşturucular

Name Description
AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

Belirtilen AnnotationDocumentPaginator, DocumentPaginatorve metnini AnnotationStoretemel alarak sınıfının yeni bir örneğini FlowDirection başlatır.

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

Belirtilen AnnotationDocumentPaginator ve DocumentPaginatortemelinde sınıfının yeni bir örneğini AnnotationStore başlatır.

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

Belirtilen AnnotationDocumentPaginator, ek açıklama depolama DocumentPaginatoralanı Stream ve metnine FlowDirectiongöre sınıfının yeni bir örneğini başlatır.

AnnotationDocumentPaginator(DocumentPaginator, Stream)

Belirtilen AnnotationDocumentPaginator ve ek açıklama depolama DocumentPaginatoralanına Stream göre sınıfının yeni bir örneğini başlatır.

Özellikler

Name Description
IsPageCountValid

Toplam sayfa sayısının olup olmadığını PageCount gösteren bir değer alır.

PageCount

Şu anda biçimlendirilmiş sayfa sayısını gösteren bir değer alır.

PageSize

Her sayfanın önerilen genişliğini ve yüksekliğini alır veya ayarlar.

Source

Sayfalandırılmış kaynak belgeyi alır.

Yöntemler

Name Description
CancelAsync(Object)

Belirli userState bir nesneyle başlatılan tüm zaman uyumsuz işlemleri iptal eder.

ComputePageCount()

İçeriğin sayfalandırmasını zorlar, yeni toplamla güncelleştirir PageCount ve olarak IsPageCountValidayarlartrue.

ComputePageCountAsync()

Zaman uyumsuz olarak, içeriğin sayfalandırmasını zorlar, yeni toplamla güncelleştirir PageCount ve olarak IsPageCountValidayarlartrue.

(Devralındığı yer: DocumentPaginator)
ComputePageCountAsync(Object)

İçeriğin zaman uyumsuz bir sayfalandırmasını başlatır, yeni toplamla güncelleştirir PageCount ve tamamlandığında olarak ayarlanır IsPageCountValidtrue .

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetPage(Int32)

Belirtilen sayfa DocumentPage numarası için ilişkili kullanıcı ek açıklamalarıyla birlikte bir döndürür.

GetPageAsync(Int32, Object)

Belirtilen sayfa numarası için zaman uyumsuz olarak ilişkili kullanıcı ek açıklamalarıyla birlikte bir döndürür DocumentPage .

GetPageAsync(Int32)

Belirtilen sayfa numarası için zaman uyumsuz olarak öğesini döndürür (olay GetPageCompleted aracılığıylaDocumentPage).

(Devralındığı yer: DocumentPaginator)
GetType()

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
OnComputePageCountCompleted(AsyncCompletedEventArgs)

Olayı tetikler ComputePageCountCompleted .

(Devralındığı yer: DocumentPaginator)
OnGetPageCompleted(GetPageCompletedEventArgs)

Olayı tetikler GetPageCompleted .

(Devralındığı yer: DocumentPaginator)
OnPagesChanged(PagesChangedEventArgs)

Olayı tetikler PagesChanged .

(Devralındığı yer: DocumentPaginator)
ToString()

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Ekinlikler

Name Description
ComputePageCountCompleted

İşlem ComputePageCountAsync tamamlandığında gerçekleşir.

(Devralındığı yer: DocumentPaginator)
GetPageCompleted

GetPageAsync Tamamlandığında gerçekleşir.

(Devralındığı yer: DocumentPaginator)
PagesChanged

Belge içeriği değiştirildiğinde gerçekleşir.

(Devralındığı yer: DocumentPaginator)

Şunlara uygulanır