Firefox not rendering PDF annotations.
Categories
(Firefox :: PDF Viewer, defect, P3)
Tracking
()
People
(Reporter: bugzilla, Unassigned)
Details
(Whiteboard: [pdfjs-corrupted-pdf])
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0
Steps to reproduce:
Opened the attached PDF in Firefox 106.0.1
Actual results:
The PDF opened, but the red line annotation was not shown.
Expected results:
The red line annotation should have shown, as in screen shot.
Reporter | ||
Comment 1•3 years ago
|
||
Screen shot of what annotation should look like.
Reporter | ||
Updated•3 years ago
|
Comment 2•3 years ago
|
||
There is also something wrong in the rendering of the logo in the bottom right corner of the document.
Comment 3•3 years ago
|
||
The pdf is corrupted: the /OCProperties
in the root dictionary is mapped on the dictionary with the ref 25 0
but at some point 25 0
references a stream used as an appearance for a checkbox button.
I suppose we could try to fallback on a previous and valid version of an object when the current one is wrong...
The pdf can be viewed in either Acrobat or Chrome.
:Snuffleupagus, any ideas ?
Comment 4•3 years ago
•
|
||
(In reply to Calixte Denizet (:calixte) from comment #3)
The pdf is corrupted:
It's really corrupt, since there's basically multiple PDF documents just placed in the same file.
I suppose we could try to fallback on a previous and valid version of an object when the current one is wrong...
The problem is how to implement something this, in the current XRef
class, without the code becoming an unmaintainable mess...
Based on some quick debugging last night, unfortunately there doesn't appear to be an easy way to handle this particular case without breaking (a bunch of) existing test-cases. (And the quick hack I tried, which isn't safe in general, only fixed the page rendering and not the annotations.)
:Snuffleupagus, any ideas ?
We might need to completely re-factor/re-write the XRef.indexObjects
method, and related code, to better handle the case where multiple PDF documents are placed in the same file.
FWIW, I’m experiencing the same problem on version 102.6.0esr. I have a reproducer which is results in a valid PDF. Below is LaTeX code that can be processed with LuaTeX to produce a good PDF with many annotations written in a variety of fonts:
\documentclass{scrartcl}
\usepackage{pdfcomment}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[svgnames,rgb]{xcolor}
\usepackage[absolute]{textpos}
\usepackage{amssymb,amsmath,array,bm}
\usepackage{courier}
\usepackage{calligra,mathptmx,helvet,concmath}
\usepackage{times}
\usepackage{fontspec} % used to access system fonts like Lucida Fax (remove this line to compile in regular pdflatex)
\begin{document}
\defineavatar{standard}{height=10mm,width=15cm,type=freetext,color=white,fontsize=20pt,fontcolor=blue}%,voffset=-4.8cm,hoffset=-3.2cm}%
\noindent%
Fonts from the pdfcomment example document:\\[10mm]
\pdffreetextcomment[avatar=standard]{This font is Helvetica (the default)}\\[6mm]
\pdffreetextcomment[avatar=standard,font=LucidaConsole]{This font is LucidaConsole}\\[6mm]
\pdffreetextcomment[avatar=standard,font=Georgia]{This font is Georgia}\\[6mm]
\pdffreetextcomment[avatar=standard,font=PalatinoLinotype]{This font is PalatinoLinotype}\\[6mm]
Fonts considered among the ``14 standard fonts'':\\[10mm]
\pdffreetextcomment[avatar=standard,font=TiRo]{This font is Times-Roman (TiRo)}\\[6mm]
\pdffreetextcomment[avatar=standard,font=Helv]{This font is Helvetica (Helv)}\\[6mm]
\pdffreetextcomment[avatar=standard,font=Cour]{This font is Courier (Cour)}\\[6mm]
\pdffreetextcomment[avatar=standard,font=ZaDb]{This font is ZapfDingbats (ZaDb)}\\[6mm]
\pdffreetextcomment[avatar=standard,font=Symb]{This font is Symbol (Symb)}\\[6mm]
Ad-hoc selection:\\[10mm]
\pdffreetextcomment[avatar=standard,font=lmodern]{This font is Latin Modern}\\[6mm]
\pdffreetextcomment[avatar=standard,font=textcomp]{This font is textcomp}\\[6mm]
\pdffreetextcomment[avatar=standard,font=bogus]{This font is bogus (non-existent yet accepted!)}\\[6mm]
\pdffreetextcomment[avatar=standard,font={Lucida Fax}]{This font is Lucida Fax from fontspec}\\[6mm]
\pdffreetextcomment[avatar=standard,font=calligra]{This font is Calligra}\\[6mm]
\end{document}
This is the PDF that’s output from the LaTeX sample I posted. It reproduces the problem.
Comment 7•1 year ago
|
||
:ed, in your case the issue is different: LuaTex is producing some annotations without an appearance stream so we're creating a default one where the border is missing.
Could you please file a new bug for it ?
This bug report was created to cover the neglect of annotations that have no appearance stream:
https://bugzilla.mozilla.org/show_bug.cgi?id=1887645
Note that the sample PDF also inadvertently includes a big callout arrow spanning the page which also failed to render. I’m not sure if callout arrows can have appearance streams.
Description
•