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 지정한 DocumentPaginatorAnnotationDocumentPaginator 항목을 생성자에 래핑하여 인쇄할 페이지에 사용자 주석을 추가합니다.

생성자

Name Description
AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

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

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

지정된 AnnotationDocumentPaginator 클래스 및 에 따라 클래스의 DocumentPaginator 새 인스턴스를 초기화합니다AnnotationStore.

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

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

AnnotationDocumentPaginator(DocumentPaginator, Stream)

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

속성

Name Description
IsPageCountValid

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

PageCount

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

PageSize

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

Source

페이지를 매길 원본 문서를 가져옵니다.

메서드

Name Description
CancelAsync(Object)

지정된 userState 개체로 시작된 모든 비동기 작업을 취소합니다.

ComputePageCount()

콘텐츠의 페이지 매김을 강제로 적용하고, 새 합계로 업데이트 PageCount 하고, 로 IsPageCountValid설정합니다true.

ComputePageCountAsync()

비동기적으로 콘텐츠의 페이지 매김을 강제로 적용하고, 새 합계로 업데이트 PageCount 하고, 로 IsPageCountValid설정합니다true.

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

콘텐츠의 비동기 페이지 매김을 시작하고, 새 합계로 업데이트 PageCount 하고, 완료 시점으로 IsPageCountValid 설정합니다true.

Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

GetPageAsync(Int32, Object)

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

GetPageAsync(Int32)

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

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

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

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

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

이벤트

Name Description
ComputePageCountCompleted

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

(다음에서 상속됨 DocumentPaginator)
GetPageCompleted

완료되면 발생합니다 GetPageAsync .

(다음에서 상속됨 DocumentPaginator)
PagesChanged

문서 내용이 변경될 때 발생합니다.

(다음에서 상속됨 DocumentPaginator)

적용 대상