AnnotationDocumentPaginator 클래스

정의

문서를 연결된 주석과 함께 인쇄할 수 있도록 DocumentPaginator를 제공합니다.

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
상속
AnnotationDocumentPaginator

예제

다음 예제에서는 사용 된 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

설명

AnnotationDocumentPaginator 클래스를 래핑하고 합니다 DocumentPaginator 에 지정 된는 AnnotationDocumentPaginator 인쇄할 페이지에 사용자 주석을 추가 하는 생성자입니다.

생성자

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

지정된 AnnotationDocumentPaginatorDocumentPaginator를 기반으로 AnnotationStore 클래스의 새 인스턴스를 초기화합니다.

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

지정된 AnnotationDocumentPaginator, DocumentPaginator 및 텍스트 AnnotationStore을 기반으로 FlowDirection 클래스의 새 인스턴스를 초기화합니다.

AnnotationDocumentPaginator(DocumentPaginator, Stream)

지정된 DocumentPaginator 및 주석 스토리지 Stream을 기반으로 AnnotationDocumentPaginator 클래스의 새 인스턴스를 초기화합니다.

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

지정된 DocumentPaginator, 주석 스토리지 Stream 및 텍스트 FlowDirection를 기반으로 AnnotationDocumentPaginator 클래스의 새 인스턴스를 초기화합니다.

속성

IsPageCountValid

PageCount가 총 페이지 수인지 여부를 나타내는 값을 가져옵니다.

PageCount

현재 형식이 지정된 페이지 수를 나타내는 값을 가져옵니다.

PageSize

각 페이지의 제안 너비 및 높이를 가져오거나 설정합니다.

Source

페이지를 매기고 있는 소스 문서를 가져옵니다.

메서드

CancelAsync(Object)

지정된 userState 개체를 사용하여 시작된 모든 비동기 작업을 취소합니다.

ComputePageCount()

콘텐츠의 페이지를 매기고, PageCount를 새로운 총 페이지 수로 업데이트하고, IsPageCountValidtrue로 설정합니다.

ComputePageCountAsync()

비동기적으로 콘텐츠의 페이지를 매기고, PageCount를 새로운 총 페이지 수로 업데이트하고, IsPageCountValidtrue로 설정합니다.

(다음에서 상속됨 DocumentPaginator)
ComputePageCountAsync(Object)

콘텐츠의 비동기 페이지 지정을 시작하고, PageCount를 새 합계로 업데이트하고, 완료되면 IsPageCountValidtrue로 설정합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetPage(Int32)

지정된 페이지 번호에 대해 DocumentPage를 연결된 사용자 주석과 함께 반환합니다.

GetPageAsync(Int32)

지정된 페이지 번호에 대한 GetPageCompletedDocumentPage 이벤트를 통해 비동기적으로 반환합니다.

(다음에서 상속됨 DocumentPaginator)
GetPageAsync(Int32, Object)

지정된 페이지 번호의 연결된 사용자 주석과 함께 DocumentPage를 비동기적으로 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnComputePageCountCompleted(AsyncCompletedEventArgs)

ComputePageCountCompleted 이벤트를 발생시킵니다.

(다음에서 상속됨 DocumentPaginator)
OnGetPageCompleted(GetPageCompletedEventArgs)

GetPageCompleted 이벤트를 발생시킵니다.

(다음에서 상속됨 DocumentPaginator)
OnPagesChanged(PagesChangedEventArgs)

PagesChanged 이벤트를 발생시킵니다.

(다음에서 상속됨 DocumentPaginator)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

이벤트

ComputePageCountCompleted

ComputePageCountAsync 작업이 완료되면 발생합니다.

(다음에서 상속됨 DocumentPaginator)
GetPageCompleted

GetPageAsync가 완료될 때 발생합니다.

(다음에서 상속됨 DocumentPaginator)
PagesChanged

문서 콘텐츠가 변경되면 발생합니다.

(다음에서 상속됨 DocumentPaginator)

적용 대상