Can't find any example to translate a pdf with the php api

138 views
Skip to first unread message

Greg Link

unread,
May 31, 2022, 12:57:31 PM5/31/22
to Google Cloud Translation API
I saw that Google API can translate a document (like a pdf) but I can't find how to do it.
I tried to understand the sources but it out of my knowledges.
Can someone help ?

Thanks

Jose Gutierrez Paliza

unread,
Jun 1, 2022, 6:08:13 PM6/1/22
to Google Cloud Translation API

There is a php library[1], you’ll probably need to use the advanced library[2].
You can see here that in fact there are ways to translate the PDF file[3]. Google uses these examples because works faster and more efficiently with this language libraries.

You could link the PDF’s to:

http://translate.google.com/translate?hl=fr&sl=auto&tl=en&u=http://www.example.com/PDF.pdf

Using the following parameters:
hl -> Original Language.
tl -> Translate Language.
u -> PDF URL 


[1]https://cloud.google.com/translate/docs/reference/libraries/v3/php 
[2]https://github.com/googleapis/google-cloud-php-translate 
[3]https://cloud.google.com/translate/docs/advanced/translate-documents

Reply all
Reply to author
Forward
0 new messages