This app written in C# appears to save translated documents in word format
Azure translator - Save translated PDF files as MS Word docx files
I am translating a bunch of PDF files using Azure document translation. I am using python with Django framework and the translation is working as expected. I have a source container to which I upload blobs then another target container within which translated files are saved.
My problem is that I need to make some changes to the translated files, yet the document translator retains the files in PDF format. I know I can use other tools to further convert the PDFs to MS Word, but is it possible to transform the PDF to MS Word within Azure Translation AI? I am still going through the documentation but I will appreciate a quick link to what I am looking for, if it exists.
A section of my code is shown below
def get(self, request, *args, **kwargs):
subscription_key = settings.AZURE_SUBSCRIPTION_KEY
endpoint = settings.AZURE_DOCUMENT_TRANSLATION_ENDPOINT
sourceUrl = settings.AZURE_SOURCE_SAS_URL
targetUrl = settings.AZURE_TARGET_SAS_URL
client = DocumentTranslationClient(endpoint, AzureKeyCredential(subscription_key))
poller = client.begin_translation(sourceUrl, targetUrl, "ar")
result = poller.result()
return {
'status': poller.status(),
'created': poller.details.created_on,
'last_updated': poller.details.last_updated_on,
'total_documents': poller.details.documents_total_count,
'total_failed': poller.details.documents_failed_count,
'total_succeeded': poller.details.documents_succeeded_count,
}