Azure translator - Save translated PDF files as MS Word docx files

otuoma Sanya 96 Reputation points
2021-08-09T18:46:23.063+00:00

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,
        }
Azure AI Translator
Azure AI Translator
An Azure service to easily conduct machine translation with a simple REST API call.
488 questions
{count} votes

Accepted answer
  1. otuoma Sanya 96 Reputation points
    2021-08-10T15:17:22.49+00:00

    This app written in C# appears to save translated documents in word format

    https://github.com/MicrosoftTranslator/DocumentTranslator


0 additional answers

Sort by: Most helpful

Your answer

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