Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P poppler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 656
    • Issues 656
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 40
    • Merge requests 40
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Issues
  • #837

Closed
Open
Created Nov 08, 2019 by Tobias Deiminger@haxtibalGuest

Annotation not shown due to obsolete generation number in indirect reference

This is a follow up to a part of Okular bug 413819, where Poppler fails to load an annotation due to an "outdated" generation number in an indirect reference by /Annots. Mupdf and Foxit manage to load the annotation regardless of the wrong reference.

This file was last saved by Foxit. We see page 1 holds an indirect reference 74 0 R to a Highlight Annotation, but the actual Highlight Annotation object has newer ID 74 1 (it's linking back correctly to page 1 via /P).

74 1 obj
<< /P 1 0 R ... /Type/Annot/Subtype/Highlight >>
75 0 obj
[ 74 0 R 78 0 R 80 0 R 81 0 R 82 0 R 87 0 R ]
endobj

All objects start with generation 0 in a new document. Obviously the generation got somehow increased to 1, which could be the result of a delete and recreate operation. Whatever software did it, it forgot to update page 1 /Annots. The array still references the Highlight Annotation using the old generation number 74 0.

In consequence, and IMO expected, Okular, PDF.js and qpdf fail to find and show that annotation. Somewhat surprisingly, Foxit and Mupdf manage to display it.

I'm interessted in your opionions whether it's worth to consider a workaround.

  • Maybe be less strict about generation number matching in XRef::fetch(int num, int gen, int recursion)?
  • Or maybe something like a reverse lookup, like "find all /Type /Annot objects in the document, then look at their /P and add them to the referenced page"?
  • Or shall we just close the issue because the root cause is an inconsistent document?
Edited Nov 10, 2019 by Tobias Deiminger
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking