IDocumentPaginatorSource 인터페이스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
실제 콘텐츠 페이지 매기기를 수행하는 소스 개체를 정의합니다.
public interface class IDocumentPaginatorSource
public interface IDocumentPaginatorSource
type IDocumentPaginatorSource = interface
Public Interface IDocumentPaginatorSource
- 파생
예제
다음 예제에서는 사용 된 IDocumentPaginatorSource 인터페이스입니다.
// ------------------------- LoadDocumentViewer -----------------------
/// <summary>
/// Loads content from a file to a DocumentViewer control.</summary>
/// <param name="xpsFilename">
/// The path and name of the XPS file to
/// load to the DocumentViewer control.</param>
/// <remarks>
/// Exception handling should be added if the xpsFilename may not be
/// valid or if the FixedDocumentSequence contained in the file is
/// incorrect. (In this sample the files are hardcoded.)</remarks>
private void LoadDocumentViewer(string xpsFilename)
{
// Save a reference to the currently open XPS package.
XpsDocument oldXpsPackage = _xpsPackage;
// Open the package for the new XPS document.
_xpsPackage = new XpsDocument(xpsFilename,
FileAccess.Read, CompressionOption.NotCompressed);
// Get the FixedDocumentSequence from the package.
FixedDocumentSequence fixedDocumentSequence =
_xpsPackage.GetFixedDocumentSequence();
// Set the new FixedDocumentSequence as
// the DocumentViewer's paginator source.
docViewer.Document =
fixedDocumentSequence as IDocumentPaginatorSource;
// If there was an old XPS package, close it now that
// DocumentViewer no longer needs to access it.
if (oldXpsPackage != null)
oldXpsPackage.Close();
// Leave the new _xpsPackage open for DocumentViewer
// to access additional required resources.
}// end:LoadDocumentViewer()
' ------------------------- LoadDocumentViewer -----------------------
''' <summary>
''' Loads content from a file to a DocumentViewer control.</summary>
''' <param name="xpsFilename">
''' The path and name of the XPS file to
''' load to the DocumentViewer control.</param>
''' <remarks>
''' Exception handling should be added if the xpsFilename may not be
''' valid or if the FixedDocumentSequence contained in the file is
''' incorrect. (In this sample the files are hardcoded.)</remarks>
Private Sub LoadDocumentViewer(ByVal xpsFilename As String)
' Save a reference to the currently open XPS package.
Dim oldXpsPackage As XpsDocument = _xpsPackage
' Open the package for the new XPS document.
_xpsPackage = New XpsDocument(xpsFilename, FileAccess.Read, CompressionOption.NotCompressed)
' Get the FixedDocumentSequence from the package.
Dim fixedDocumentSequence As FixedDocumentSequence = _xpsPackage.GetFixedDocumentSequence()
' Set the new FixedDocumentSequence as
' the DocumentViewer's paginator source.
docViewer.Document = TryCast(fixedDocumentSequence, IDocumentPaginatorSource)
' If there was an old XPS package, close it now that
' DocumentViewer no longer needs to access it.
If oldXpsPackage IsNot Nothing Then
oldXpsPackage.Close()
End If
' Leave the new _xpsPackage open for DocumentViewer
' to access additional required resources.
End Sub
속성
DocumentPaginator |
파생 클래스에서 재정의되는 경우 콘텐츠 페이지 매기기를 수행하는 개체를 가져옵니다. |