Synchronous document translation rejects any RTF snd DOC

Aleksandar Kostadinov 0 Reputation points
2025-12-02T17:21:37.41+00:00

Hi, trying to translate an RTF document fails. I think the issue is in the synchronous translator with any RTF. I'm wondering - nobody translating RTFs? I tried with 2 RTFs, one of which I created new just for the test. Not allowed to attach it here but I uploaded it to [1], will be there for 7 days.

My file is:

echo '{\rtf1\ansi\deff0 {\fonttbl {\f0 Times New Roman;}} Hello world}' > /tmp/ttt. rtf

My request is:

curl -v -o /tmp/ttt.translated.rtf -X POST "https://yoga-translator.cognitiveservice s.azure.com/translator/document:translate?sourceLanguage=en&targetLanguage=bg&api-version=2024-05-01" -H "Ocp- Apim-Subscription-Key: [REDACTED]" - F 'document=@"/tmp/ttt.rtf";type=application/rtf;filename=document.rtf'

I get back HTTP 400 and the content of /tmp/ttt.translated.rtf is:

{"error":{"code":"InvalidRequest","message":"The format parameter is not valid.","target":"ContentType","inner Error":{"code":"InvalidFormat","message":"The format parameter is not valid."}}}

Whether I specify type or not with curl doesn't matter. I always get the same when I submit an RTF file. I successfully translated only a sample text/plain document but only succeeded when file extension was .txt. When `filename`` had no extension, everything else equal, I've got the same error as with the RTF. That's why I'm thinking that whatever auto-detection is going on is broken over there. With a confusing error message on top of it.

I hope some support person can chime in because I can't file a support case. I'm not paying $29 for the privilege to be a qe tester. I'd rather go to a different provider as I'm just kicking the tires of azure translate.

P.S. I verified that the translator does support RTF with the application/rtf mime type using some endpoint /translator/text/batch/v1.0/documents/formats

Update: it also rejects any .doc files but works with .docx

[1] https://limewire.com/d/jkv1f#Sm9q9ncgc0

Azure AI Translator
Azure AI Translator
An Azure service to easily conduct machine translation with a simple REST API call.
{count} votes

1 answer

Sort by: Most helpful
  1. Aryan Parashar 3,380 Reputation points Microsoft External Staff Moderator
    2025-12-03T10:21:00.94+00:00

    Hi Aleksandar Kostadinov,

    I understand how this issue can be frustrating, especially when the format appears valid.

    As you are using the synchronous translator, it does not officially support .rtf.

    It supports the following document formats: .txt, .txv, .tab, .csv, .html, .htm, .mhtml, .mht, .pptx, .xlsx, .docx, .msg, .xlf, .xliff.

    It supports the following glossary formats: .csv, .xlf, .xliff, .tsv, .tab.

    Here is supported documentation: https://learn.microsoft.com/en-us/azure/ai-services/translator/document-translation/overview#synchronous-supported-document-formats

    Please accept this as an answer.
    User's image

    Thank you for reaching out to The Microsoft Q&A Portal

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.