6

I have created using pdfx a pdf using this command:

\usepackage[a-1b]{pdfx}

I would add metadata but I don't really understand how do it.

I read the doc but I didn't understand

pdfx guide

Mazzy
  • 7,642

1 Answers1

12

From pdfx manual:

2.1. Data file for XMP metadata

As mentioned above, standards compliant PDF documents need XMP metadata to be included. In order to create XMP in the prescribed XML format, a simple data file holding the meta information of the document needs to be created either through a program or by hand. For our purposes, we name it as \jobname.xmpdata, a simple example of which will look like the following:

  \Keywords{pdfTeX\sep PDF/X-1a\sep PDF/A-b} 
  \Title{Sample LaTeX input file} 
  \Author{LaTeX project team}
  \Org{TeX Users Group}

So you have to put the xmpdata in a separate file. We can do it using filecontents:

\documentclass{article}

\usepackage{lipsum}
\usepackage[a-1b]{pdfx}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.xmpdata}
\Keywords{pdfTeX\sep PDF/X-1a\sep PDF/A-b} 
\Title{Sample LaTeX input file} 
\Author{LaTeX project team} 
\Org{TeX Users Group}
\Doi{123456789} 
\end{filecontents*}
\begin{document}
\lipsum

\end{document}

enter image description here

To compile this you may have to download the ICC profile (ISOcoated_v2_300_bas.ICC) from here: Color management ISO profile. Simply rename the downloaded file as FOGRA39L.ICC and save it in pdfx folder (or in localtexmf folder where tex can find it). A file name data base refreshing will be necessary.

As noted by Enrico there is a bug in pdfx. The command \Subject won't work. To counter this simply put (Thanks to Enrico):

\newcommand{\Subject}[1]{\gdef\xmpSubject{#1}}

before \usepackage[a-1b]{pdfx}

  • 1
    There is a bug in pdfx.sty: the \Subject command is not recognized in the XMP data file. It's sufficient to add \newcommand{\Subject}[1]{\gdef\xmpSubject{#1}} after \usepackage[...]{pdfx} – egreg Dec 21 '12 at 23:58
  • Looking at the .sty file one sees that \xmpSubject is initialized to \xmpKeywords, but the corresponding macro for setting \xmpSubject at runtime is missing. I'm inclined to consider this a bug, as \Subject is a documented interface. – egreg Dec 22 '12 at 00:01
  • @egreg: Thanks. Please leave your comments here (I mean don't delete them). I will try to ping CVR. –  Dec 22 '12 at 00:06
  • 1
    Sorry, I will fix this and will get back as soon as possible. Many thanks for the time of all. – CV Radhakrishnan Dec 22 '12 at 04:33
  • 1
    @CVRadhakrishnan: Thank you very much. :-) –  Dec 22 '12 at 05:31