XpsDocument.Close XpsDocument.Close XpsDocument.Close XpsDocument.Close Method

정의

XPS 문서 Package를 닫습니다.Closes the XPS document Package.

public:
 void Close();
public void Close ();
member this.Close : unit -> unit
Public Sub Close ()

예제

다음 예제에서는 열기, 콘텐츠를 삽입 및 닫기 방법은 XpsDocument합니다.The following example shows how to open, insert content, and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

다음 예제에서는 방법도 엽니다, 쓰기, 및 닫기는 XpsDocument합니다.The following example also shows how to open, write to, and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

설명

경우는 XpsDocument 버퍼가 저장소 및 실제 문서에 기록 되는 데이터 쓰기 권한으로 열렸으면 Package 닫혀 있습니다.If the XpsDocument was opened for write access, data buffers are written to the store and the physical document Package is closed.

이후에 Close 되었으면 호출 없는 문서 부분을 통해 액세스할 수 있습니다이 XpsDocument 인스턴스.After Close has been called, no parts of the document can be accessed with this XpsDocument instance.

적용 대상