GNU bug report logs - #44338
27.1; EWW can't download and view pdf

Previous Next

Package: emacs;

Reported by: Nicholas Harrison <nicholasharrison222 <at> gmail.com>

Date: Fri, 30 Oct 2020 22:21:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 27.1

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nicholas Harrison <nicholasharrison222 <at> gmail.com>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 44338 <at> debbugs.gnu.org
Subject: bug#44338: 27.1; EWW can't download and view pdf
Date: Tue, 3 Nov 2020 16:52:40 -0700
[Message part 1 (text/plain, inline)]
I'll make a couple more comments on the original problem I explained. It
looks like you may have identified additional improvements in the process.

I believe the first problem for me is that both mailcap-mime-data
and mailcap-user-mime-data are nil. This causes the `error in process
filter: mailcap-view-mime: Symbol’s function definition is void: nil` and
makes the pdf download and appear in Fundamental mode. This occurs whether
I will be using doc-view-mode or pdf-view-mode. I'll use DocView for the
rest of this example.

1. emacs -Q
2. M-x eww
3. https://www.gnu.org/software/emacs/manual/pdf/emacs-xtra.pdf

This results in the error message and the following:
[image: image.png]

This can be (partially) corrected by running the following code before the
steps 2 and 3:
(add-to-list 'mailcap-user-mime-data
             '((type . "application/pdf")
               (viewer . doc-view-mode)))

This chooses a view mode for the pdf but that brings the second problem.
This selects the default encoding of raw-text and the conversion fails:
[image: image.png]

Instead I choose doc-view-mode manually for the eww pdf buffer:
[image: image.png]

Then selecting binary for the encoding finally gets a viewable pdf:
[image: image.png]

I hope this is in some way helpful.

Nicholas

On Sat, Oct 31, 2020 at 7:43 AM Basil L. Contovounesios <contovob <at> tcd.ie>
wrote:

> Nicholas Harrison <nicholasharrison222 <at> gmail.com> writes:
>
> > Using the EWW browser, I can navigate around to webpages, but navigating
> > to a pdf fails. It appears to download an unreadable pdf. Downloading
> > and viewing the pdf manually in emacs (pdf-view-mode) works fine.
> >
> > I've tried these solutions to no avail:
> > - Adding "application/pdf; emacsclient %s" to a ~/.mailcap file. This
> >   makes the process hang indefinitely.
> > - Running the following elisp code:
> >   `(add-to-list 'mailcap-user-mime-data
> >                  '((type . "application/pdf")
> >                    (viewer . pdf-view-mode)))`
> >   This doesn't seem to have an effect.
>
> Seems to have been fixed on master:
>
> 1. emacs -Q
> 2. M-x eww RET https://www.gnu.org/software/emacs/manual/emacs.html RET
> 3. C-s extra pdf RET RET
>
> This opens the "Specialized Emacs Features" manual in a *eww pdf* buffer
> in doc-view-mode.
>
> With PDF Tools and the mailcap-user-mime-data setting above installed,
> it opens in pdf-view-mode instead.
>
> I'm surprised the setting for mailcap-user-mime-data is needed though,
> since pdf-view-mode appears before doc-view-mode in both
> mailcap-mime-data and my version of auto-mode-alist.
>
> Lars?
>
> --
> Basil
>
[Message part 2 (text/html, inline)]
[image.png (image/png, inline)]
[image.png (image/png, inline)]
[image.png (image/png, inline)]
[image.png (image/png, inline)]

This bug report was last modified 4 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.