How to select fitz/mupdf as backend

Asked by Norbert Preining on 2020-02-12

I am currently updating the mupdf/pymupdf/qpdfview packages in Debian (for now for my personal use) and try to select the mupdf/fitz backend. The backend file is present in `/usr/lib/qpdfview/` but I don't see any indication in the preferences where it can be selected.

Thanks for any explanation


Question information

English Edit question
qpdfview Edit question
No assignee Edit question
Solved by:
Adam Reichold
Last query:
Last reply:
Adam Reichold (adamreichold) said : #1

Hello Norbert,

the Fitz backend is still somewhat unmaintained which is why it is not exposed via the settings. It is currently only used for PDF files if the Poppler backend is not present, e.g. if you create a split qpdfview package with in one additional package and in another, then installing the Fitz one but not the Poppler should do the trick.

Best regards,

Norbert Preining (preining) said : #2

Hi Adam,
thanks for your prompt reply, that is very much appreciated.

Now I get a different error, I guess there might be a linking problem from my side:

Could not load global plug-in: "/usr/lib/qpdfview/"
"Cannot load library /usr/lib/qpdfview/ (/usr/lib/qpdfview/ undefined symbol: opj_stream_default_create)"

I thought that is from libopenjpeg which is installed, though it seems not to be found.

I will investigate further, but if you have an idea, please let me know.



Best Adam Reichold (adamreichold) said : #3

Hello again,

Fitz is provided as a static library and hence an application (or other DSO as in our case) needs to provide all dependencies manually again when linking. To handle this, the build system provides the FITZ_PLUGIN_LIBS variable which can be set via the qmake command line and defaults to "-lmupdf -lmupdf-third -ljpeg". My guess is that you need to override this to add at least "-lopenjp2" but possibly more, it depends on whether the Fitz package is built against the system libraries (you'll need to add more) or against its vendored code (less as most stuff is linked statically).

Best regards,

Norbert Preining (preining) said : #4

Great, thanks, that is what I needed. With "-lmupdf -lmupdf-third -ljpeg -ljbig2dec -lopenjp2" it worked and I have a working mupdf plugin. I will give it some tests and report errors!

Thanks again for the quick help!