IAIDocProcessingService.ProofreadAsync(Presentation, CultureInfo, CancellationToken) Method
Reviews the text for spelling, grammar, punctuation, and style errors.
Namespace: DevExpress.AIIntegration.Docs
Assembly: DevExpress.AIIntegration.Docs.v25.2.dll
NuGet Package: DevExpress.AIIntegration.Docs
Declaration
Task ProofreadAsync(
Presentation presentation,
CultureInfo culture,
CancellationToken cancellationToken = default(CancellationToken)
)
Parameters
| Name | Type | Description |
|---|---|---|
| presentation | Presentation | The |
| culture | CultureInfo | An object that specifies culture settings applied during proofreading. |
Optional Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| cancellationToken | CancellationToken | null | The token that cancels the task. |
Returns
| Type | Description |
|---|---|
| Task | The response that contains AI-generated text. |
Example
How to: Proofread a Presentation
The following code snippet proofreads an entire presentation. Code to proofread only the second slide is included as commented code.
using DevExpress.AIIntegration;
using DevExpress.AIIntegration.Docs;
using DevExpress.Docs.Presentation;
var docProcessingService = defaultAIExtensionsContainer.CreateAIDocProcessingService();
using (var presentation = new Presentation(File.ReadAllBytes("Documents/Presentation.pptx")))
{
// Proofread entire document (culture en-US)
await docProcessingService.ProofreadAsync(presentation, new System.Globalization.CultureInfo("en-US"));
// Proofread a single slide (e.g., slide 2)
// Slide slide = presentation.Slides[1];
// await docProcessingService.ProofreadAsync(slide, new System.Globalization.CultureInfo("en-US"));
// Prepare output directory & file path
string targetDir = @"C:\Test Documents";
Directory.CreateDirectory(targetDir); // Safe if already exists
string outputPath = Path.Combine(targetDir, "Proofread.pptx");
// Save the proofread presentation
using (FileStream outputStream = new FileStream(outputPath, FileMode.Create, FileAccess.Write))
{
presentation.SaveDocument(outputStream, DocumentFormat.Pptx);
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ProofreadAsync(Presentation, CultureInfo, CancellationToken) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.