1

I've been trying to update the metadata of my PDF and I've encountered some problems. I loaded hyperref in the last place on my document, but I tried to put it in different places.

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage[catalan]{babel}
\usepackage[T1]{fontenc}

\usepackage[ type={CC}, modifier={by-nc-nd}, version={4.0}, ]{doclicense} \usepackage{extramarks} \usepackage{etoolbox}

\makeatletter \renewcommand{\title}[1]{\def@title{#1}} \newcommand{\tipus}[1]{\def@tipus{#1}} \newcommand{\actual}[2]{\def@curs{#1}\def@semestre{#2}} \newcommand{\professor}[2]{\def@nom{#1}\def@cognom{#2}} \newcommand{\resum}[1]{\def@resum{#1}} \newcommand{\degree}[1]{\def@degree{#1}} \newcommand{\titleback}[1]{\def@titleback{#1}} \newcommand{\classification}[1]{\def@classification{#1}} \makeatother

\author{Mario} \title{Càlcul Diferencial en Diverses Variables} \actual{2022-2023}{Cinquè} \tipus{Apunts} \professor{Dr. A}{B} \degree{Matemàtiques} \resum{Aquesta assignatura tracta les funcions reals de diverses variables reals, treballant les nocions de límit, continuïtat i diferenciabilitat d'aquestes funcions.} \classification{00-01, 97I40, 97I60, 97N40}

\usepackage[pdftex,colorlinks=false]{hyperref}

\makeatletter% \hypersetup{% linkbordercolor={lightgray},% urlbordercolor={darkgray},% citebordercolor={lightgray},% pdfinfo={% Title={@title},% Author={@author},% Subject={@degree},% Producer={pdfTeX},% Creator={@author},% Keywords={@tipus},% }% } \makeatother% \pgfplotsset{compat=1.18} \begin{document} \setlength{\baselineskip}{.6cm} Hello \end{document}

When I get info on the generated PDF, the author field doesn't even appear. The same happens with the keywords. I have also tried to assign Author to an immutable (like s, for example). Nothing has worked so far. Assume that I've tried everything in here, here and here.

Note: checking the hyperxmp documentation, in particular, the complete example section, it would suffice to include hyperxmp right before hyperref.

Photo of the output

Thanks in advance!

1 Answers1

2

doclicense loads the hyperxmp package which adds XMP-metadata to the PDF.

As is described in the hyperxmp documentation on page 13, it suppresses some entries in the info dictionary to make pdf/A validators more happy. You can avoid this suppression by using the keeppdfinfo option:

\documentclass{book}
\usepackage[catalan]{babel}
\usepackage[T1]{fontenc}

\usepackage{hyperxmp}

\author{Mario} \title{Càlcul Diferencial en Diverses Variables}

\usepackage{hyperref}

\makeatletter% \hypersetup{% pdfinfo={% Title={@title},% Author={@author},% Subject={subject},% Producer={pdfTeX},% Creator={@author},% Keywords={Apunts},%
},% keeppdfinfo %keep info entries } \makeatother%

\begin{document}

Hello \end{document}

In PDF 2.0 the info dictionary is deprecated in favor of XMP-metadata and in texlive 2023 pdftex will have an option to suppress it altogether.

Ulrike Fischer
  • 327,261