2

I've been trying to change the dc:date metadata of a moderncv .pdf file without success.

Doesn't work with lualatex nor pdflatex. The resulting PDF always has the real creation date as dc:date.

\pdfcreationdate, \pdfmoddate, \pdfmetadate do work.

\pdfdate works with other document classes such as KOMA-script and the base classes.

Do you know of any reason or fix for this? Thanks.

Minimal working example:

% !TeX program = lualatex

\documentclass[11pt,a4paper]{moderncv}
\moderncvstyle[left]{classic}
\usepackage{hyperxmp}

\AfterPreamble{
    \hypersetup{
        pdfencoding=auto,
        pdfcreationdate={2014-09-23T14:15:09-06:00},
        pdfmoddate={2014-09-23T14:15:09-06:00},
        pdfmetadate={2014-09-23T14:15:09-06:00},
        pdfdate={2014-09-23T14:15:09-06:00},
    }
}

\name{John}{Doe}

\begin{document}
\makecvtitle
\section{Section}
\cvitemwithcomment{Item}{Commment}{}
\end{document}
7
  • As the documentation of hyperxmp says: You have to load it before hyperref. So try \RequirePackage{hyperxmp} before \documentclass. Jul 19, 2017 at 10:14
  • Thanks for your reply. dc:date still doesn't use my value, regardless of package loading order and everything else still works fine.
    – user139505
    Jul 19, 2017 at 11:11
  • Worked for me in a current texsystem. I saw the year 2014 in the properties in (at least) two places. Jul 19, 2017 at 11:48
  • As I said "everything else still works fine". The dates you saw were probably "pdfcreationdate" and "pdfmoddate", the dates shown when pressing CTRL+D in Acrobat Viewer. To view pdfdate, you have to open the "Additional Metadata" window.
    – user139505
    Jul 19, 2017 at 12:41
  • I don't have an additional metadata button in the reader but I checked with the pro version. I think \AfterPreamble is too late, try \AtEndPreamble. Jul 19, 2017 at 13:10

1 Answer 1

1

Change the order of the package loading, and set \hypersetup in \AtEndPreamble, \AfterPreamble is too late.

\RequirePackage{hyperxmp}
\documentclass[11pt,a4paper]{moderncv}
\moderncvstyle[left]{classic}


\AtEndPreamble{
    \hypersetup{
        pdfencoding=auto,
        pdfcreationdate={2014-09-23T14:15:09-06:00},
        pdfmoddate={2014-09-23T14:15:09-06:00},
        pdfmetadate={2014-09-23T14:15:09-06:00},
        pdfdate={2014-09-23T14:15:09-06:00},
    }
}

\name{John}{Doe}

\begin{document}
\makecvtitle
\section{Section}
\cvitemwithcomment{Item}{Commment}{}
\end{document}

You must log in to answer this question.