Doc Translate
Given a PDF, this API helps to translate the content in the document
Headers
Your unique subscription key for authenticating requests to the Sarvam AI Speech-to-Text API. " "Here are the steps to get your api key", example="dxxxxxx-bxxx-4xxx-axxx-cxxxxxxxxxxx
Body
Upload he PDF file you want to translate. This should be uploaded as a form input if you're using multipart/form-data.Note:- TranslatePDF supports only digital PDFs with selectable text for translation; scanned PDFs cannot be processed.
The page number you want to translate. Use a one-based index (e.g., 1 for the first page). You can send an empty value if you want to translate the entire document.
A dictionary of words for which you want to hardcode the translation. A list of words that you want to translate in a specific way. When these words appear in the document, the system will use your custom translation instead of automatic translation.If you add a dictionary with {"Hello": "नमस्कार"}, every time the word "नमस्कार" appears in the document, it will be translated as "नमस्कार" instead of the usual translation.
"{\"Hello\": \"नमस्कार\"}"
The language code of the input PDF. If you don’t specify, the system will try to detect it automatically.Note:-TranslatePDF currently supports only English language PDFs for translation.
The language code of the output text. This specifies the target language for translation. Available options: hi = "hi-IN" bn = "bn-IN" gu = "gu-IN" kn = "kn-IN" ml = "ml-IN" mr = "mr-IN" od = "od-IN" pa = "pa-IN" ta = "ta-IN" te = "te-IN" Example: "hi-IN" for Hindi
hi-IN
, bn-IN
, kn-IN
, ml-IN
, mr-IN
, od-IN
, pa-IN
, ta-IN
, te-IN
, en-IN
, gu-IN
Response
The translated PDF document in base64 encoding.