Język

XpsDocumentWriter.Write Metoda

Definicja

Przeciążenia

Nazwa Opis
Write(Visual, PrintTicket)

Zapisuje synchronicznie określony Visual razem z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedPage, PrintTicket)

Zapisuje synchronicznie określony FixedPage razem z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedDocumentSequence, PrintTicket)

Zapisuje synchronicznie określony FixedDocumentSequence razem z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedDocument, PrintTicket)

Zapisuje synchronicznie wartość w FixedDocument połączeniu z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(String, XpsDocumentNotificationLevel)

Zapisuje synchronicznie określony dokument XPS do obiektu docelowego XpsDocument lub PrintQueue.

Write(DocumentPaginator, PrintTicket)

Zapisuje synchronicznie stronicowaną zawartość z określonej DocumentPaginator wartości razem z wartością PrintTicket docelową XpsDocument lub PrintQueue.

Write(FixedPage)

Zapisuje synchronicznie określony FixedPage element docelowy XpsDocument lub PrintQueue.

Write(FixedDocumentSequence)

Zapisuje synchronicznie określony FixedDocumentSequence element docelowy XpsDocument lub PrintQueue.

Write(FixedDocument)

Zapisuje synchronicznie określony FixedDocument element docelowy XpsDocument lub PrintQueue.

Write(DocumentPaginator)

Zapisuje synchronicznie podzielony na strony zawartość z określonej DocumentPaginator wartości docelowej XpsDocument lub PrintQueue.

Write(String)

Synchronicznie zapisuje określony dokument XPS w obiekcie docelowym XpsDocument lub PrintQueue.

Write(Visual)

Zapisuje synchronicznie określony Visual element docelowy XpsDocument lub PrintQueue.

Write(Visual, PrintTicket)

