A
A
Alexander Tsymbal2019-11-12 12:20:02
HTML
Alexander Tsymbal, 2019-11-12 12:20:02

Converter html->pdf + google translator = real?

Good afternoon toasters.
An interesting task arose here: to create PDF documents from HTML pages with translation into different languages ​​on the fly.
More:
There is html-code (simple text markup) ready to be generated in PDF. The tool for converting to PDF is dompdf, I have been using it for a long time, it fits perfectly. Click on the "Download PDF" button - dompdf takes the markup, generates and sends a pdf file for download.
Is it possible to somehow put the Google Translate API (or any other worthy translator) into this chain? So that before clicking on the "Download PDF" button, you can select the desired language and our html code is first run through the translator, and then given to dompdf.
The main catch is that the documents can be long: 25+ pages.https://translate.googleapis.com/translate_a/singl... doesn't do the job. Especially if the text is mixed with html markup.
Maybe some of you have faced similar tasks and share your personal experience? Any thoughts and considerations welcome

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mors Clamor, 2019-11-12
@66demon666

So what about extracting text from markup? Well, it seems like how to store it in the database and already translate it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question