Convert PDF to image file.
$ sudo apt-get install imagemagick
Open the policy.xml file in terminal by entering this command -
sudo nano /etc/ImageMagick-6/policy.xmlNow, directly edit the file in terminal, find
<policy domain="coder" rights="none" pattern="PDF" />and replacenonewithread|writeas shown in the picture. Then press Ctrl+X to exit.
On Mac:
https://chuhw.pixnet.net/blog/post/229327724-%E5%9C%A8-mac-%E5%A6%82%E4%BD%95%E5%BF%AB%E9%80%9F%E5%9C%B0%E5%B0%87-pdf-%E6%89%80%E6%9C%89%E9%A0%81%E9%9D%A2%E8%BD%89%E6%88%90-jpg-%E6%88%96%E6%98%AF
Install OCR
$ sudo apt-get install tesseract-ocr-chi-sim
Run OCR
for i in `ls`; do echo tesseract $i $(basename $i .jpeg) -l chi_sim ; done
Convert Simplified to Traditional Chinese
$ sudo apt-get install opencc
for i in `ls *.txt` ; do opencc -i $i > ../CHM-TW/$i ; done
沒有留言:
張貼留言