You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
var options = new DocumentTranslateOptions();
options.OutputFormat = "docx";
Expected behavior
DocumentTranslateOptions have an OutputFormat parameter, I can set it to "docx" to change PDF to Word during translation.
Screenshots or sample code
Expected final code:
var translator = new Translator(ServiceApiKey);
var options = new DocumentTranslateOptions();
options.OutputFormat = "docx";
var handle = await translator.TranslateDocumentUploadAsync(filepath, sourceLanguage, targetLanguage, options);
Files to change:
DeepL/DocumentTranslateOptions.cs
/// <summary>File extension of desired format of translated file, for example: docx.</summary>
/// If unspecified, by default the translated file will be in the same format as the input file.
public string? OutputFormat { get; set; }
DeepL/Translator.cs
/// <inheritdoc />
public async Task<DocumentHandle> TranslateDocumentUploadAsync(
Stream inputFile,
string inputFileName,
string? sourceLanguageCode,
string targetLanguageCode,
DocumentTranslateOptions? options = null,
CancellationToken cancellationToken = default) {
var bodyParams = CreateCommonHttpParams(
sourceLanguageCode,
targetLanguageCode,
options?.Formality,
options?.GlossaryId);
if (options?.OutputFormat != null) {
bodyParams.Add(("output_format", options.OutputFormat));
}
using var responseMessage =
(...)
The text was updated successfully, but these errors were encountered:
Describe the bug
The new version of the API https://www.deepl.com/cs/docs-api/documents/translate-document includes support for the optional output_format parameter, but there is no implementation in deepl-dotnet.
To Reproduce
var options = new DocumentTranslateOptions();
options.OutputFormat = "docx";
Expected behavior
DocumentTranslateOptions have an OutputFormat parameter, I can set it to "docx" to change PDF to Word during translation.
Screenshots or sample code
Expected final code:
Files to change:
DeepL/DocumentTranslateOptions.cs
DeepL/Translator.cs
The text was updated successfully, but these errors were encountered: