[Tex/LaTex] Problem with xmpincl

pdf-axmp

I get the following error message:

! Undefined control sequence.
\xmpinclReadln -><pdf:Producer>\xmpProducer 
                                       </pdf:Producer> 
l.47 \includexmp{pdfa1b}

when running this:

\documentclass{report}
\usepackage{xmpincl}
\includexmp{pdfa-1b} 
\begin{document}
Hello, world!
\end{document}

xmpincl is not able to include the file pdfa-1b as it is available from here:

http://www.ctan.org/tex-archive/macros/latex/contrib/pdfx

The actual example is somewhat larger and taken from here:

http://support.river-valley.com/wiki/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex

but the error msg is the same..

I need this to generate a pdfa-1b compliant output..

Any help?

Best Answer

The argument to \includexmp should be a file name (without the .xmp extension), modelled on the license.xmp file found in the package distribution:

<x:xmpmeta xmlns:x='adobe:ns:meta/'>
   <rdf:RDF xmlns="http://web.resource.org/cc/"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <Work rdf:about="">
         <dc:title>xmpincl</dc:title>
         <dc:date>2005</dc:date>
         <dc:description>
            A LaTeX package to include XMP metadata in
            files generated through pdfLaTeX
         </dc:description>
         <dc:creator>
            <Agent><dc:title>Maarten Sneep</dc:title></Agent>
         </dc:creator>
         <dc:rights>
            <Agent><dc:title>Maarten Sneep</dc:title></Agent>
         </dc:rights>
         <dc:source
            rdf:resource="ftp://ftp.tex.ac.uk/tex&#45;archive/macros/latex/contrib/xmpincl.tar.gz"/>
         <license rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
      </Work>
      <License rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
         <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
         <permits rdf:resource="http://web.resource.org/cc/Distribution" />
         <requires rdf:resource="http://web.resource.org/cc/Notice" />
         <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
         <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
         <requires rdf:resource="http://web.resource.org/cc/SourceCode" />
      </License>
   </rdf:RDF>
</x:xmpmeta>

The file pdfa-1b.xmp that's part of the pdfx distribution doesn't set the Producer:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                 
%%  File: pdfa-1b.xmp                                         
%% 
%%  Copyright (c) 2008, CV Radhakrishnan <cvr@river-valley.org>,
%%    Han The Thanh <thanh@river-valley.org>
%% 
%%  This file may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.2 of this
%%  license or (at your option) any later version.  The latest version
%%  of this license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%%  and version 1.2 or later is part of all distributions of LaTeX
%%  version 1999/12/01 or later.
%%
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.0-c316 44.253921, Sun Oct 01 2006 17:14:39">
   <rdf:RDF xmlns:rdf       = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:pdfx      = "http://ns.adobe.com/pdfx/1.3/"
            xmlns:pdfaid    = "http://www.aiim.org/pdfa/ns/id/"
            xmlns:xap       = "http://ns.adobe.com/xap/1.0/"
            xmlns:xapRights = "http://ns.adobe.com/xap/1.0/rights/"
            xmlns:dc        = "http://purl.org/dc/elements/1.1/"
            xmlns:dcterms   = "http://purl.org/dc/terms/"
        xmlns:prism     = "http://prismstandard.org/namespaces/basic/2.0/">
      <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
      <pdf:Producer>\xmpProducer</pdf:Producer>
      </rdf:Description>
      <rdf:Description rdf:about="doi:\xmpDoi">
         <dc:format>application/pdf</dc:format>
         <dc:title>\xmpTitle</dc:title>
         <dc:creator><rdf:Seq><rdf:li>\xmpAuthor</rdf:li></rdf:Seq></dc:creator>
\@ifundefined{xmpKeywords}{}{<dc:subject><rdf:Bag><rdf:li>\xmpKeywords</rdf:li></rdf:Bag></dc:subject>}
         <prism:aggregationType>journal</prism:aggregationType>
     <prism:copyright>\xmpOrg</prism:copyright>
         <dc:publisher>\xmpOrg</dc:publisher>
     \ifx\xmpJournalnumber\@empty\relax\else<prism:issn>\xmpJournalnumber</prism:issn>\fi
     \ifx\xmpVolume\@empty\relax\else<prism:volume>\xmpVolume</prism:volume>\fi
     \ifx\xmpIssue\@empty\relax\else<prism:number>\xmpIssue</prism:number>\fi
     \ifx\xmpCoverDisplayDate\@empty\relax\else<prism:coverDisplayDate>\xmpCoverDisplayDate</prism:coverDisplayDate>\fi
     \ifx\xmpCoverDate\@empty\relax\else<prism:coverDate>\xmpCoverDate</prism:coverDate>\fi
     \ifx\xmpJournaltitle\@empty\relax\else<prism:issueName>\xmpJournaltitle</prism:issueName>\fi
     \ifx\xmpFirstpage\@empty\relax\else<prism:pageRange>\xmpFirstpage-\xmpLastpage</prism:pageRange>\fi
         \ifx\xmpFirstpage\@empty\relax\else<prism:startingPage>\xmpFirstpage</prism:startingPage>\fi
         \ifx\xmpLastpage\@empty\relax\else<prism:endingPage>\xmpLastpage</prism:endingPage>\fi
         \ifx\xmpDoi\@empty\relax\else<prism:doi>\xmpDoi</prism:doi>\fi
         \ifx\xmpDoi\@empty\relax\else<prism:url>http://dx.doi.org/\xmpDoi</prism:url>\fi
         \ifx\xmpDoi\@empty\relax\else<dc:identifier>doi:\xmpDoi</dc:identifier>\fi
         \ifx\xmpAuthoritativeDomain\@empty\relax\else<pdfx:AuthoritativeDomain><rdf:Bag><rdf:li>\xmpAuthoritativeDomain</rdf:li></rdf:Bag></pdfx:AuthoritativeDomain>\fi
         <pdfaid:part>1</pdfaid:part>
         <pdfaid:conformance>B</pdfaid:conformance>
         <xap:CreatorTool>\xmpCreatorTool</xap:CreatorTool>
         <xapRights:Marked>True</xapRights:Marked>
         <xap:ModifyDate>\convDate</xap:ModifyDate>
         <xap:CreateDate>\convDate</xap:CreateDate>
         <xap:MetadataDate>\convDate</xap:MetadataDate>
      </rdf:Description>
%      <rdf:Description rdf:about="" xmlns:xapMM="http://ns.adobe.com/xap/1.0/mm/">
%         <xapMM:DocumentID>uuid:\xmpdocid</xapMM:DocumentID>
%         <xapMM:InstanceID>uuid:\xmpinstid</xapMM:InstanceID>
%      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
%%
%% End of pdfa-1b.xmp
%%
%%

Copy it in your working directory and modify it (with a different name).

Another strategy, of course, is to define \xmpProducer and the other needed macros appearing in pdfa-1b.xmp before loading it:

\usepackage{xmpincl}

\providecommand{\xmpProducer}{LaTeX2e}
\providecommand{\xmpOrg}{An organization}
% ...
\includexmp{pdfa-1b}