Problem/Motivation

Currently in the generatePdfWithMetadata we always unset Title, Author, Subject, and Keywords for legacy metadata. We then always add the new metadata tag with the newer format. Instead, if the meta tag already exists let's just set that, otherwise we can add a new tag.

We also need to fix the keywords to use a Multi field because they correctly don't show up in Adobe Acrobat (but shows up fine in the chrome reader).

Steps to reproduce

  1. Setup PDF Metadata as enable on a media entity.
  2. Make sure the keywords attribute has a token setup for it.
  3. Save, and open the PDF in acrobat. There should be no keywords.

Proposed resolution

Refactor the code and set legacy metadata if available, otherwise we add. Then if we edit the PDF again it should always use the previous tag that was added prior.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

j-barnes created an issue. See original summary.

j-barnes’s picture

Status: Active » Needs review
sunny-lee’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +metadata

Tested and reviewed, PDFs are generated with metadata and works with Adobe.

sunny-lee’s picture

Tested and reviewed, PDF added to Drupal adds correct metadata tags

  • j-barnes committed 004c30b on 1.0.x
    Issue #3301331: Optimize Metadata Setting / Keywords
    

j-barnes’s picture

j-barnes’s picture

Status: Reviewed & tested by the community » Fixed
j-barnes’s picture

Status: Fixed » Closed (fixed)