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/libqpdfview_fitz.so` but I don't see any indication in the preferences where it can be selected.

Thanks for any explanation

Norbert

Question information

Language:
English Edit question
Status:
Solved
For:
qpdfview Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Reichold
Solved:
2020-02-13
Last query:
2020-02-13
Last reply:
2020-02-13
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 libqpdfview_pdf.so in one additional package and libqpdfview_fitz.so in another, then installing the Fitz one but not the Poppler should do the trick.

Best regards,
Adam

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/libqpdfview_fitz.so"
"Cannot load library /usr/lib/qpdfview/libqpdfview_fitz.so: (/usr/lib/qpdfview/libqpdfview_fitz.so: 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.

Thanks

Norbert

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,
Adam

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!