latex3 / pdfresources

LaTeX PDF resource management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No XMP-Metadata included in PDF with A-4 standard (and version 2.0)

yrogge opened this issue · comments

When using as first line
\DocumentMetadata{lang=en-US,pdfstandard=A-4,pdfstandard=X-6,pdfversion=2.0}
and later hyperref parameters like pdfauthor, pdftitle... (through \hypersetup command), there is nothing in the PDF document properties, except some few automatic ones as "File size" or "File path". Even the "Creator" field is not present.

Everything is correct with declaration
\DocumentMetadata{lang=en-US,pdfstandard=A-3u,pdfversion=1.7}
for example. The problem source is actually the pdfstandard value.

Don't let me guess what you are doing. Always show a small but complete document which demonstrates the issue.

Sorry.
Here it is.
%---------------
% !TeX program = lualatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en_US
% !TeX TXS-program:bibliography = txs:///biber
%
% Test pdfmanagement
%
% Yves ROGGEMAN - December 2023 - LuaLaTeX (TeX Live 2023)
%
%--- % Set new PDF drivers and management
\DocumentMetadata{lang=enUS,pdfstandard=A-4,pdfstandard=X-6,pdfversion=2.0} % no XMP metadata
% \DocumentMetadata{lang=en-US,pdfstandard=A-3u,pdfversion=1.7}
%---
\documentclass[a4paper,twoside,10pt,american]{article}
\usepackage{fontspec}
\usepackage{babel}
%
\title{A test}
\author{Yves Roggeman}
\makeatletter
\let\thetitle@title
\let\theauthor@author
\let\thedate@date
\makeatother
\newcommand{\thelang}{\GetDocumentProperties{document/lang}}
%
\babelfont{rm}[Language=Default]{Noto Serif} % alias \setmainfont
\babelfont{sf}[Language=Default]{Noto Sans} % alias \setsansfont
\babelfont{tt}[Language=Default,Script=Default]{Noto Sans Mono} % alias \setmonofont (no Italic!)
%
\usepackage{hyperref} % TOC with boolmarks (PDF-LaTeX)
\hypersetup{
bookmarksnumbered,
% breaklinks, % dropped in new PDFmanagement (=> warning)
hidelinks, % no colored borders
pdftitle={\thetitle},
pdfauthor={\theauthor},
pdfinfo={Lang=\thelang},
% pdflang={\thelang}, % deprecated in new PDFmanagement
}
%
\begin{document}
%
\maketitle
%
\begin{abstract}
A very small example.
\end{abstract}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi sed justo. Cras venenatis rhoncus eros. Ut dictum elit vitae diam. Praesent in velit. Proin aliquam nulla eget nisl. Donec sed diam ac sem hendrerit mollis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi sed justo. Cras venenatis rhoncus eros. Ut dictum elit vitae diam. Praesent in velit. Proin aliquam nulla eget nisl. Donec sed diam ac sem hendrerit mollis.
%
\end{document}

You are confusing the XMP-metadata and the /Info dictionary. The XMP-metadata are there. You can simply open the pdf in some editor and search for something like this

   <dc:creator>
    <rdf:Seq>
     <rdf:li xml:lang="en-US">Yves Roggeman</rdf:li>
    </rdf:Seq>
   </dc:creator>

But in PDF 2.0/A-4 the /Info dictionary has been deprecated and so that is not added to the PDF anymore. Adobe Acrobat Reader will pull the data from the XMP metadata and so show you something like this

image

But other PDF viewer perhaps ignore the XMP and show a blank. In this case complain to the maintainer of the PDF viewer ...

Thank you for your quick answer.
And you are right : the problem lies in the PDF viewer that does not correctly handle XMP metadata.
You may clause this issue.