Recently wrote a thing need to convert the PDF into a picture and then put on the page to show, found a very useful wheel called pymupdf, testing on Windows 666, when installed on the Ubuntu on the dependency on the face of a crazy. The instructions on GitHub are not very detailed. Study half the morning also did not fix, the afternoon played a mahjong eat a grilled fish, come back to change a train of thought is quite quick to fix.
Pre-work
Apt-get Upgrade
Update Mupdf
Install mupdf
GitHub says Ubuntu Mupdf are generally not available and need to compile and install themselves. Test found no.
Installation dependencies
Install fitzapt Install libjbig2dec-devaptinstall libjpeg-devaptInstall libfreetype6-devaptInstall Libopenjpeg-dev
The above corresponds to the jbig2dec,jpeg,freetype,openjp2 of Fitz and dependencies.
Modify the setup.py script
git clone-b <correct branch> https://github.com/rk700/pymupdf.git
<correct branch> I filled the 1.11.0
Then the setup.py will be in
libraries=[ 'mupdf', 'Crypto',#OpenSSL is required by mupdf on ArchLinux 'Jbig2dec','OPENJP2','JPEG','FreeType', 'Mupdfthird', ], #The libraries to link with
Switch
libraries=[ 'mupdf', #' Crypto ', #openssl is required by mupdf on ArchLinux 'Jbig2dec','Openjpeg','JPEG','FreeType', 'Mupdfthird', ], #The libraries to link with
That is, delete the crypto and change the OPENJP2 to Openjpeg
Build&setup
Perform
Python setup.py Build
No error, then execute
python setup.py installcd. PythonImport Fitz
Be sure to switch directories to switch directories Be sure to switch directories, or import will fail
Ubuntu14.04 installation Pymupdf