I’m afraid Aspose.Words and any Aspose component in general does not provide this functionality.
However you may be able to use a different component inconjunction with Aspose.Words to achieve what you need. For example, please see the code below which uses the GoogleTranslateAPI to translate the document from English to German. Please note that I believe that the GoogleTranslateAPI may now require some sort of licensing in order to use.
Document doc = new Document("Rendering.doc");
TranslateClient client = new TranslateClient("Test Translation");
// Translate each paragraph in the document.
foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))
{
string translatedText = string.Empty;
try
{
string paragraphText = para.Range.Text.Trim();
// Translate the paragraph text using Google Translate API. In this case from English to German.
translatedText = client.Translate(paragraphText, Language.English, Language.German);
// Replace the original text with the translation.
if (!string.IsNullOrEmpty(paragraphText))
para.Range.Replace(paragraphText, translatedText, false, false);
}
catch (Exception e)
{
// Skip any paragraphs which cause an exception, most likely caused by AW encountereing string with a special char. Decide how to handle other exceptions here too.
}
}
doc.Save("Document Translated.doc");
@tudou123, Aspose.Words for Java API is very close to Aspose.Words for .NET API. It is not hard to translate the code above to Java. Please refer to our Java documentation for the classes and methods used in the example:
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.