forked from LeoFCardoso/pdf2pdfocr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_windows.txt
48 lines (40 loc) · 2.05 KB
/
install_windows.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
rem Install the great scoop windows package manager!
rem https://scoop.sh
rem https://github.com/lukesampson/scoop/wiki
rem --> Open new command prompt
rem --> Please adjust to your arch (32 or 64 bit)
rem ---------------
scoop install --arch 64bit aria2 git
scoop install --arch 64bit file ghostscript imagemagick poppler tesseract python qpdf
rem --> Open new command prompt to refresh environment variables
rem ---------------
rem Language data files can be downloaded from https://github.com/tesseract-ocr/tessdata
rem Example Portuguese (POR) and Spanhish (SPA) - Tesseract branch 4.00
rem ---------------
aria2c "https://github.com/tesseract-ocr/tessdata/raw/master/por.traineddata" --dir="%TESSDATA_PREFIX%"
aria2c "https://github.com/tesseract-ocr/tessdata/raw/master/spa.traineddata" --dir="%TESSDATA_PREFIX%"
rem Complete python with VENV and required libs
rem (GUI maybe need Visual C++ for Visual Studio 2015 Runtime - https://www.microsoft.com/en-US/download/details.aspx?id=48145)
rem ---------------
pip install virtualenv
virtualenv --clear --download --always-copy "%USERPROFILE%\pdf2pdfocr-venv"
cd "%USERPROFILE%\pdf2pdfocr-venv"
.\Scripts\activate.bat
python -m pip install --upgrade pip
pip install reportlab Gooey
pip install https://github.com/mstamy2/PyPDF2/archive/master.zip
rem TODO - add cuneiform command line on windows
rem Optional dependencies for cuneiform OCR engine
rem ---------------
pip install lxml beautifulsoup4
rem Install PDF2PDFOCR and VBS extension (SendTo)
rem ---------------
aria2c "https://github.com/LeoFCardoso/pdf2pdfocr/archive/master.zip" --dir="%TEMP%" --out="pdf2pdfocr.zip"
7z x %TEMP%\pdf2pdfocr.zip -o%USERPROFILE%
del %TEMP%\pdf2pdfocr.zip
move /Y "%USERPROFILE%\pdf2pdfocr-master" "%USERPROFILE%\pdf2pdfocr-venv"
move /Y "%USERPROFILE%\pdf2pdfocr-venv\pdf2pdfocr-master\pdf2pdfocr.vbs" "%APPDATA%\Microsoft\Windows\SendTo\"
rem Copy script to "scripts" inside python VENV
rem ---------------
set PYTHON_PREFIX="%USERPROFILE%\pdf2pdfocr-venv"
move /Y "%USERPROFILE%\pdf2pdfocr-venv\pdf2pdfocr-master\*.py" "%PYTHON_PREFIX%\Scripts"