Zapisuje synchronicznie określony Visual razem z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Media::Visual ^ visual, System::Printing::PrintTicket ^ printTicket);
public override void Write(System.Windows.Media.Visual visual, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Media.Visual * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (visual As Visual, printTicket As PrintTicket)

Parametry

visual
Visual

To Visual jest napisane.

printTicket
PrintTicket

Element PrintTicket reprezentujący domyślne preferencje drukowania dla dokumentu.

Uwagi

Aby wsadowy zapisać element Visual, użyj polecenia VisualsToXpsDocument.

Ta metoda nie weryfikuje ani nie modyfikuje określonej wartości printTicket dla określonego PrintQueueelementu . W razie potrzeby użyj MergeAndValidatePrintTicket metody , aby utworzyć element PrintTicket specyficzny dla PrintQueue elementu i jest prawidłowy dla określonej drukarki.

Dotyczy

Write(FixedPage, PrintTicket)

Zapisuje synchronicznie określony FixedPage razem z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::FixedPage ^ fixedPage, System::Printing::PrintTicket ^ printTicket);
public override void Write(System.Windows.Documents.FixedPage fixedPage, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Documents.FixedPage * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (fixedPage As FixedPage, printTicket As PrintTicket)

Parametry

fixedPage
FixedPage

Napisana strona.

printTicket
PrintTicket

Obiekt PrintTicket reprezentujący domyślne preferencje drukowania dla strony.

Uwagi

Ta metoda nie weryfikuje ani nie modyfikuje określonej wartości printTicket dla określonego PrintQueueelementu . W razie potrzeby użyj MergeAndValidatePrintTicket metody , aby utworzyć element PrintTicket specyficzny dla PrintQueue elementu i jest prawidłowy dla określonej drukarki.

Dotyczy

Write(FixedDocumentSequence, PrintTicket)

Zapisuje synchronicznie określony FixedDocumentSequence razem z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::FixedDocumentSequence ^ fixedDocumentSequence, System::Printing::PrintTicket ^ printTicket);
public override void Write(System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Documents.FixedDocumentSequence * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (fixedDocumentSequence As FixedDocumentSequence, printTicket As PrintTicket)

Parametry

fixedDocumentSequence
FixedDocumentSequence

Zestaw zapisanych dokumentów.

printTicket
PrintTicket

Element PrintTicket reprezentujący domyślne preferencje drukowania dla zestawu dokumentów.

Uwagi

XpsDocument Mimo że klasa ma pojedynczą nazwę, XpsDocument może to być jeden FixedDocument lub zestaw wielu dokumentów. Ta metoda dodaje FixedDocument zestaw elementów lub FixedDocument do istniejącego zestawu.

Ta metoda nie weryfikuje ani nie modyfikuje określonej wartości printTicket dla określonego PrintQueueelementu . W razie potrzeby użyj MergeAndValidatePrintTicket metody , aby utworzyć element PrintTicket specyficzny dla PrintQueue elementu i jest prawidłowy dla określonej drukarki.

Dotyczy

Write(FixedDocument, PrintTicket)

Zapisuje synchronicznie wartość w FixedDocument połączeniu z elementem PrintTicket docelowym XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::FixedDocument ^ fixedDocument, System::Printing::PrintTicket ^ printTicket);
public override void Write(System.Windows.Documents.FixedDocument fixedDocument, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Documents.FixedDocument * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (fixedDocument As FixedDocument, printTicket As PrintTicket)

Parametry

fixedDocument
FixedDocument

Zapisany dokument.

printTicket
PrintTicket

Element PrintTicket reprezentujący domyślne preferencje drukowania dla dokumentu.

Uwagi

XpsDocument Mimo że klasa ma pojedynczą nazwę, XpsDocument może to być jeden FixedDocument lub zestaw wielu dokumentów. Ta metoda dodaje element FixedDocument do zestawu.

Ta metoda nie weryfikuje ani nie modyfikuje określonej wartości printTicket dla określonego PrintQueueelementu . W razie potrzeby użyj MergeAndValidatePrintTicket metody , aby utworzyć element PrintTicket specyficzny dla PrintQueue elementu i jest prawidłowy dla określonej drukarki.

Dotyczy

Write(String, XpsDocumentNotificationLevel)

Zapisuje synchronicznie określony dokument XPS do obiektu docelowego XpsDocument lub PrintQueue.

public:
 void Write(System::String ^ documentPath, System::Windows::Xps::XpsDocumentNotificationLevel notificationLevel);
public void Write(string documentPath, System.Windows.Xps.XpsDocumentNotificationLevel notificationLevel);
override this.Write : string * System.Windows.Xps.XpsDocumentNotificationLevel -> unit
Public Sub Write (documentPath As String, notificationLevel As XpsDocumentNotificationLevel)

Parametry

documentPath
String

Ścieżka dokumentu źródłowego.

notificationLevel
XpsDocumentNotificationLevel

Wskazanie, czy powiadomienie jest włączone.

Uwagi

Po notificationLevel wyłączeniu program XpsDocumentWriter kopiuje serializowany dokumentXPS do obiektu docelowego XpsDocument lub PrintQueue utworzony przez program XpsDocumentWriter. Gdy notificationLevel jest włączona, XpsDocumentWriter pierwszy deserializuje dokument, następnie reerializuje go, a następnie zapisuje go w miejscu docelowym z powiadomieniami o postępie, gdy każda strona jest danymi wyjściowymi.

XpsDocument Mimo że klasa ma pojedynczą nazwę, XpsDocument może to być jeden FixedDocument lub zestaw wielu dokumentów. Ta metoda dodaje FixedDocument elementy w źródle do sekwencji FixedDocument elementów w obiekcie docelowym XpsDocument lub PrintQueue.

Jeśli notificationLevel parametr jest określony jako ReceiveNotificationEnabled, powiadomienia są generowane tylko wtedy, gdy dokument jest serializowany, a nie drukowany. Aby otrzymywać powiadomienia, dokument musi zostać ponownie zainicjowany. Gdy dokument zostanie ponownie sformatowany, zostanie usunięta cała zawartość z dokumentuPackage, która nie jest wymagana do zachowania przez specyfikację papieru XML (XPS). Ponowna synchronizacja spowoduje również usunięcie wszystkich rozszerzeń z adiustacji, w tym całej rozszerzonej FixedPage zawartości XPS.

Jeśli notificationLevel dokument nie zostanie określony ReceiveNotificationDisabled ponownie, a każda rozszerzona zawartość zostanie zachowana, nawet jeśli zostanie wydrukowana.

Zgodnie z projektem ta Write metoda nie wywołuje WritingPrintTicketRequired zdarzenia.

Dotyczy

Write(DocumentPaginator, PrintTicket)

Zapisuje synchronicznie stronicowaną zawartość z określonej DocumentPaginator wartości razem z wartością PrintTicket docelową XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::DocumentPaginator ^ documentPaginator, System::Printing::PrintTicket ^ printTicket);
public override void Write(System.Windows.Documents.DocumentPaginator documentPaginator, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Documents.DocumentPaginator * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (documentPaginator As DocumentPaginator, printTicket As PrintTicket)

Parametry

documentPaginator
DocumentPaginator

Obiekt, który zawiera wskaźnik do niepaginowanego materiału źródłowego, a także zawiera metody stronicowania materiału.

printTicket
PrintTicket

Element PrintTicket reprezentujący domyślne preferencje drukowania materiału.

Uwagi

Ta metoda nie weryfikuje ani nie modyfikuje określonej wartości printTicket dla określonego PrintQueueelementu . W razie potrzeby użyj MergeAndValidatePrintTicket metody , aby utworzyć element PrintTicket specyficzny dla PrintQueue elementu i jest prawidłowy dla określonej drukarki.

Dotyczy

Write(FixedPage)

Zapisuje synchronicznie określony FixedPage element docelowy XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::FixedPage ^ fixedPage);
public override void Write(System.Windows.Documents.FixedPage fixedPage);
override this.Write : System.Windows.Documents.FixedPage -> unit
Public Overrides Sub Write (fixedPage As FixedPage)

