I'm trying to generate a PDF/A using pdflatex and pdfx and want the PDF meta data populated with the values I specify in the .xmpdata file.
My problem is, that the author and keyword information is not written into the PDF meta data, while this works just fine for title and subject.
Here's a MWE to demonstrate my problem, pretty similar to what the pdfx documentation shows.
\begin{filecontents*}{\jobname.xmpdata}
\Title{Baking through the ages}
\Author{A. Baker}
\Keywords{cookies\sep muffins\sep cakes}
\Publisher{Baking International}
\Subject{The Subject}
\end{filecontents*}
\documentclass{scrartcl}
\usepackage[a-1b]{pdfx}
\begin{document}
First line
\makeatletter
Author: \pdfx@Author
Keywords: \pdfx@Keywords
Subject: \pdfx@Subject
Title: \pdfx@Title
\makeatother
last line.
\end{document}
If you check the PDF properties, the lines for author and keywords are empty, which I find not very intuitive, given that subject and title is filled.
This might be related to the use of \sep in the author and keyword fields, but it does not make a difference if you actually use it or not (see MWE).
I'm using an up-to-date Manjaro Linux with texlive. My PDF viewer is evince.
I found the following workaround, which is probably horribly hacky, but works for me:
\makeatletter
\def\sep{; }
\pdfx@topdfstring\pdfx@Author\xmp@Author
\pdfx@topdfstring\pdfx@Keywords\xmp@Keywords
\makeatother
When I insert this before \begin{document}
, the behaviour is as expected and all fields are filled.
Alternatively I could specify the same things again using \pdfinfo{...}
, but I don't understand why I would need to do this again.
Maybe someone can explain what is going on or if this is a bug in pdfx. Thanks.
Best Answer
I recommend the following way without
pdfx
to get your MWE working:I can't speak for pdfx but reusing variables can break things also with other packages. Thus it's better to create a new command for those entries that don't belong to the title page as done with
\stichworte
in this MWE.