IXpsFixedPageWriter.Commit 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
고정 페이지 작성기를 플러시하고 닫습니다.
public:
void Commit();
public void Commit ();
abstract member Commit : unit -> unit
Public Sub Commit ()
예제
다음 예제에서는 사용 하 여 고정 페이지 작성기를 닫고 플러시 하는 방법의 Commit 메서드.
// ------------------------- AddDocumentContent ---------------------------
/// <summary>
/// Adds a predefined set of content to a given document writer.</summary>
/// <param name="fixedDocumentWriter">
/// The document writer to add the content to.</param>
void AddDocumentContent (IXpsFixedDocumentWriter^ fixedDocumentWriter)
{
// Collection of image and font resources used on the current page.
// Key: "XpsImage", "XpsFont"
// Value: List of XpsImage or XpsFont resources
Dictionary<System::String^,List<XpsResource^>^>^ resources;
try
{
// Add Page 1 to current document.
IXpsFixedPageWriter^ fixedPageWriter = fixedDocumentWriter->AddFixedPage();
// Add the resources for Page 1 and get the resource collection.
resources = AddPageResources(fixedPageWriter);
// Write page content for Page 1.
WritePageContent(fixedPageWriter->XmlWriter, "Page 1 of " + fixedDocumentWriter->Uri->ToString(), resources);
// Commit Page 1.
fixedPageWriter->Commit();
// Add Page 2 to current document.
fixedPageWriter = fixedDocumentWriter->AddFixedPage();
// Add the resources for Page 2 and get the resource collection.
resources = AddPageResources(fixedPageWriter);
// Write page content to Page 2.
WritePageContent(fixedPageWriter->XmlWriter, "Page 2 of " + fixedDocumentWriter->Uri->ToString(), resources);
// Commit Page 2.
fixedPageWriter->Commit();
} catch (XpsPackagingException^ xpsException)
{
throw xpsException;
}
};// end:AddDocumentContent()
// ------------------------- AddDocumentContent ---------------------------
/// <summary>
/// Adds a predefined set of content to a given document writer.</summary>
/// <param name="fixedDocumentWriter">
/// The document writer to add the content to.</param>
private void AddDocumentContent(IXpsFixedDocumentWriter fixedDocumentWriter)
{
// Collection of image and font resources used on the current page.
// Key: "XpsImage", "XpsFont"
// Value: List of XpsImage or XpsFont resources
Dictionary<string, List<XpsResource>> resources;
try
{
// Add Page 1 to current document.
IXpsFixedPageWriter fixedPageWriter =
fixedDocumentWriter.AddFixedPage();
// Add the resources for Page 1 and get the resource collection.
resources = AddPageResources(fixedPageWriter);
// Write page content for Page 1.
WritePageContent(fixedPageWriter.XmlWriter,
"Page 1 of " + fixedDocumentWriter.Uri.ToString(), resources);
// Commit Page 1.
fixedPageWriter.Commit();
// Add Page 2 to current document.
fixedPageWriter = fixedDocumentWriter.AddFixedPage();
// Add the resources for Page 2 and get the resource collection.
resources = AddPageResources(fixedPageWriter);
// Write page content to Page 2.
WritePageContent(fixedPageWriter.XmlWriter,
"Page 2 of " + fixedDocumentWriter.Uri.ToString(), resources);
// Commit Page 2.
fixedPageWriter.Commit();
}
catch (XpsPackagingException xpsException)
{
throw xpsException;
}
}// end:AddDocumentContent()
' ------------------------- AddDocumentContent ---------------------------
''' <summary>
''' Adds a predefined set of content to a given document writer.</summary>
''' <param name="fixedDocumentWriter">
''' The document writer to add the content to.</param>
Private Sub AddDocumentContent(ByVal fixedDocumentWriter As IXpsFixedDocumentWriter)
' Collection of image and font resources used on the current page.
' Key: "XpsImage", "XpsFont"
' Value: List of XpsImage or XpsFont resources
Dim resources As Dictionary(Of String, List(Of XpsResource))
Try
' Add Page 1 to current document.
Dim fixedPageWriter As IXpsFixedPageWriter = fixedDocumentWriter.AddFixedPage()
' Add the resources for Page 1 and get the resource collection.
resources = AddPageResources(fixedPageWriter)
' Write page content for Page 1.
WritePageContent(fixedPageWriter.XmlWriter, "Page 1 of " & fixedDocumentWriter.Uri.ToString(), resources)
' Commit Page 1.
fixedPageWriter.Commit()
' Add Page 2 to current document.
fixedPageWriter = fixedDocumentWriter.AddFixedPage()
' Add the resources for Page 2 and get the resource collection.
resources = AddPageResources(fixedPageWriter)
' Write page content to Page 2.
WritePageContent(fixedPageWriter.XmlWriter, "Page 2 of " & fixedDocumentWriter.Uri.ToString(), resources)
' Commit Page 2.
fixedPageWriter.Commit()
Catch xpsException As XpsPackagingException
Throw xpsException
End Try
End Sub
설명
설정에 따라 XpsSerializationManager 및 XpsPackagingPolicy와 같은 FontSubsetterCommitPolicies 및 PackageInterleavingOrder, 플러시 작업을 Commit 메서드는 완료 될 때까지 지연 될 수 있습니다 XpsDocument 닫혀.