diff --git a/cpdfcommand.ml b/cpdfcommand.ml
index ab7ad1e..f83dd48 100644
--- a/cpdfcommand.ml
+++ b/cpdfcommand.ml
@@ -2118,12 +2118,12 @@ and specs =
("-set-untrapped",
Arg.Unit (setop SetUntrapped),
" Mark as not trapped");
- ("-also-set-xml",
+ ("-also-set-xmp",
Arg.Unit setalsosetxml,
- " Also set XML metadata");
- ("-just-set-xml",
+ " Also set XMP metadata");
+ ("-just-set-xmp",
Arg.Unit setjustsetxml,
- " Just set XML metadata, not old-fashioned metadata");
+ " Just set XMP metadata, not old-fashioned metadata");
("-create-metadata",
Arg.Unit (setop CreateMetadata),
" Create XML metadata from scratch.");
diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf
index b9b0b68..7064e4e 100644
Binary files a/cpdfmanual.pdf and b/cpdfmanual.pdf differ
diff --git a/cpdfmanual.tex b/cpdfmanual.tex
index 82febbd..f113b4b 100644
--- a/cpdfmanual.tex
+++ b/cpdfmanual.tex
@@ -1785,7 +1785,8 @@ given page range.
\small\noindent\verb!cpdf -pages in.pdf!
\vspace{1.5mm}
- \small\noindent\verb!cpdf -set-title
[-raw] in.pdf -o out.pdf!\\
+ \small\noindent\verb!cpdf -set-title !\\
+ \small\noindent\verb! [-also-set-xmp] [-just-set-xmp] [-raw] in.pdf -o out.pdf!\\
(Also \texttt{-set-author} etc. See Section \ref{setdocinfo}.)
\vspace{1.5mm}
@@ -1809,7 +1810,9 @@ given page range.
\vspace{1.5mm}
\small\noindent\verb!cpdf -set-metadata in.pdf -o out.pdf!
\small\noindent\verb!cpdf -remove-metadata in.pdf -o out.pdf!\\
- \small\noindent\verb!cpdf -print-metadata in.pdf -o out.pdf!
+ \small\noindent\verb!cpdf -print-metadata in.pdf!\\
+ \small\noindent\verb!cpdf -create-metadata in.pdf -o out.pdf!\\
+ \small\noindent\verb!cpdf -set-metadata-date in.pdf -o out.pdf!
\vspace{1.5mm}
\small\noindent\verb!cpdf -add-page-labels in.pdf -o out.pdf!\\
@@ -1949,6 +1952,36 @@ at which the command is executed. Note also that \texttt{-producer} and \texttt{
\noindent The text string is considered to be in UTF8 format, unless the \texttt{-raw}
option is added---in which case, it is unprocessed, save for the replacement of any octal escape sequence such as \texttt{\textbackslash 017}, which is replaced by a character of its value (here, 15).
+To set also any field in the XMP metadata, add \texttt{-also-set-xmp}. The field must exist already. To set only the field (not the document information dictionary), add \texttt{-just-set-xmp} instead.
+
+ \section{XMP Metadata}
+\index{metadata}
+ PDF files can contain a piece of arbitrary metadata, often in XMP format.
+This is typically stored in an uncompressed stream, so that other applications
+can read it without having to decode the whole PDF. To set the metadata:
+ \begin{framed}
+ \small\verb!cpdf -set-metadata data.xml in.pdf -o out.pdf!
+ \end{framed}
+ \noindent To remove any metadata:
+ \begin{framed}
+ \small\verb!cpdf -remove-metadata in.pdf -o out.pdf!
+ \end{framed}
+ \noindent To print the current metadata to standard output:
+ \begin{framed}
+ \small\verb!cpdf -print-metadata in.pdf!
+ \end{framed}
+ \noindent To create XMP metadata from scratch, using any information in the Document Information Dictionary (old-style metadata):
+ \begin{framed}
+ \small\verb!cpdf -create-metadata in.pdf -o out.pdf!
+ \end{framed}
+ \noindent To set the XMP metadata date field, use:
+ \begin{framed}
+ \small\verb!cpdf -set-metadata-date in.pdf -o out.pdf!
+ \end{framed}
+The date format is defined in Appendix \ref{xmpdate}. Using the date \texttt{"now"} uses the time and date
+at which the command is executed.
+
+
\section{Upon Opening a Document}
\subsection{Page Layout}
@@ -2024,22 +2057,6 @@ document when first opened. The possible (case-sensitive) values are:
\small\verb!cpdf -open-at-page-fit 15 in.pdf -o out.pdf!
\end{framed}
- \section{Metadata}
-\index{metadata}
- PDF files can contain a piece of arbitrary metadata, often in XMP format.
-This is typically stored in an uncompressed stream, so that other applications
-can read it without having to decode the whole PDF. To set the metadata:
- \begin{framed}
- \small\verb!cpdf -set-metadata data.xml in.pdf -o out.pdf!
- \end{framed}
- \noindent To remove any metadata:
- \begin{framed}
- \small\verb!cpdf -remove-metadata in.pdf -o out.pdf!
- \end{framed}
- \noindent To print the current metadata to standard output:
- \begin{framed}
- \small\verb!cpdf -print-metadata in.pdf!
- \end{framed}
\section{Page Labels}
\index{page labels}\index{page!labels}
@@ -2454,6 +2471,8 @@ The \texttt{-remove-clipping} operation removes any clipping paths on given page
\chapter{Dates}\pagestyle{empty}
\label{dates}
\index{dates!defined}
+
+\section{PDF Date Format}
Dates in PDF are specified according to the following format:
\begin{framed}
@@ -2485,6 +2504,10 @@ accuracy dates. For example:
\noindent\verb!D:201401031854-08'00'! (3rd March 2014, 6:54PM, US Pacific Standard Time)
\end{framed}
+
+\section{XMP Metadata Date Format}
+\label{xmpdate}
+
\backmatter
\pagestyle{fancy}