latex3 / latex3/hyperref

hyperref generated PDF forms can not be imported correctly using poppler

Open
#3 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
205
Forks
41
PR merge metrics
No merged PRs in 30d

Description

(import from https://puszcza.gnu.org.ua/bugs/?272)
or Mupdf, so there are to my knowledge no PDF viewers left in Linux, which could work on them.
Fortunately, the word processor of Libreoffice 5.1.0 seems to spit out ODFs in a format, which is exported by poppler in a way, that it will later understand.

I have attached the uncompressed pdf output for comparison (LOFormWin-uncomp.pdf), so adapting hyperref output to poppler’s suggestions would most likely fix the issue. Could not see any differences in acroread or Windows readers.

Reproducible: Always

Steps to reproduce:

  1. pdflatex .tex
  2. Open the resulting pdf in either qpdfview, okular, evince, mupdf, pdf-tools (emacs), doc-view (emacs) or inkscape (poppler-import)

Expected results:
Radio Buttons deselect, when clicking another. Checkbox may be (de-)activated. Rendering should be correct for the last three ones (no form support).

Actual results:
Second Radio Button is rendered as \ding{123} (all in docView). Nothing is rendered in mupdf. Clicking another Radio Button will not deselect the others. \ding{123} will show up when clicking the invisible Radio Buttons in mupdf.
The checkbox can not be activated.

I used the following minimal example to investigate the issue:

\pdfminorversion=7
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{hyperref}

\begin{document}
\begin{Form}
\ChoiceMenu[radio,radiosymbol=\ding{108},name={myGroupOfRadiobuttons}]{Multi}{A, B}
\ChoiceMenu[radio,radiosymbol=\ding{108},name={myGroupOfRadiobuttons}]{Single}{C}
\medskip

\CheckBox[name=checkbox, checkboxsymbol=\ding{110}]{Checkbox}
\bigskip

\TextField[name=textfield,altname=textfield, width=0.6\textwidth]{TextField}
\end{Form}
\end{document}

Additional Information:

Resetting the form data in “Master PDF Editor” will get the checkbox to work everywhere and the radio buttons in mupdf. Attached the diff between those two as ‘bugexMPEres.diff’
Simply saving it in “Win Acrobat Reader” has the same effect. Saving it in “Foxit Reader” will replace the \ding{123} signs, but has otherwise no effect. The identical effect is achieved by not resetting the form in MPE.

Inkscape has a nice checkbox to toggle poppler import. Enabling it, leads to exactly the same appearance. Otherwise, just the text is shown, which excludes the viewers from influencing the issue. (shown in lininkevi.png; left inkscape, right evince).

The last one shows pdf-tools left, which has no form support, but at least recognizes the mid radio button as annotation, and mupdf right, which selects the buttons as \ding{123}.

Other bugs involved:

Of course poppler’s pdf import could be improved, but since its count of PDF form bugs is already quite high, filing another one would be to no avail.

Linux Libreoffice 5.0.4 could not create an odt, which could export to working PDF forms. I created that example one with LO 5.1.0 in a Windows VM. Once it is packaged on Gentoo, I’ll retest that to see if I get different results.

Mupdf might freeze, when entering the text field.

pdflatex version:
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.19+apng; using libpng 1.6.19+apng
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.32.0

texlive-2015 (meta) with texlive-latex-2015 (containing hyperref).

Best regards,
Manuel Ullmann
Manuel Ullmann
LOFormWin-uncomp.pdf
lininkevi
linpdtmup
bugexMPEres.diff.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the minimal LaTeX example with pdflatex and checking the generated form in the listed Poppler and MuPDF viewers. Compare the generated PDF with LOFormWin-uncomp.pdf and bugexMPEres.diff.txt; done means radio buttons, checkboxes, and rendering behave as described in the expected results.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, tex
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.