Parametry

fixedPage
FixedPage

Strona zapisana w pliku XpsDocument.

Dotyczy

Write(FixedDocumentSequence)

Zapisuje synchronicznie określony FixedDocumentSequence element docelowy XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::FixedDocumentSequence ^ fixedDocumentSequence);
public override void Write(System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence);
override this.Write : System.Windows.Documents.FixedDocumentSequence -> unit
Public Overrides Sub Write (fixedDocumentSequence As FixedDocumentSequence)

Parametry

fixedDocumentSequence
FixedDocumentSequence

Zestaw dokumentów zapisanych w pliku XpsDocument.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą Write metody napisać sekwencję dokumentów XPS.

private void SaveMultipleFixedContentDocuments(
             XpsDocumentWriter xpsdw, FixedDocumentSequence fds)
{
    // Write the FixedDocumentSequence as a collection of documents
    xpsdw.Write(fds);
}
Private Sub SaveMultipleFixedContentDocuments(ByVal xpsdw As XpsDocumentWriter, ByVal fds As FixedDocumentSequence)
    ' Write the FixedDocumentSequence as a collection of documents
    xpsdw.Write(fds)
End Sub

Uwagi

XpsDocument Mimo że klasa ma pojedynczą nazwę, XpsDocument może to być jeden FixedDocument lub zestaw wielu dokumentów. Ta metoda dodaje FixedDocument zestaw elementów lub FixedDocument do istniejącego zestawu.

Dotyczy

Write(FixedDocument)

Zapisuje synchronicznie określony FixedDocument element docelowy XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::FixedDocument ^ fixedDocument);
public override void Write(System.Windows.Documents.FixedDocument fixedDocument);
override this.Write : System.Windows.Documents.FixedDocument -> unit
Public Overrides Sub Write (fixedDocument As FixedDocument)

Parametry

fixedDocument
FixedDocument

Dokument zapisany w pliku XpsDocument.

Przykłady

W poniższym przykładzie pokazano, jak użyć tej metody do zapisu w dokumencie XPS.

