Skip to content

Custom metadata keys are lowercased when using --custom-metadata #2860

Description

@davidmurray

When generating a PDF with --custom-metadata, custom HTML meta names are not preserved and are instead converted to lowercase.

Minimal example

<!doctype html>
<html>
<head>
  <meta charset="utf-8">

  <title>MWE</title>

  <meta name="SomeExampleAttribute" content="Hello World">
</head>
<body>
  Test
</body>
</html>
weasyprint --custom-metadata input.html output.pdf

Inspect metadata:

exiftool -G1 -a output.pdf

Actual result (converted to sentence case rather than camel case)

[PDF] Someexampleattribute : Hello World

Expected result:

[PDF] SomeExampleAttribute : Hello World

The tools I'm working with rely on exact metadata key names (they are case-sensitive), so preserving the original case is important for my use-case.

Weasyprint version: 69.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions