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 43
    • Merge requests 43
  • 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
  • Merge requests
  • !855

Open
Created May 03, 2021 by Michal Vlasák@mvlasak
  • Report abuse
Report abuse

Draft: RichMediaInstance: add Asset field

  • Overview 13
  • Commits 3
  • Pipelines 4
  • Changes 6

After seeing Okular's handling of (Flash) Rich Media (https://invent.kde.org/graphics/okular/-/blob/master/generators/poppler/generator_pdf.cpp#L244-335), I thought it wouldn't be hard to add support of plain Rich Media, e.g.: (read objects from bottom)

2 0 obj
<<
  /Type /Filespec
  /F (video.mp4)
  /Desc (video.mp4)
  /EF <<
    /F 1 0 R
  >>
>>
endobj

3 0 obj
<<
  /Type /RichMediaInstance
  /Subtype /Video
  /Asset 2 0 R
>>
endobj

4 0 obj
<<
  /Type /RichMediaConfiguration
  /Subtype /Video
  /Instances [ 3 0 R ]
>>
endobj

8 0 obj
<<
  /Type /Annot
  /Subtype /RichMedia
  /RichMediaSettings <<
    /Activation <<
      /Condition /PV
    >>
    /Deactivation <<
      /Condition /XD
    >>
  >>
  /RichMediaContent <<
    /Assets <<
      /Names [ (video.mp4) 2 0 R ]
    >>
    /Configurations [ 4 0 R ]
  >>
  /AP <<
    /N 5 0 R
  >>
  /Border [ 0 0 0 ]
  /NM (video.mp4)
  /Contents (rm 'video.mp4')
  /Rect [ 70.866 317.48 524.409 771.024 ]
>>
endobj

Poppler however, currently doesn't expose the /Asset field of RichMediaInstance. The /Asset should be also contained in the /Assets array. I know nothing about handling of object / indirect references in poppler, so my first naive attempt was to keep it simple and not share it. Also maybe some fields from /Presentation dictionary (nested in /Activation) will be useful, but I need to confirm this.

I tried to adapt Okular with these changes applied, but no luck so far -- maybe I didn't manage to use the custom compiled library, or the code is flawed.

If this code is unusable and somebody has an easy way to do it please do. If not I will try to get this done (for possible use in Okular and Evince), but maybe no sooner than at end of July.

Complete demo file is attached: simple.pdf

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: asset