#1006909 impressive: Fails to find any pages in the presentation

Package:
impressive
Source:
impressive
Submitter:
Gunnar Wolf
Date:
2022-03-21 19:30:05 UTC
Severity:
important
Tags:
#1006909#5
Date:
2022-03-08 04:44:42 UTC
From:
To:
Whenever I try to open a PDF presentation with impressive, I get the
following error message:

    Welcome to Impressive version 0.13.0-beta2 (SVN r298)
    pygame 1.9.6
    Hello from the pygame community. https://www.pygame.org/contribute.html
    Detected screen size: 1920x1080 pixels
    PDF renderer: Xpdf/Poppler
    pdftkParse() FAILED
    WARNING: The input file `/tmp/testfile.pdf' could not be analyzed.
    The presentation doesn't have any pages, quitting.

Do note that I am running this on ARM64, and using Wayland.

And... Oh! This seems to be due to a missing dependency! I was
checking through the list of versions of depends/recommends/suggests
(am not running reportbug from the affected system), and turns out
that installing pdftk (or rather, pdftk-java, as pdftk is now just a
transitional package) fixes the issue. Just for completeness sake, the
PDF renderer is still marked to be Xpdf/Poppler, but now it reports
"OpenGL renderer: FD630" and... works! :-D

#1006909#10
Date:
2022-03-15 19:28:57 UTC
From:
To:
Thank you Gunnar.  Dear Martin,

Please refresh my mind -- is pdftk a strict requirement now for
impressive or should still be optional, whenever

    mupdf-tools (>= 1.5) | poppler-utils

would be the tools to require? Gunnar reports that without pdftk he had
no luck seeing a presentation.

Cheers,

#1006909#15
Date:
2022-03-15 21:28:15 UTC
From:
To:
Hi Gunnar and Yaroslav,

For *analyzing* the pages, Impressive requires mupdf-tools | pdftk-java.
pdftk-java is slightly preferred, because it's required for extracting
page titles. Basic page display and hyperlink navigation works with just
mupdf-tools though.

For *rendering* the PDF to bitmaps, Impressive requires. mupdf-tools |
poppler-utils, with a preference for mupdf-tools.

In other words, mupdf-tools alone gives you most of the functionality.
pdftk is, in that sense, only used for a small, not mission-critical
feature (title extraction) at this point.

I'm not sure how to translate that into Debian dependencies though.
Theoretically, it would be something like "Depends: mupdf-tools |
poppler-utils, pdftk-java | mupdf-tools; Suggests: pdftk-java", but I
don't know if mentioning the same package twice in Depends is OK, or if
a package can be both a dependency and a suggestion.
(Also, it's debatable whether pdftk should be a recommendation instead
of a suggestion, but I can remember having had this discussion already,
and we decided for a suggestion in order to not pull in a whole Java
installation by default, so let's keep it at that. perl should
definitely be relegated from recommendation to suggestion status though.)

The easiest solution certainly would be to make mupdf-tools a hard
dependency (i.e. remove the poppler-utils alternative) and call it a day.

Best regards,
Martin Fiedler

#1006909#20
Date:
2022-03-15 22:07:59 UTC
From:
To:
Martin Fiedler dijo [Tue, Mar 15, 2022 at 10:28:15PM +0100]:

Hmmm... But please do take note that I _did_ have mupdf-tools
installed when Impressive failed to analyze the PDF
document. mupdf-tools is already a hard dependency:

    $ apt show impressive|egrep '^(Recom|Dep|Sug)'
    Depends: python3, python3-pygame, python3-pil, mupdf-tools (>= 1.5) | poppler-utils
    Recommends: mplayer, ffmpeg, perl, xdg-utils
    Suggests: ghostscript, latex-beamer, pdftk

Greetings,

#1006909#25
Date:
2022-03-15 22:29:36 UTC
From:
To:
Hi Gunnar,

Did you though? Impressive detected "Poppler/Xpdf" as the renderer,
which is an indicator of the absence of mupdf-tools. If you can confirm
that "mutool -v" works on your system (in the sense of: prints a version
number instead of a "command not found" message), I'd have some homework
to do though ;)

Unfortunately, it's not (yet?) a hard dependency -- mutool (from
mupdf-tools) *or* pdftoppm (from poppler-utils) is. If you had installed
poppler-utils previously and install Impressive, the way the
dependencies are currently set up, apt won't pull in mupdf-tools because
the dependency is already satisfied by poppler-utils.

Best regards,
Martin Fiedler

#1006909#30
Date:
2022-03-21 13:08:34 UTC
From:
To:
Dear Gunnar,

Could you please confirm that mupdf-tools were installed and
functioning?  I know that sounds implausible given that it is a hard
dependency but having no pdftk{,-java} installed I was able to use
impressive just fine.

or Martin -- did you do some homework and figured smth out which is now
released?

Cheers,

#1006909#35
Date:
2022-03-21 17:29:47 UTC
From:
To:
Yaroslav Halchenko dijo [Mon, Mar 21, 2022 at 09:08:34AM -0400]:

I am writing finally from the computer I regularly use for my classes
-- I did have mupdf, but *not* mupdf-tools. I can confirm impressive
works with my presentation (although the rendering looks a bit less
polished) after installing mupdf-tools.

Ugh -- and the ugly rendering remains even if I install pdftk-java
(that is, it seems that having both installed in the system,
impressive will default to mupdf-tools?); I got back my "nice"
rendering only after purging mupdf-tools.

So:

- with mupdf-tools 1.19.0+ds1-2 and pdftk-java 3.2.2-1:
  - Rendering is ugly
  - Impressive reports:

    Welcome to Impressive version 0.13.0-beta2 (SVN r298)
    pygame 1.9.6
    Hello from the pygame community. https://www.pygame.org/contribute.html
    PDF renderer: MuPDF 1.4 or newer
    OpenGL renderer: FD630

- with mupdf-tools 1.19.0+ds1-2 and pdftk-java 3.2.2-1:
  - Rendering is nicer
  - Impressive reports:
    Welcome to Impressive version 0.13.0-beta2 (SVN r298)
    pygame 1.9.6
    Hello from the pygame community. https://www.pygame.org/contribute.html
    PDF renderer: Xpdf/Poppler
    OpenGL renderer: FD630

- with mupdf-tools 1.19.0+ds1-2 and pdftk-java uninstalled:
  - Rendering is ugly
  - Impressive reports:
    Welcome to Impressive version 0.13.0-beta2 (SVN r298)
    pygame 1.9.6
    Hello from the pygame community. https://www.pygame.org/contribute.html
    PDF renderer: MuPDF 1.4 or newer
    pdftkParse() FAILED
    OpenGL renderer: FD630

- with both mupdf-tools and pdftk-java uninstalled:
  - No rendering
  - Impressive reports:
    Welcome to Impressive version 0.13.0-beta2 (SVN r298)
    pygame 1.9.6
    Hello from the pygame community. https://www.pygame.org/contribute.html
    PDF renderer: Xpdf/Poppler
    pdftkParse() FAILED
    WARNING: The input file `/home/gwolf/vcs/sistemas_operativos/laminas/08_algoritmos_planif_proc.pdf' could not be analyzed.
    The presentation doesn't have any pages, quitting.