private void SaveSingleFixedContentDocument(
             XpsDocumentWriter xpsdw, FixedDocument fd)
{
    xpsdw.Write(fd);        // Write the FixedDocument as a document.
}
Private Sub SaveSingleFixedContentDocument(ByVal xpsdw As XpsDocumentWriter, ByVal fd As FixedDocument)
    xpsdw.Write(fd) ' Write the FixedDocument as a document.
End Sub

Uwagi

XpsDocument Mimo że klasa ma pojedynczą nazwę, XpsDocument może to być jeden FixedDocument lub zestaw wielu dokumentów. Ta metoda dodaje element FixedDocument do zestawu.

Dotyczy

Write(DocumentPaginator)

Zapisuje synchronicznie podzielony na strony zawartość z określonej DocumentPaginator wartości docelowej XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Documents::DocumentPaginator ^ documentPaginator);
public override void Write(System.Windows.Documents.DocumentPaginator documentPaginator);
override this.Write : System.Windows.Documents.DocumentPaginator -> unit
Public Overrides Sub Write (documentPaginator As DocumentPaginator)

Parametry

documentPaginator
DocumentPaginator

Obiekt, który zawiera wskaźnik do niepaginowanego materiału źródłowego, a także zawiera metody stronicowania materiału.

Przykłady

W poniższym przykładzie pokazano, jak używać Write metody do zapisu w dokumencie XPS.

private void SaveSingleFlowContentDocument(
             XpsDocumentWriter xpsdw, DocumentPaginator docPaginator)
{
    xpsdw.Write(docPaginator); // Write the DocPaginator as a document.
}
Private Sub SaveSingleFlowContentDocument(ByVal xpsdw As XpsDocumentWriter, ByVal docPaginator As DocumentPaginator)
    xpsdw.Write(docPaginator) ' Write the DocPaginator as a document.
End Sub

Dotyczy

Write(String)

Synchronicznie zapisuje określony dokument XPS w obiekcie docelowym XpsDocument lub PrintQueue.

public:
 void Write(System::String ^ documentPath);
public void Write(string documentPath);
override this.Write : string -> unit
Public Sub Write (documentPath As String)

Parametry

documentPath
String

Ścieżka dokumentu źródłowego.

Uwagi

XpsDocumentWriter Mimo że klasa ma pojedynczą nazwę, XpsDocumentWriter może to być jeden FixedDocument lub zestaw wielu dokumentów. Ta metoda dodaje FixedDocument elementy w źródle do zestawu FixedDocument elementów w obiekcie docelowym XpsDocumentWriter lub PrintQueue.

Ta Write metoda reerializuje określony dokument XPS, który usuwa całą zawartość z elementu Package , który nie jest wymagany do zachowania przez specyfikację papieru XML. Ponowna synchronizacja usuwa również wszystkie rozszerzenia z FixedPage adiustacji, w tym każdą rozszerzoną zawartość XPS.

Zgodnie z projektem ta Write metoda nie zgłasza WritingPrintTicketRequired zdarzenia.

Dotyczy

Write(Visual)

Zapisuje synchronicznie określony Visual element docelowy XpsDocument lub PrintQueue.

public:
 override void Write(System::Windows::Media::Visual ^ visual);
public override void Write(System.Windows.Media.Visual visual);
override this.Write : System.Windows.Media.Visual -> unit
Public Overrides Sub Write (visual As Visual)

Parametry

visual
Visual

To Visual jest napisane.

Przykłady

W poniższym przykładzie pokazano, jak użyć Write metody do zapisania Visual elementu w dokumencie XPS.

private void SaveVisual(XpsDocumentWriter xpsdw, Visual v)
{
    xpsdw.Write(v); // Write visual to single page
}
Private Sub SaveVisual(ByVal xpsdw As XpsDocumentWriter, ByVal v As Visual)
    xpsdw.Write(v) ' Write visual to single page
End Sub

Uwagi

Aby wsadowy zapisać element Visual, użyj polecenia VisualsToXpsDocument.

Dotyczy