mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.18k stars 9.95k forks source link

[Feature]: Translate PDFs like Firefox does for Web sites #18391

Open paulmenzel opened 3 months ago

paulmenzel commented 3 months ago

Is the feature relevant to the Firefox PDF Viewer?

Yes

Feature description

It’d be great, if PDF documents could be translated like Web sites can be translated now in Firefox.

Other PDF viewers

Evince does not support this. No idea about other viewers.

marco-c commented 3 months ago

This would be an interesting feature, but it is really hard to implement because it requires relaying out the contents of the PDF (as the translated text will have completely different size than the original text). The implementation is kind of similar to what would be required for https://connect.mozilla.org/t5/ideas/reader-mode-for-pdf-files/idi-p/9908.

Starting from Firefox 128, we will support select translation though, so you can at least select specific sentences or paragraphs in PDFs and translate them!