AIDocProcessingService.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
public Task ProofreadAsync(
Presentation presentation,
CultureInfo culture,
CancellationToken cancellationToken = default(CancellationToken)
)
Parameters
| Name | Type | Description |
|---|---|---|
| presentation | Presentation | The presentation instance which text should be reviewed. |
| 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);
}
}
See Also