## DocumentSavingArgs class

An argument passed into [`Notify`](../idocumentsavingcallback/notify/).

To learn more, visit the [Save a Document](https://docs.aspose.com/words/net/save-a-document/) documentation article.

```csharp
public sealed class DocumentSavingArgs
```

## Properties

| Name | Description |
| --- | --- |
| [EstimatedProgress](../../aspose.words.saving/documentsavingargs/estimatedprogress/) { get; } | Overall estimated percentage progress. |

## Examples

Shows how to manage a document while saving to html.

```csharp
Document doc = new Document(MyDir + "Big document.docx");

// Following formats are supported: Html, Mhtml, Epub.
HtmlSaveOptions saveOptions = new HtmlSaveOptions(saveFormat)
{
    ProgressCallback = new SavingProgressCallback()
};

OperationCanceledException exception = Assert.Throws<OperationCanceledException>(() =>
    doc.Save(ArtifactsDir + $"HtmlSaveOptions.ProgressCallback.{ext}", saveOptions));

Assert.That(exception != null ? exception.Message.Contains("EstimatedProgress") : (bool?)null, Is.True);
```

Shows how to manage a document while saving to html (SavingProgressCallback).

```csharp
/// <summary>
/// Saving progress callback. Cancel a document saving after the "MaxDuration" seconds.
/// </summary>
public class SavingProgressCallback : IDocumentSavingCallback
{
    /// <summary>
    /// Ctr.
    /// </summary>
    public SavingProgressCallback()
    {
        mSavingStartedAt = DateTime.Now;
    }

    /// <summary>
    /// Callback method which called during document saving.
    /// </summary>
    /// <param name="args">Saving arguments.</param>
    public void Notify(DocumentSavingArgs args)
    {
        DateTime canceledAt = DateTime.Now;
        double ellapsedSeconds = (canceledAt - mSavingStartedAt).TotalSeconds;
        if (ellapsedSeconds > MaxDuration)
            throw new OperationCanceledException($"EstimatedProgress = {args.EstimatedProgress}; CanceledAt = {canceledAt}");
    }

    /// <summary>
    /// Date and time when document saving is started.
    /// </summary>
    private readonly DateTime mSavingStartedAt;

    /// <summary>
    /// Maximum allowed duration in sec.
    /// </summary>
    private const double MaxDuration = 0.1d;
}
```

### See Also

* namespace [Aspose.Words.Saving](../../aspose.words.saving/)
* assembly [Aspose.Words](../../)
