Subject: Re: [Tools-discuss] RFC PDF crashes viewer

From: Erik Auerswald <[email-masked]>
Date: Wed, 1 Jul 2020 09:52:17 +0200

Hi,

On Tue, Jun 30, 2020 at 09:10:23PM -0400, John R Levine wrote:
> >(Background for my initial observation: When you give an assignment
> >to students and their favorite PDF viewer crashes on the required
> >reading material, they’ll simply say they can’t do the assignment
> >instead of trying out other readers.)

If there are Ubuntu users among your students that experienced
the problem, perhaps you could ask them to add a "mee too" to
the Ubuntu bug report (Launchpad / Ubuntu One account required;
https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1885313/+affectsmetoo)?
Perhaps they can add additional affected version information (e.g.,
if Ubuntu 20.04 LTS is affected as well, as it most probably is).

> Since the PDF RFCs display without trouble in the default viewers on
> Windows, MacOS, Android, iOS, and Chrome, I am impressed at the
> creativity of your students who went to the effort to find a PDF
> viewer that didn't work.

Since evince is the default PDF viewer for GNOME, it is the default PDF
viewer for many popular GNU/Linux distributions (Ubuntu, Debian, Red Hat,
Fedora, and probably quite a few more).  Since quite a few students tend
to use GNU/Linux, this is does not need creativity at all.

The files are displayed correctly without any warning or error messages
using other free software PDF viewers, e.g., Okular, xpdf and the built-in
Firefox PDF viewer.  They are displayed correctly, but with warning
and/or error messages, using the free software PDF viewers MuPDF and gv.

Okular, the default KDE PDF viewer, shows an obviously wrong date for
the attached XML file (I do not have all the details, since I do not
use Okular myself).

The free software tool pdftk can be used to create a PDF file with
attached XML that works without problems in evince (and all the other
mentioned PDF viewers).

So there are workarounds.  I would like for evince to become more robust.
I do not expect the RFC PDF renderings to be perfect.

Thanks,
Erik
-- 
Reality is that which, when you stop believing in it, doesn't go away.
                        -- Philip K. Dick

---

From: Erik Auerswald <[email-masked]>
Date: Wed, 1 Jul 2020 10:20:48 +0200

Hi John,

On Tue, Jun 30, 2020 at 01:17:31PM -0400, John Levine wrote:
> In article <[email-masked]> you write:
> >I agree with Carsten that this is a bug in evince, but evince works fine
> >for most PDF files out there, including many that Firefox cannot display
> >correctly.  Since MuPDF produces error and warning messages, and evince
> >crashes, it seems to me as if it were likely that the PDF versions of
> >recent RFCs do have issues.
> 
> The PDF versions of our RFCs are in the PDF/A-3U profile of PDF. PDF/A
> is intended to be bitrot-resistant, with no external references and
> such, and the various subprofiles allow various options.  We take
> the output of xml2rfc and run it through a commercial package from
> Callas software to embed the XML and make it PDF/A compliant.

Thanks for the detailed information. :-)

> In my experience, open source software that handles complex formats
> like PDF is pretty flaky around the edges, particularly when dealing
> with featuers like embdded files that aren't very common.

In my experience, free and open source software is often of higher
quality than non-free software.  YMMV.

> All of our PDFs work fine in Acrobat and the Apple and Google viewers
> so I doubt that the files are bad.
> 
> As a workaround, if you run the XML through "xml2rfc --pdf" you'll get
> a version without the embedded file which is less likely to trip over
> bugs in the processing software.

Thanks, and thanks again for your additional email showing the additional
xml2rfc options used.  I do think this is quite useful, because the XML
file is supposed to be the canonical information source, and thus IMHO
everybody should have access to the needed tools and information (i.e.,
settings to use) to work from the XML.

Other workarounds are using Okular, Firefox, MuPDF, or gv instead of
evince (both MuPDF and gv produce error/warning messages, but do display
the PDF contents correctly (I think)).

Yet another workaround is to use the free software pdftk to transform
the PDF:

    pdftk unpack_files rfc8798.pdf
    pdftk rfc8798.pdf cat output rfc8798-no_xml.pdf
    pdftk rfc8798-no_xml.pdf attach_files output rfc8798-pdftk.pdf

The result "rfc8798-pdftk.pdf" works fine in evince and does not produce
error/warning messages in MuPDF (gv still produces error messages).

Thanks,
Erik
-- 
[T]he most dangerous enemy of a better solution is an existing codebase
that is just good enough.
                        -- Eric S. Raymond