Ubuntu14.04 installation Pymupdf

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.