IXpsFixedPageReader インターフェイス

定義

FixedPageの部分を読み取るためのメソッドを定義します。

public interface class IXpsFixedPageReader : System::Windows::Xps::Packaging::IStoryFragmentProvider
public interface IXpsFixedPageReader : System.Windows.Xps.Packaging.IStoryFragmentProvider
type IXpsFixedPageReader = interface
    interface IStoryFragmentProvider
Public Interface IXpsFixedPageReader
Implements IStoryFragmentProvider
実装

次の例は、IXpsFixedPageReaderからIXpsFixedDocumentReader コレクションを取得する方法を示しています。 このサンプルでは、固定ページ リーダーを使用して、ページのドキュメント構造を定義する新しい StoryFragment を追加する方法も示します。

ShowStatus("   Getting FixedDocumentSequenceReader.");
IXpsFixedDocumentSequenceReader fixedDocSeqReader =
    xpsDocument.FixedDocumentSequenceReader;

ShowStatus("   Getting FixedDocumentReaders.");
ICollection<IXpsFixedDocumentReader> fixedDocuments =
    fixedDocSeqReader.FixedDocuments;

ShowStatus("   Getting FixedPageReaders.");
IEnumerator<IXpsFixedDocumentReader> enumerator =
    fixedDocuments.GetEnumerator();
enumerator.MoveNext();
ICollection<IXpsFixedPageReader> fixedPages =
    enumerator.Current.FixedPages;

// Add a document structure to each fixed page.
int i = 0;
foreach (IXpsFixedPageReader fixedPageReader in fixedPages)
{
    XpsResource pageStructure;
    ShowStatus("   Adding page structure resource:\n       '" +
                       Filename(_fixedPageStructures[i]) + "'");
    try
    {   // Add a new StoryFragment to hold the page structure.
        pageStructure = fixedPageReader.AddStoryFragment();
    }
    catch (System.InvalidOperationException)
    {
        MessageBox.Show(xpsUnstructuredFile +
            "\n\nDocument structure cannot be added.\n\n" +
            Filename(xpsUnstructuredFile) + " might already " +
            "contain an existing document structure.",
            "Cannot Add Document Structure",
            MessageBoxButton.OK, MessageBoxImage.Error);
        break;
    }

    // Copy the page structure to the new StoryFragment.
    WriteResource(pageStructure, _fixedPageStructures[i++]);
}

ShowStatus("   Saving and closing the new document.\n");
xpsDocument.Close();
ShowStatus("   Getting FixedDocumentSequenceReader.")
Dim fixedDocSeqReader As IXpsFixedDocumentSequenceReader = xpsDocument.FixedDocumentSequenceReader

ShowStatus("   Getting FixedDocumentReaders.")
Dim fixedDocuments As ICollection(Of IXpsFixedDocumentReader) = fixedDocSeqReader.FixedDocuments

ShowStatus("   Getting FixedPageReaders.")
Dim enumerator As IEnumerator(Of IXpsFixedDocumentReader) = fixedDocuments.GetEnumerator()
enumerator.MoveNext()
Dim fixedPages As ICollection(Of IXpsFixedPageReader) = enumerator.Current.FixedPages


' Add a document structure to each fixed page.
Dim i As Integer = 0
For Each fixedPageReader As IXpsFixedPageReader In fixedPages
    Dim pageStructure As XpsResource
    ShowStatus("   Adding page structure resource:" & vbLf & "       '" & Filename(_fixedPageStructures(i)) & "'")
    Try
        pageStructure = fixedPageReader.AddStoryFragment()
    Catch e2 As InvalidOperationException
        System.Windows.MessageBox.Show(xpsUnstructuredFile & vbLf & vbLf & "Document structure cannot be added." & vbLf & vbLf & Filename(xpsUnstructuredFile) & " might already " & "contain an existing document structure.",
                        "Cannot Add Document Structure",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error)
        Exit For
    End Try

    ' Copy the page structure to the new StoryFragment.
    WriteResource(pageStructure, _fixedPageStructures(i))
    i += 1
Next fixedPageReader

ShowStatus("   Saving and closing the new document." & vbLf)
xpsDocument.Close()

プロパティ

名前 説明
ColorContexts

ページ上のすべての色コンテキストのコレクションを取得します。

Fonts

ページで使用されるすべてのフォントのコレクションを取得します。

Images

ページ上のすべてのイメージのコレクションを取得します。

PageNumber

ページ番号を取得します。

PrintTicket

チケットが存在する場合は、PrintTicketに関連付けられているFixedPageを取得します。

ResourceDictionaries

ページのすべてのリソース ディクショナリのコレクションを取得します。

StoryFragment

XPS パッケージのマークアップの StoryFragments 部分を取得します。

Thumbnail

FixedPageに関連付けられているサムネイル画像 (サムネイルが存在する場合) を取得します。

Uri

FixedPageの URI (Uniform Resource Identifier) を取得します。

XmlReader

ページの XmlReader を取得します。

メソッド

名前 説明
AddStoryFragment()

XPS パッケージに StoryFragments 要素を追加します。

(継承元 IStoryFragmentProvider)
GetColorContext(Uri)

指定した UNIFORM Resource Identifier (URI) を持つリソースのカラー コンテキストを取得します。

GetFont(Uri)

指定した UNIFORM Resource Identifier (URI) を持つフォントを取得します。

GetImage(Uri)

指定した UNIFORM Resource Identifier (URI) を持つイメージを取得します。

GetResource(Uri)

指定した UNIFORM Resource Identifier (URI) を持つリソースを取得します。

GetResourceDictionary(Uri)

指定した URI (Uniform Resource Identifier) を持つリソース ディクショナリを取得します。

適用対象