Skip to content

[Bug]: PDF title displayed incorrectly when multiple language titles present in XMP metadata #20801

@arthomnix

Description

@arthomnix

Attach (recommended) or Link to PDF file

test.pdf

Web browser and its version

Firefox 149.0b4 (Developer Edition)

Operating system and its version

Arch Linux 6.18.13-zen1-1-zen

PDF.js version

5.5.207

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

Yes

Steps to reproduce the problem

  1. Create a PDF with a title with multiple languages in the XMP metadata.
    For example, the following LaTeX code in TeX Live 2026 produces the PDF attached above:
\DocumentMetadata{lang=en,debug={xmp-export}}
\documentclass{article}
\usepackage{hyperref}
\hypersetup{pdftitle={Hello World}}

\begin{document}
Hello World!
\end{document}

The produced PDF has the following XMP title metadata, with both x-default and en languages specified:

   <dc:title>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">Hello World</rdf:li>
     <rdf:li xml:lang="en">Hello World</rdf:li>
    </rdf:Alt>
   </dc:title>
  1. Open the PDF using pdf.js.
  2. Open the Document Properties window in pdf.js.

What is the expected behavior?

The pdf.js Document Properties window displays the title for one language

What went wrong?

The properties window (and page title) concatenates the titles for all languages together:

Image

(The title here should just be "Hello World" rather than "Hello WorldHello World".)

Link to a viewer

No response

Additional context

Full XMP metadata from the attached PDF file (generated by LaTeX using \DocumentMetadata{debug={xmp-export}}):

test.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions