zyddnys / manga-image-translator

Translate manga/image 一键翻译各类图片内文字 https://cotrans.touhou.ai/
https://cotrans.touhou.ai/
GNU General Public License v3.0
4.65k stars 476 forks source link

PDF Document translation #411

Open freetosmash opened 1 year ago

freetosmash commented 1 year ago

What would your feature do?

I would like to inquire if there is a feature available for translating the entire PDF document. I have some Japanese vertical format books that I find difficult to read, and I am searching for relevant tools. I feel that your tool might be able to assist me, but I am unsure if it can translate the entire book. Thank you.

tak2hu commented 1 year ago

For extracting text from PDFs, you might want to look at doctr and for translation, you can check the translation backends this project uses

JustFrederik commented 1 year ago

@tak2hu the image is rasterized and turned into pixels. What’s needed to fix that is create an overlay and lay it over the original pdf.

so preprocess the pdf into multiple pngs and just output as pdf. I tried it with my pdf renderer and no background and overlayed the images manually. It works so it could be added to #395