xmpincl 的问题

xmpincl 的问题

我收到以下错误消息:

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

运行时:

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

xmpincl 无法包含文件 pdfa-1b,因为它可从此处获取:

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

实际的例子稍微大一些,取自这里:

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

但错误消息是一样的..

我需要这个来生成符合 pdfa-1b 的输出。

有什么帮助吗?

答案1

参数\includexmp应该是一个文件名(不带扩展名),以包分发中找到的文件.xmp为模型:license.xmp

<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>

pdfa-1b.xmp分发版中的文件pdfx未设置生产者:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                 
%%  File: pdfa-1b.xmp                                         
%% 
%%  Copyright (c) 2008, CV Radhakrishnan <[email protected]>,
%%    Han The Thanh <[email protected]>
%% 
%%  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
%%
%%

将其复制到您的工作目录中并进行修改(使用不同的名称)。

当然,另一种策略是在加载之前定义\xmpProducer并出现其他所需的宏:pdfa-1b.xmp

\usepackage{xmpincl}

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

相关内容