Azure Translator Synchronous Document Translation API Rejecting All PDF Documents

Michael 0 Reputation points
2024-04-29T21:16:42.4466667+00:00

I am using the synchronous document translation API as instructed here: https://video2.skills-academy.com/en-us/azure/ai-services/translator/document-translation/reference/synchronous-rest-api-guide

I can translate other types of documents using CURL, but when I submit a PDF document I always get a 400 error with the response {"code":"InvalidFormat","message":"The format parameter is not valid."}. This applies to all PDF documents. This is the command that I am used (API key omitted):

curl -i -X POST "https://eelec-translation-uswest.cognitiveservices.azure.com/translator/document:translate?sourceLanguage=en&targetLanguage=hi&api-version=2023-11-01-preview" -H "Ocp-Apim-Subscription-Key:<omitted>" -H "X-ClientTraceId:pdf-translation-issue-b4e3ae21" -F "document=@blank.pdf;type=application/pdf" -o "out.pdf"

And the response:

HTTP/2 400 
content-type: application/json; charset=utf-8
access-control-expose-headers: X-RequestId,x-ms-request-id,X-RequestId-Forwarded,X-Metered-Usage
x-requestid: 944d44da-dfca-4ed3-9a93-11a68fd787f5
x-ms-request-id: 944d44da-dfca-4ed3-9a93-11a68fd787f5
x-ms-error-code: InvalidRequest
strict-transport-security: max-age=31536000; includeSubDomains; preload
apim-request-id: 944d44da-dfca-4ed3-9a93-11a68fd787f5
x-content-type-options: nosniff
x-ms-region: West US
date: Mon, 29 Apr 2024 04:38:09 GMT
{"error":{"code":"InvalidRequest","message":"The format parameter is not valid.","target":"ContentType","innerError":{"code":"InvalidFormat","message":"The format parameter is not valid."}}}

The problem was also reported by another user a month ago: https://video2.skills-academy.com/en-us/answers/questions/1600851/pdf-document-translation-error?comment=question#comment-1531717

I have tried with various PDF documents and various source and target languages. PDF translation appears to be completely broken using this API.

I cannot submit a support ticket because I do not have the premium CS plan, and I refuse to pay money for the privilege to report that the API is broken.

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

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 15,836 Reputation points
    2024-04-29T22:14:27.5733333+00:00

    Hello @Michael , Thanks for using Microsoft Q&A Platform.

    Looks like PDF is not a supported document format. Please refer to this Synchronous supported document formats: https://video2.skills-academy.com/en-us/azure/ai-services/translator/document-translation/overview#synchronous-supported-document-formats

    Please allow sometime will check internally and update if there is an ETA on this support.

    I hope this helps.

    Regards,

    Vasavi

    1 person found this answer helpful.