Document.SaveAsync

SaveAsync(Stream, CancellationToken)

Speichert das Dokument in einen Stream.

public Task SaveAsync(Stream output, CancellationToken cancellationToken)
ParameterTypBeschreibung
outputStreamStream, in dem das Dokument gespeichert werden soll.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Siehe auch


SaveAsync(string, CancellationToken)

Speichert das Dokument in der angegebenen Datei.

public Task SaveAsync(string outputFileName, CancellationToken cancellationToken)
ParameterTypBeschreibung
outputFileNameStringPfad zur Datei, in der das Dokument gespeichert wird.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Siehe auch


SaveAsync(CancellationToken)

Speichert das Dokument inkrementell (d.h. unter Verwendung der inkrementellen Aktualisierungstechnik).

public Task SaveAsync(CancellationToken cancellationToken)
ParameterTypBeschreibung
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Anmerkungen

Um das Dokument inkrementell zu speichern, müssen wir die Dokumentdatei zum Schreiben öffnen. Daher muss das Dokument mit einem beschreibbaren Stream initialisiert werden, wie im folgenden Code-Snippet: Document doc = new Document(new FileStream(“document.pdf”, FileMode.Open, FileAccess.ReadWrite)); // Änderungen vornehmen und das Dokument inkrementell speichern doc.Save();

Siehe auch


SaveAsync(SaveOptions, CancellationToken)

Speichert das Dokument mit Speicheroptionen.

public Task SaveAsync(SaveOptions options, CancellationToken cancellationToken)
ParameterTypBeschreibung
optionsSaveOptionsSpeicheroptionen.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Siehe auch


SaveAsync(string, SaveFormat, CancellationToken)

Speichert das Dokument mit einem neuen Namen zusammen mit einem Dateiformat.

public Task SaveAsync(string outputFileName, SaveFormat format, CancellationToken cancellationToken)
ParameterTypBeschreibung
outputFileNameStringPfad zur Datei, in der das Dokument gespeichert wird.
formatSaveFormatFormatoptionen.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Siehe auch


SaveAsync(Stream, SaveFormat, CancellationToken)

Speichert das Dokument mit einem neuen Namen zusammen mit einem Dateiformat.

public Task SaveAsync(Stream outputStream, SaveFormat format, CancellationToken cancellationToken)
ParameterTypBeschreibung
outputStreamStreamStream, in dem das Dokument gespeichert wird.
formatSaveFormatFormatoptionen.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Ausnahmen

AusnahmeBedingung
ArgumentExceptionArgumentException, wenn HtmlSaveOptions an eine Methode übergeben wird. Das Speichern eines Dokuments im HTML-Stream wird nicht unterstützt. Bitte verwenden Sie die Methode zum Speichern in die Datei.

Siehe auch


SaveAsync(string, SaveOptions, CancellationToken)

Speichert das Dokument mit einem neuen Namen und setzt seine Speicheroptionen.

public Task SaveAsync(string outputFileName, SaveOptions options, 
    CancellationToken cancellationToken)
ParameterTypBeschreibung
outputFileNameStringPfad zur Datei, in der das Dokument gespeichert wird.
optionsSaveOptionsSpeicheroptionen.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Siehe auch


SaveAsync(Stream, SaveOptions, CancellationToken)

Speichert das Dokument in einen Stream mit Speicheroptionen.

public Task SaveAsync(Stream outputStream, SaveOptions options, CancellationToken cancellationToken)
ParameterTypBeschreibung
outputStreamStreamStream, in dem das Dokument gespeichert wird.
optionsSaveOptionsSpeicheroptionen.
cancellationTokenCancellationTokenAbbruch-Token.

Rückgabewert

Asynchrone Aufgabe.

Ausnahmen

AusnahmeBedingung
ArgumentExceptionArgumentException, wenn HtmlSaveOptions an eine Methode übergeben wird. Das Speichern eines Dokuments im HTML-Stream wird nicht unterstützt. Bitte verwenden Sie die Methode zum Speichern in die Datei.

Siehe auch