Document.SaveAsync

SaveAsync(Stream, CancellationToken)

Stores document into stream.

public Task SaveAsync(Stream output, CancellationToken cancellationToken)
ParameterTypeDescription
outputStreamStream where document shell be stored.
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

See Also


SaveAsync(string, CancellationToken)

Saves document into the specified file.

public Task SaveAsync(string outputFileName, CancellationToken cancellationToken)
ParameterTypeDescription
outputFileNameStringPath to file where the document will be stored.
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

See Also


SaveAsync(CancellationToken)

Save document incrementally (i.e. using incremental update technique).

public Task SaveAsync(CancellationToken cancellationToken)
ParameterTypeDescription
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

Remarks

In order to save document incrementally we should open the document file for writing. Therefore Document must be initialized with writable stream like in the next code snippet: Document doc = new Document(new FileStream(“document.pdf”, FileMode.Open, FileAccess.ReadWrite)); // make some changes and save the document incrementally doc.Save();

See Also


SaveAsync(SaveOptions, CancellationToken)

Saves the document with save options.

public Task SaveAsync(SaveOptions options, CancellationToken cancellationToken)
ParameterTypeDescription
optionsSaveOptionsSave options.
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

See Also


SaveAsync(string, SaveFormat, CancellationToken)

Saves the document with a new name along with a file format.

public Task SaveAsync(string outputFileName, SaveFormat format, CancellationToken cancellationToken)
ParameterTypeDescription
outputFileNameStringPath to file where the document will be stored.
formatSaveFormatFormat options.
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

See Also


SaveAsync(Stream, SaveFormat, CancellationToken)

Saves the document with a new name along with a file format.

public Task SaveAsync(Stream outputStream, SaveFormat format, CancellationToken cancellationToken)
ParameterTypeDescription
outputStreamStreamStream where the document will be stored.
formatSaveFormatFormat options.
cancellationTokenCancellationTokenCancellation token

Return Value

Asynchronous task.

Exceptions

exceptioncondition
ArgumentExceptionArgumentException when HtmlSaveOptions is passed to a method. Save a document to the html stream is not supported. Please use method save to the file.

See Also


SaveAsync(string, SaveOptions, CancellationToken)

Saves the document with a new name setting its save options.

public Task SaveAsync(string outputFileName, SaveOptions options, 
    CancellationToken cancellationToken)
ParameterTypeDescription
outputFileNameStringPath to file where the document will be stored.
optionsSaveOptionsSave options.
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

See Also


SaveAsync(Stream, SaveOptions, CancellationToken)

Saves the document to a stream with a save options.

public Task SaveAsync(Stream outputStream, SaveOptions options, CancellationToken cancellationToken)
ParameterTypeDescription
outputStreamStreamStream where the document will be stored.
optionsSaveOptionsSave options.
cancellationTokenCancellationTokenCaclellation token.

Return Value

Asynchronous task.

Exceptions

exceptioncondition
ArgumentExceptionArgumentException when HtmlSaveOptions is passed to a method. Save a document to the html stream is not supported. Please use method save to the file.

See Also