GroupDocs.Translation Cloud is a simple SDK used to add translation of Microsoft Word documents, Microsoft Excel workbooks, Microsoft PowerPoint presentations, Adobe PDF documents, Markdown files, OpeDocument files, ResX files, SRT files, text files and plain text to your app with merely a few lines of code. In detail, it's a set of SDKs for document and plain text translation in our Cloud. It supports translaton of .doc, .docx, .docm, .xls, .xlsx, .xlsm, .ppt, .pptx, .pptm, .pdf, .md, .odt, .ods, .odp, .csv, .tsv, .rtf, .txt, .resx, .srt files. Just pass a specific file or text to the GroupDocs.Translation Cloud API, and it will translate to one or several languages and save translated files in our Cloud or will return translated texts.
Install
| Product | Versions |
|---|---|
| .NET Standard |
README
GroupDocs.Translation.Cloud.Sdk (.NET)
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- API version: 24.3.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit https://products.groupdocs.cloud/translation/
Frameworks supported
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
Dependencies
- RestSharp - 106.13.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
Installation
Generate the DLL using your preferred tool (e.g. dotnet build)
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using GroupDocs.Translation.Cloud.Sdk.Api;
using GroupDocs.Translation.Cloud.Sdk.Client;
using GroupDocs.Translation.Cloud.Sdk.Model;
Usage
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
Getting Started
using System.Collections.Generic;
using System.Diagnostics;
using GroupDocs.Translation.Cloud.Sdk.Api;
using GroupDocs.Translation.Cloud.Sdk.Client;
using GroupDocs.Translation.Cloud.Sdk.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.groupdocs.cloud/v2.0/translation";
// Configure OAuth2 ClientId and ClientSecret: JWT
config.OAuthClientId = "YOU_CLIENT_ID";
config.OAuthClientSecret = "YOU_CLIENT_SECRET";
config.OAuthFlow = OAuthFlow.APPLICATION;
var apiInstance = new FileApi(config);
var format = "Unknown"; // string | (optional)
var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | (optional)
try
{
string result = apiInstance.FileUploadPost(format, file);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FileApi.FileUploadPost: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Documentation for API Endpoints
All URIs are relative to https://api.groupdocs.cloud/v2.0/translation
| Class | Method | HTTP request | Description |
|---|---|---|---|
| FileApi | FileUploadPost | POST /file/upload | |
| SwaggerApi | SwaggerSpecGet | GET /swagger/spec | |
| TranslationApi | AutoPost | POST /auto | Translate any supported file |
| TranslationApi | CsvPost | POST /csv | Translate CSV and TSV files |
| TranslationApi | DocumentPost | POST /document | Translate Microsoft Word documents, rtf, txt, odt |
| TranslationApi | DocumentRequestIdGet | GET /document/{requestId} | Return document translation status. Also return URLs for downloading of translated document if translation was successful |
| TranslationApi | DocumentTrialGet | GET /document/trial | Return document translation status for trial request. Also return URLs for downloading of translated document if translation was successful |
| TranslationApi | DocumentTrialPost | POST /document/trial | Trial translate Microsoft Word documents, rtf, txt, odt without conversation. Translate only first page or 1000 symbols. |
| TranslationApi | HcGet | GET /hc | Health check for all services. |
| TranslationApi | HtmlPost | POST /html | Translate HTML files |
| TranslationApi | HugoGet | GET /hugo | Get hugo syntax structure from markdown file |
| TranslationApi | HugoPost | POST /hugo | Run hugo syntax structure analyzing from markdown file |
| TranslationApi | ImageToFilePost | POST /image-to-file | Translate image or scanned pdf and return file |
| TranslationApi | ImageToTextPost | POST /image-to-text | Translate text on image or scanned pdf |
| TranslationApi | LanguagesGet | GET /languages | Return list of available language pairs |
| TranslationApi | MarkdownPost | POST /markdown | Translate Markdown files |
| TranslationApi | PdfPost | POST /pdf | Translate pdf files |
| TranslationApi | PdfTrialPost | POST /pdf/trial | Trial pdf translation. Translate only first page without conversion to another format. |
| TranslationApi | PresentationPost | POST /presentation | Translate Microsoft PowerPoint presentations, odp |
| TranslationApi | ResxPost | POST /resx | Translate Resx files |
| TranslationApi | SpreadsheetPost | POST /spreadsheet | Translate Microsoft Excel workbooks, ods |
| TranslationApi | SrtPost | POST /srt | Translate Srt files |
| TranslationApi | TextPost | POST /text | Translate text |
| TranslationApi | TextRequestIdGet | GET /text/{requestId} | Return text translation status. Also return translated text if translation was successful |
| TranslationApi | TextTrialGet | GET /text/trial | Return text translation status for trial requests. Also return translated text if translation was successful |
| TranslationApi | TextTrialPost | POST /text/trial | Trial translate text. Translate only 1000 symbols. |
Documentation for Models
- Model.CloudFileRequest
- Model.CloudFileResponse
- Model.CloudFileResponseWithAdditionalInfo
- Model.CloudHugoResponse
- Model.CloudTextResponse
- Model.CsvFileRequest
- Model.FileRequest
- Model.HealthCheckEntity
- Model.HealthCheckStatus
- Model.HtmlFileRequest
- Model.HttpStatusCode
- Model.HugoRequest
- Model.ImageToFileRequest
- Model.ImageToTextRequest
- Model.LanguagePairData
- Model.MarkdownFileRequest
- Model.PdfFileRequest
- Model.PresentationFileRequest
- Model.SpreadsheetFileRequest
- Model.SrtFileRequest
- Model.StatusResponse
- Model.StringStringTuple
- Model.TextDocumentFileRequest
- Model.TextRequest
- Model.UrlFileInfo
- Model.WorksheetData
Documentation for Authorization
JWT
- Type: OAuth
- Flow: application
- Authorization URL: https://id.groupdocs.cloud/
- Scopes: N/A
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.