# The Last(?) Word

I have now accepted @MatthewLeingang's answer. This directs me to the hyperxmp package, which appears to be the simplest solution (for me as a very-end user). The fact that this doesn't work in my  workflow and environment isn't Matthew's fault.

To chase the rest of my problem, which appears to involve a conflict with memoir, readers may be interested in this spin-off question.

Thank you all again for your help.

# Progress Update 1:

First, flouting convention, my sincere thanks to all who have answered or commented (duly upvoted). Special thanks to @diabonas, whose sample PDF does indeed contain a copyright notice.

However, there may be a clue here: while his PDF says this:

PDF Producer: XeTeX 0.9997

mine says this:

PDF Producer: xdvipdfmx (0.7.8)

Now, I'm processing it with XeLaTeX via latexmk, but to keep myself honest, I re-did it with just XeLaTeX, with the same result.

# Progress Update 2:

Here's an MWE that fails, and gives "PDF Producer: xdvipdfmx (0.7.8)":

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{memoir}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{hyperxmp}
\hypersetup{
pdfauthor={Brent Longborough},
pdftitle={O Hai},
\begin{document}
\lipsum[1]
\end{document}


By just changing the document class to article, we get "PDF Producer: XeTeX 0.9997", and the copyright notice appears!

# Original Question:

I'm already using hyperref in the document, and I have no special worries about "overheads", only about keeping the workflow simple.

On the principle of "monkey see, monkey do", I tried this to no avail:

\hypersetup{%
pdfinfo={%
}
}


So far, I have been unable to find the correct tag names, or to discover even whether I have a chance.

All suggestions are welcome, but I'd especially like a pointer to the book of tag names for PDF metadata.

My PDF reader is PDF Xchange Viewer from Tracker Software. When I view the Document Properties, and select the "Additional Metadata..." button, a [third] window appears in which there appear a dropdown labelled "Copyright Status:", with options "Unknown", "Copyrighted", and "Public Domain"; and a text box labelled "Copyright Notice:":

So you can see the source of my half-blind groping for metadata tags...

So, I guess what I'm really asking is "What tag names should I be using to fill in these fields?"

After hacking at the PDF (using @egreg's tip and then the viewer itself), I found the Copyright stuff in some RDF dc: namespace. I have since tried using the hyperxmp package, but without success (nothing shows up in the PDF), and I suspect that may be because it only works for pdfLaTeX.

I have also tried @MatthewLeingang's answer, but can confirm that it definitely requires pdfLaTeX, and I really don't want to go back.

-
xdvipdfmx adds the info to the PDF dictionary; you can see it if you call xelatex -output-driver="xdvipdfmx -z 0" file, which sets compression level to 0, and then look at the PDF file. How to use this information is perhaps beyond the scope of this site. –  egreg Jan 18 '12 at 11:40
You'll have to ask Tracker Software for information on what to add to the PDF. –  Martin Schröder Jan 18 '12 at 13:41
@doncherry: Thanks for the image; sorry I was too lazy. –  Brent.Longborough Jan 18 '12 at 14:21
@Brent.Longborough: You're welcome. If Wikipedia's down already, we have to live up to our wikiness :) –  doncherry Jan 18 '12 at 14:58

As egreg notes, rights information is not part of the document information directory. But it can be included in the document's extensible metadata profile.

Here are two solutions that work with Adobe Acrobat and pdflatex. I don't know if you will see the metadata in the same place as you do with Acrobat; PDF XChange Viewer is a Windows app and I have a Mac so I can't test it.

Also (potential showstopper, wish I had noticed this earlier) neither solutions works with xetex. Perhaps they could be cajoled but that would require patching the package.

# xmpincl

1. Make sure you have the xmpincl package. It's in TeX-live.

2. Create a basic XMP file like this:

    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.2-c001 63.139439, 2010/09/27-13:37:26        ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xmpRights:Marked>True</xmpRights:Marked>
</rdf:Description>
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:rights>
<rdf:Alt>
</rdf:Alt>
</dc:rights>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>


Let's call it copyright.xmp. If you want to grant more rights you can; you just need something more detailed. Creative Commons has a page to help you generate an XMP file.

\documentclass{article}
\title{My article}
\author{Brent Longborough}
\usepackage{xmpincl}
\usepackage{lipsum}

\begin{document}
\maketitle
\lipsum
\end{document}


That's it! When I open the document in Adobe Acrobat I can see the copyright information in the expected place. If I select File > Properties ... and click on "Additional Metadata..." it's there.

# hyperxmp

The hyperxmp implements extra document information keys pdfcopyright and pdfcopyrighturl that can be declared in much the same way as \pdfinfo keys. Under the hood it creates the XMP file for you. So you only need a file like this:

\documentclass{article}
\title{My article}
\author{Brent Longborough}
\usepackage{hyperref}
\usepackage{hyperxmp}
\hypersetup{
pdfauthor={Brent Longborough},
}
\usepackage{lipsum}

\begin{document}
\maketitle
\lipsum
\end{document}


Also doesn't work in xetex, though.

-
Matthew, I'm really grateful for the effort you've put into your answer, and I've +1ed it. However, unfortunately, as you point out, xmpincl doesn't support XeLaTeX. As I'm happier to give up the metadata before I give up XeTeX, no deal, I'm afraid; please don't think me ungrateful... –  Brent.Longborough Jan 18 '12 at 14:46
@Brent.Longborough: no problem. After I realized it wouldn't work for you under your current workflow I decided to submit anyway in case others found it useful. –  Matthew Leingang Jan 18 '12 at 15:13
Since version 1.2, hyperxmp should be compatible with XeTeX/xdvipdfmx, thus solving @Brent.Longborough's problem. –  diabonas Feb 25 '12 at 11:12
@Brent.Longborough That's weird... I tested the above MWE with an up-to-date TeX Live 2011 installation (Windows), and viewed the resulting file with PDF-XChange Viewer 2.5, which displayed the copyright information. This is the generated PDF file: hyperxmp-copyright.pdf. Does this work for you? –  diabonas Feb 27 '12 at 18:41
As far as I know xdvipdfmx always declares itself as producer, overriding whatever is in the source file. –  egreg Feb 27 '12 at 21:43

The main reference should be the "PDF Reference book", fourth edition, that on page 714 lists the known entry types for the document information dictionary:

Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate, Trapped

On page 713 it says

Note: Although viewer applications can store custom metadata in the document information dictionary, it is inappropriate to store private content or structural information there; such information should be stored in the document catalog instead (see Section 3.6.1, “Document Catalog”).

However, on page 882 (Appendix E), it says

Note: New keys for the document information dictionary (see Section 10.2.1, “Document Information Dictionary”) or a thread information dictionary (in the I entry of a thread dictionary; see Section 8.3.2, “Articles”) need not be registered.

Not the expected answer, I guess. PDF viewers won't know how to access the information, if they are not programmed to.

## EDIT

-
Cool. The disadvantage of this approach is that a machine does not know what these keywords mean. XMP uses RDF, a data-description framework with namespaces. So when one agent says something about a resource using, for instance, Dublin Core metadata, other agents can begin to understand it. But I am known to go off on massive metadata tangents... –  Matthew Leingang Jan 18 '12 at 22:30
I agree, but adding XMP support to (x)dvipdfmx seems not to be an easy task, considering the scantiness of the documentation. –  egreg Jan 18 '12 at 22:37
maybe not. xmpincl.sty is 100 lines long and boils down to these commands: \pdfcompresslevel=0\immediate\pdfobj stream attr {/Type /Metadata /Subtype /XML} file{#1.xmpi} \pdfcatalog{/Metadata \the\pdflastobj\space 0 R}. So it's only a few things to translate to \specials, IIUC. –  Matthew Leingang Jan 19 '12 at 1:45
There's some discussion of this, which seems to suggest how one would add PDF objects to XeTeX, at tug.org/pipermail/xetex/2011-August.txt (search for "analogues of \pdfobj?") –  Norman Gray Jul 16 '12 at 17:49

Your code will work (as egreg points out) and write the keys and their values to the PDF info dict, but I don't know of any standardised keys for this information. You'll probably have better luck with XMP (sorry, Wikipedia is blacked out because of SOPA). There isn't much support for XMP with LaTeX, though.

-
There is a latex package for including XMP metadata. Is XMPP the same as XMP? –  Matthew Leingang Jan 18 '12 at 13:01
No, XMP is correct, while XMPP is the protocol used by jabber/googletalk etc. The pagetitle is still visible on @Martin's wikipedia link. ;-) –  Carsten Thiel Jan 18 '12 at 13:13
@CarstenThiel: Thanks. Fixed. –  Martin Schröder Jan 18 '12 at 13:39
There is another package ctan.org/pkg/hyperxmp –  matth Jan 18 '12 at 13:55
@Brent.Longborough The manual of hyperxmp says that with XeTeX one needs to disable compression (with the -z 0 trick I mentioned before). –  egreg Jan 18 '12 at 22:42