I think the result for having both installed should be to default for
the best renderer. If none are available, of course, impressive should
fail -- but the message it conveys is quite cryptic (it does not say
the renderer is not there; in fact, it points at xpdf/poppler. Why
does it fail?)

But more than impressive's message... if either pdftk-java or
mupdf-tools are required for impressive to be useful, they should be
declared as alternative dependencies (defaulting to... well, that's
your criteria 😉).

Thanks!

#1006909#40
Date:
2022-03-21 19:26:52 UTC
From:
To:
Hi Gunnar,

thanks for the analysis, and thanks for confirming that mupdf-tools was
indeed missing.

Anyway, I think there is a slight misunderstanding about which external
tool Impressive requires:
For *analysis* (i.e. checking how many pages there are, extracting
hyperlinks etc.), Impressive needs "mutool" from mupdf-tools or "pdftk"
from pdftk-java(*).
For *rendering* (i.e. converting PDF pages to bitmaps), Impressive needs
"mutool" from mupdf-tools or "pdftoppm" from poppler-utils.
So, pdftk is in no way involved in how the slides look on screen, while
mutool serves double duty for analysis and rendering.
That's interesting. Can you upload a pair of example screenshots and/or
an affected document somewhere? In my testing, I've always found MuPDF's
results to be equal (and sometimes even superior) to Poppler's. You are,
in fact, the first user who complains about the rendering quality, and
I'd like to understand what's going on.

That's exactly what it does :) Impressive picks MuPDF over Poppler
because of two reasons: (a) it's faster, and (b) it doesn't require
temporary files.

That being said, you don't need to uninstall anything to force
Impressive to use a specific renderer, as there's a command-line option
to override the renderer: "-P mutool" uses MuPDF, "-P pdftoppm" uses
Poppler, "-P gs" uses GhostScript.

Best regards,
Martin Fiedler


(*) As said a few mails back, there is one -- optional -- feature that
still requires pdftk(-java), and that's extraction of the page titles.
If you don't need that, but have mupdf-tools, you can get rid of pdftk-java.
This restriction will possibly vanish sonn, because literally an hour
*after* I released 0.13.1, a user informed me that mutool can indeed
also extract page titles if you ask nicely ...