Translate a PDF file
Today, at Ubuntu Life I found a post (in English) with a 60-page long PDF manual that contains Ubuntu tips. I downloaded it naively but it was in Spanish! :)) Great! I don’t speak Spanish… What to do? How to translate a PDF file?
Well, my solution is not an elegant one. I would say that it falls in the category “better than nothing”.
- Get the PDF.
- Extract the text from it with “pdftotext file.pdf file.txt”.
- Make an HTML out of file.txt: rename it to file.html, and add the header <pre> as the first line and the footer </pre> as the last line.
- Upload the file to a public place. Easiest way: put in your Dropbox/Public folder.
- Translate the public HTML file with Google Translate.
- If Google Translate doesn’t translate the whole text, then it’s too long. Cut it into several pieces.
The end result is an ugly text file, but at least you can have an idea what it’s about.
If you have a more sophisticated solution, don’t hold it back.