An Azure service to easily conduct machine translation with a simple REST API call.
PDF is supported for Document Translation, including API version families documented for Document Translation. For batch translation, pdf is a supported document format. For synchronous document translation, the service supports translating a single file and returning the translated file in the response.
The error shown points to the uploaded document format/content type being rejected:
"target":"ContentType" with InvalidFormat
For PDF-specific checks:
- Confirm the file is a real PDF and not encrypted or password-protected. Password-protected or encrypted documents aren’t supported.
- If the PDF is scanned, PDF translation is supported, but output quality and layout retention can vary. Native PDFs provide the best results.
- If the PDF contains both digital and scanned elements, only the digital portions are translated. To translate the full document, convert it into a fully scanned format before submission.
- If the document has visible watermarks or seals, translation can fail or be partial.
- If the PDF is very large or complex, split it into smaller sections and test again.
The cURL example for synchronous document translation shows the document part should include an explicit content type. For example, the documented pattern is:
-F "document=@{path-to-your-document-with-file-extension};type={ContentType}/{file-extension}"
For a PDF request, the first thing to verify is that the multipart form part for document includes the correct PDF content type instead of sending only @demo.pdf.
Also verify the endpoint type being called. The documented synchronous API for document translation is the Document Translation endpoint pattern:
POST .../translator/document:translate?...
If the issue persists, use the supported-formats API to confirm what the service reports for the endpoint and API version being used. The supported formats method returns the list of supported document formats and requires the custom domain endpoint for Document Translation.
Because other file types succeed and the failure is specifically ContentType/InvalidFormat, the most likely issue in this request is the PDF upload format metadata rather than PDF support being unavailable.
References: