Back to Devexpress

IAIDocProcessingService.TranslateAsync(PdfDocumentProcessor, CultureInfo, CancellationToken) Method

officefileapi-devexpress-dot-aiintegration-dot-docs-dot-iaidocprocessingservice-dot-translateasync-x28-devexpress-dot-pdf-dot-pdfdocumentprocessor-system-dot-globalization-dot-cultureinfo-system-dot-threading-dot-cancellationtoken-x29.md

latest3.4 KB
Original Source

IAIDocProcessingService.TranslateAsync(PdfDocumentProcessor, CultureInfo, CancellationToken) Method

Translates content into a specific language with AI-powered translation services.

Namespace : DevExpress.AIIntegration.Docs

Assembly : DevExpress.AIIntegration.Docs.v25.2.dll

NuGet Package : DevExpress.AIIntegration.Docs

Declaration

csharp
Task<string> TranslateAsync(
    PdfDocumentProcessor processor,
    CultureInfo culture,
    CancellationToken cancellationToken = default(CancellationToken)
)
vb
Function TranslateAsync(
    processor As PdfDocumentProcessor,
    culture As CultureInfo,
    cancellationToken As CancellationToken = Nothing
) As Task(Of String)

Parameters

NameTypeDescription
processorPdfDocumentProcessor

The PdfDocumentProcessor instance which content should be translated.

| | culture | CultureInfo |

An object that specifies culture settings applied during translation.

|

Optional Parameters

NameTypeDefaultDescription
cancellationTokenCancellationTokennull

The token that cancels the task.

|

Returns

TypeDescription
Task<String>

The response that contains AI-generated translation.’

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TranslateAsync(PdfDocumentProcessor, 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.

office-file-api-ai-implementation/CS/Controllers/TranslateController.cs#L126

csharp
case PdfPart.WholeDocument:
    translation = await docProcessingService.TranslateAsync(pdfDocumentProcessor, language);
    break;

See Also

IAIDocProcessingService Interface

IAIDocProcessingService Members

DevExpress.AIIntegration.Docs Namespace