XpsDocumentWriter.Write Metoda

Definicja

Przeciążenia

Write(Visual, PrintTicket)

Zapisuje synchronicznie określony Visual element wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedPage, PrintTicket)

Zapisuje synchronicznie określony FixedPage element wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedDocumentSequence, PrintTicket)

Zapisuje synchronicznie określony FixedDocumentSequence element wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedDocument, PrintTicket)

Zapisuje synchronicznie obiekt FixedDocument wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(String, XpsDocumentNotificationLevel)

Zapisuje synchronicznie określony dokument XPS w obiekcie docelowym XpsDocument lub PrintQueue.

Write(DocumentPaginator, PrintTicket)

Zapisuje synchronicznie z podziałem na strony zawartość z określonego DocumentPaginator obiektu wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

Write(FixedPage)

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

Write(FixedDocumentSequence)

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

Write(FixedDocument)

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

Write(DocumentPaginator)

Zapisuje synchronicznie z podziałem na strony zawartość z określonego DocumentPaginator obiektu docelowego XpsDocument lub PrintQueue.

Write(String)

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

Write(Visual)

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

Write(Visual, PrintTicket)

Zapisuje synchronicznie określony Visual element wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

C#
public override void Write (System.Windows.Media.Visual visual, System.Printing.PrintTicket printTicket);

Parametry

visual
Visual

To Visual jest napisane.

printTicket
PrintTicket

Obiekt PrintTicket reprezentujący domyślne preferencje drukowania dokumentu.

Uwagi

Aby zapisać wsadowe polecenie Visual, użyj polecenia VisualsToXpsDocument.

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(FixedPage, PrintTicket)

Zapisuje synchronicznie określony FixedPage element wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

C#
public override void Write (System.Windows.Documents.FixedPage fixedPage, System.Printing.PrintTicket printTicket);

Parametry

fixedPage
FixedPage

Strona, która jest napisana.

printTicket
PrintTicket

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

Uwagi

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(FixedDocumentSequence, PrintTicket)

Zapisuje synchronicznie określony FixedDocumentSequence element wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

C#
public override void Write (System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence, System.Printing.PrintTicket printTicket);

Parametry

fixedDocumentSequence
FixedDocumentSequence

Zestaw zapisanych dokumentów.

printTicket
PrintTicket

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

Uwagi

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

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(FixedDocument, PrintTicket)

Zapisuje synchronicznie obiekt FixedDocument wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

C#
public override void Write (System.Windows.Documents.FixedDocument fixedDocument, System.Printing.PrintTicket printTicket);

Parametry

fixedDocument
FixedDocument

Napisany dokument.

printTicket
PrintTicket

Obiekt PrintTicket reprezentujący domyślne preferencje drukowania dokumentu.

Uwagi

XpsDocument Chociaż klasa ma pojedynczą nazwę, XpsDocument może być jednym FixedDocument lub zestawem wielu dokumentów. Ta metoda dodaje element FixedDocument do zestawu.

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(String, XpsDocumentNotificationLevel)

Zapisuje synchronicznie określony dokument XPS w obiekcie docelowym XpsDocument lub PrintQueue.

C#
public void Write (string documentPath, System.Windows.Xps.XpsDocumentNotificationLevel notificationLevel);

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, ponieważ każda strona jest danymi wyjściowymi.

XpsDocument Chociaż klasa ma pojedynczą nazwę, XpsDocument może być jednym FixedDocument lub zestawem 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 jest ponownie sformatowany, usuwana jest cała zawartość z dokumentu Package , która nie jest wymagana do zachowania przez specyfikację papieru XML (XPS ). Ponowna synchronizacja spowoduje również usunięcie wszystkich rozszerzeń ze FixedPage znaczników, w tym całej rozszerzonej zawartości XPS.

Jeśli notificationLevel zostanie określony jako ReceiveNotificationDisabled dokument, nie zostanie ponownie zainicjowany i żadna rozszerzona zawartość zostanie zachowana, nawet po wydrukowaniu.

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(DocumentPaginator, PrintTicket)

Zapisuje synchronicznie z podziałem na strony zawartość z określonego DocumentPaginator obiektu wraz z obiektem PrintTicket docelowym XpsDocument lub PrintQueue.

C#
public override void Write (System.Windows.Documents.DocumentPaginator documentPaginator, System.Printing.PrintTicket 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

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

Uwagi

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(FixedPage)

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

C#
public override void Write (System.Windows.Documents.FixedPage fixedPage);

Parametry

fixedPage
FixedPage

Strona zapisana w obiekcie XpsDocument.

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(FixedDocumentSequence)

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

C#
public override void Write (System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence);

Parametry

fixedDocumentSequence
FixedDocumentSequence

Zestaw dokumentów zapisywanych w obiekcie XpsDocument.

Przykłady

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

C#
private void SaveMultipleFixedContentDocuments(
             XpsDocumentWriter xpsdw, FixedDocumentSequence fds)
{
    // Write the FixedDocumentSequence as a collection of documents
    xpsdw.Write(fds);
}

Uwagi

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

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(FixedDocument)

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

C#
public override void Write (System.Windows.Documents.FixedDocument fixedDocument);

Parametry

fixedDocument
FixedDocument

Dokument, który jest zapisywany w obiekcie XpsDocument.

Przykłady

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

C#
private void SaveSingleFixedContentDocument(
             XpsDocumentWriter xpsdw, FixedDocument fd)
{
    xpsdw.Write(fd);        // Write the FixedDocument as a document.
}

Uwagi

XpsDocument Chociaż klasa ma pojedynczą nazwę, XpsDocument może być jednym FixedDocument lub zestawem wielu dokumentów. Ta metoda dodaje element FixedDocument do zestawu.

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(DocumentPaginator)

Zapisuje synchronicznie z podziałem na strony zawartość z określonego DocumentPaginator obiektu docelowego XpsDocument lub PrintQueue.

C#
public override void Write (System.Windows.Documents.DocumentPaginator 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 zapisywania w dokumencie XPS.

C#
private void SaveSingleFlowContentDocument(
             XpsDocumentWriter xpsdw, DocumentPaginator docPaginator)
{
    xpsdw.Write(docPaginator); // Write the DocPaginator as a document.
}

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(String)

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

C#
public void Write (string documentPath);

Parametry

documentPath
String

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

Uwagi

XpsDocumentWriter Chociaż klasa ma pojedynczą nazwę, XpsDocumentWriter może być jednym FixedDocument lub zestawem 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 reserializuje 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

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Write(Visual)

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

C#
public override void Write (System.Windows.Media.Visual 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.

C#
private void SaveVisual(XpsDocumentWriter xpsdw, Visual v)
{
    xpsdw.Write(v); // Write visual to single page
}

Uwagi

Aby zapisać wsadowe polecenie Visual, użyj polecenia VisualsToXpsDocument.

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9