HTMLDocument.SaveAsync
SaveAsync(string, HTMLSaveOptions, CancellationToken)
Asynchronously saves the document to local file specified by path. All resources used in this document will be saved in to adjacent folder, whose name will be constructed as: output_file_name + “_files”.
public Task SaveAsync(string path, HTMLSaveOptions saveOptions, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| path | String | Local path to output file. |
| saveOptions | HTMLSaveOptions | HTML save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | Raised if the specified path is not a valid local file path. |
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class HTMLSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(Url, HTMLSaveOptions, CancellationToken)
Asynchronously saves the document to local file specified by url. All resources used in this document will be saved in to adjacent folder, whose name will be constructed as: output_file_name + “_files”.
public Task SaveAsync(Url url, HTMLSaveOptions saveOptions, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| url | Url | Local URL to output file. |
| saveOptions | HTMLSaveOptions | HTML save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | Raised if the specified url is not a valid local file URL. |
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class Url
- class HTMLSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(ResourceHandler, HTMLSaveOptions, CancellationToken)
Asynchronously saves the document content and resources using the ResourceHandler.
public Task SaveAsync(ResourceHandler resourceHandler, HTMLSaveOptions saveOptions,
CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| resourceHandler | ResourceHandler | The resource handler ResourceHandler. Its HandleResourceAsync method is used. |
| saveOptions | HTMLSaveOptions | HTML save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class ResourceHandler
- class HTMLSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(string, MarkdownSaveOptions, CancellationToken)
Asynchronously saves the document to local file specified by path. All resources used in this document will be saved in to adjacent folder, whose name will be constructed as: output_file_name + “_files”.
public Task SaveAsync(string path, MarkdownSaveOptions saveOptions,
CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| path | String | Local path to output file. |
| saveOptions | MarkdownSaveOptions | Markdown save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | Raised if the specified path is not a valid local file path. |
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class MarkdownSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(Url, MarkdownSaveOptions, CancellationToken)
Asynchronously saves the document to local file specified by url. All resources used in this document will be saved in to adjacent folder, whose name will be constructed as: output_file_name + “_files”.
public Task SaveAsync(Url url, MarkdownSaveOptions saveOptions, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| url | Url | Local URL to output file. |
| saveOptions | MarkdownSaveOptions | Markdown save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | Raised if the specified url is not a valid local file URL. |
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class Url
- class MarkdownSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(ResourceHandler, MarkdownSaveOptions, CancellationToken)
Asynchronously saves the document content and resources using the ResourceHandler.
public Task SaveAsync(ResourceHandler resourceHandler, MarkdownSaveOptions saveOptions,
CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| resourceHandler | ResourceHandler | The resource handler ResourceHandler. Its HandleResourceAsync method is used. |
| saveOptions | MarkdownSaveOptions | Markdown save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class ResourceHandler
- class MarkdownSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(string, MHTMLSaveOptions, CancellationToken)
Asynchronously saves the document to local file specified by path. All resources used in this document will be saved in to adjacent folder, whose name will be constructed as: output_file_name + “_files”.
public Task SaveAsync(string path, MHTMLSaveOptions saveOptions,
CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| path | String | Local path to output file. |
| saveOptions | MHTMLSaveOptions | MHTML save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | Raised if the specified path is not a valid local file path. |
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class MHTMLSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(Url, MHTMLSaveOptions, CancellationToken)
Asynchronously saves the document to local file specified by url. All resources used in this document will be saved in to adjacent folder, whose name will be constructed as: output_file_name + “_files”.
public Task SaveAsync(Url url, MHTMLSaveOptions saveOptions, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| url | Url | Local URL to output file. |
| saveOptions | MHTMLSaveOptions | MHTML save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | Raised if the specified url is not a valid local file URL. |
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class Url
- class MHTMLSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML
SaveAsync(ResourceHandler, MHTMLSaveOptions, CancellationToken)
Asynchronously saves the document content and resources using the ResourceHandler.
public Task SaveAsync(ResourceHandler resourceHandler, MHTMLSaveOptions saveOptions,
CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| resourceHandler | ResourceHandler | The resource handler ResourceHandler. Its HandleResourceAsync method is used. |
| saveOptions | MHTMLSaveOptions | MHTML save options. |
| cancellationToken | CancellationToken | The cancellation token. |
Return Value
A task that represents the asynchronous operation.
Exceptions
| exception | condition |
|---|---|
| OperationCanceledException | Operation was cancelled. |
Remarks
The method returns at once: the document is serialized on the thread pool and the output is written asynchronously. Resources that were not loaded with the document are downloaded during serialization, one after another unless MaxConcurrentRequests is greater than 1.
See Also
- class ResourceHandler
- class MHTMLSaveOptions
- class HTMLDocument
- namespace Aspose.Html
- assembly Aspose.HTML