PrintManager 클래스

정의

애플리케이션 내에서 인쇄할 진입점을 제공합니다.

public ref class PrintManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PrintManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PrintManager
Public NotInheritable Class PrintManager
상속
Object Platform::Object IInspectable PrintManager
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

설명

PrintManager 클래스는 UWP 앱의 인쇄 흐름을 오케스트레이션합니다. 이 클래스를 사용하려면 먼저 GetForCurrentView 메서드를 호출해야 합니다. 이 메서드는 현재 활성 창과 관련된 PrintManager 개체를 반환합니다. 다음으로 PrintTaskRequested 이벤트에 대한 이벤트 수신기를 추가해야 합니다. 이 이벤트는 애플리케이션이 ShowPrintUIAsync 메서드를 통해 인쇄 대화 상자를 호출할 때 발생합니다.

UWP 앱이 인쇄할 "의도"를 등록하면 인쇄 관리자와 인쇄 계약이 만들어집니다. UWP 인쇄 샘플에서는 RegisterForPrinting 메서드를 통해 등록이 수행됩니다.

public virtual void RegisterForPrinting()
{
   printDocument = new PrintDocument();
   printDocumentSource = printDocument.DocumentSource;
   printDocument.Paginate += CreatePrintPreviewPages;
   printDocument.GetPreviewPage += GetPrintPreviewPage;
   printDocument.AddPages += AddPrintPages;

   PrintManager printMan = PrintManager.GetForCurrentView();
   printMan.PrintTaskRequested += PrintTaskRequested;
}

인쇄 관리자와 관련된 더 많은 예제 및 UWP 앱의 인쇄 시나리오에 대한 몇 가지 샘플 코드를 보려면 인쇄UWP 인쇄 샘플을 참조하세요.

버전 기록

Windows 버전 SDK 버전 추가된 값
1607 14393 Issupported

메서드

GetForCurrentView()

현재 창과 연결된 PrintManager 개체를 검색합니다.

IsSupported()

앱이 인쇄를 지원하는 디바이스에서 실행 중인지 여부를 나타냅니다.

ShowPrintUIAsync()

콘텐츠를 인쇄하기 위해 프로그래밍 방식으로 사용자 인터페이스를 시작합니다.

이벤트

PrintTaskRequested

인쇄 요청이 발생했을 때 발생합니다. 이 이벤트는 사용자 작업 또는 ShowPrintUIAsync 메서드를 통해 프로그래밍 방식으로 인쇄 호출을 통해 트리거될 수 있습니다.

적용 대상

추가 정보