From 74fc752cdb92fa64774c1cf73162fb237254cf93 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 28 Apr 2016 21:42:33 +0000 Subject: hyperxmp (28apr16) git-svn-id: svn://tug.org/texlive/trunk@40805 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/hyperxmp/einstein-xmp.tex | 30 ++-- .../texmf-dist/source/latex/hyperxmp/hyperxmp.dtx | 187 ++++++++++++++++----- 2 files changed, 163 insertions(+), 54 deletions(-) (limited to 'Master/texmf-dist/source/latex/hyperxmp') diff --git a/Master/texmf-dist/source/latex/hyperxmp/einstein-xmp.tex b/Master/texmf-dist/source/latex/hyperxmp/einstein-xmp.tex index cb116336515..59190765d09 100644 --- a/Master/texmf-dist/source/latex/hyperxmp/einstein-xmp.tex +++ b/Master/texmf-dist/source/latex/hyperxmp/einstein-xmp.tex @@ -76,7 +76,12 @@ \metavalue{en} - + + + + \metavalue{Text} + + \metavalue{einstein.tex} contactinfo - http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/contactinfo/ - IptcContInfo + http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ + Iptc4xmpCore contact information @@ -167,19 +172,18 @@ + xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"> - \metavalue{Kramgasse 49} - \metavalue{Bern} - \metavalue{3011} - \metavalue{Switzerland} - \metavalue{031 312 00 91} - \metavalue{aeinstein@ipi.ch} - + \metavalue{Kramgasse 49} + \metavalue{Bern} + \metavalue{3011} + \metavalue{Switzerland} + \metavalue{031 312 00 91} + \metavalue{aeinstein@ipi.ch} + \metavalue{http://einstein.biz/, https://www.facebook.com/AlbertEinstein} - + \NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{hyperxmp} %<*package> - [2016/04/05 v2.8 Store hyperref metadata in XMP format] + [2016/04/27 v2.9 Store hyperref metadata in XMP format] % % %<*driver> @@ -81,7 +81,7 @@ % % \fi % -% \CheckSum{1514} +% \CheckSum{1551} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -116,6 +116,13 @@ % to work within email addresses, as requested by Leonid Sinev} % \changes{v2.6}{2014/09/24}{Added support for a new \protect\optname{pdfdate} % key to explicitly specify the document date (and optionally time)} +% \changes{v2.9}{2016/04/25}{Force inclusion of \protect\xmpterm{dc:creator}, +% \protect\xmpterm{dc:title}, and \protect\xmpterm{dc:description}---even if +% empty---when \protect\pkgname{hyperref} is loaded with the +% \protect\optname{pdfa} option (suggested by Leonid Sinev)} +% \changes{v2.9}{2016/04/26}{Introduced the \protect\optname{pdftype} +% package option, which enables an author to specify the type of +% document being produced} % % \GetFileInfo{hyperxmp.dtx} % @@ -281,6 +288,7 @@ % \xmpterm{xmp:ModifyDate}, and \xmpterm{xmp:MetadataDate}) % \item document identifier (\xmpterm{xmpMM:DocumentID}) % \item document instance identifier (\xmpterm{xmpMM:InstanceID}) +% \item document type (\xmpterm{dc:type}) % \item file format (\xmpterm{dc:format}) % \item keywords (\xmpterm{pdf:Keywords} and \xmpterm{dc:subject}) % \item language (\xmpterm{dc:language}) @@ -345,6 +353,8 @@ % following options, which have meaning only to \pkgname{hyperxmp}: % % \begin{itemize} +% \item \optname{pdfaconformance} +% \item \optname{pdfapart} % \item \optname{pdfauthortitle} % \item \optname{pdfcaptionwriter} % \item \optname{pdfcontactaddress} @@ -359,9 +369,19 @@ % \item \optname{pdfdate} % \item \optname{pdflicenseurl} % \item \optname{pdfmetalang} +% \item \optname{pdftype} % \end{itemize} % \label{page:end-new-options} % +% The two most obscure---but alphabetically first---of the above, +% \optname{pdfaconformance} and \optname{pdfapart}, are used in +% conjunction with \pkgname{hyperref}'s \optname{pdfa} option to claim a +% particular \acro{PDF/A} standard by which the document abides. They +% default to \optname{pdfapart}=|1| and \optname{pdfaconformance}=|B|, +% indicating the \acro{PDF/A}-1B standard. These can be changed (with +% caution) to assert that the document abides by a different standard +% (e.g.,~\acro{PDF/A}-2U). + % \optname{pdfauthortitle} indicates the primary author's position or % title. \optname{pdfcaptionwriter} specifies the name of the person % who added the metadata to the document. The next eight items describe @@ -409,6 +429,23 @@ % language, as the user reading the document may not have specified a % language preference. % +% \optname{pdftype} describes the type of document being produced. This +% refers to ``the nature or genre of the resource''~\cite{Adobe2012:XMP} +% such as ``|poem|'', ``|novel|'' or ``|working paper|'', as opposed to +% the file format (always ``|application/pdf|'' when generated by +% \pkgname{hyperxmp}). Although \optname{pdftype} can be assigned an +% arbitrary piece of text, the \acro{XMP} specification recommends +% selecting types from a ``controlled vocabulary'' such as the DCMI Type +% Vocabulary~\cite{DCMI2012:meta-terms}. The DCMI Type Vocabulary +% currently consists of only ``|Collection|'', ``|Dataset|'', +% ``|Event|'', ``|Image|'', ``|InteractiveResource|'', +% ``|MovingImage|'', ``|PhysicalObject|'', ``|Service|'', +% ``|Software|'', ``|Sound|'', ``|StillImage|'', and ``|Text|''. +% \optname{pdftype} defaults to ``|Text|'', which refers to ``books, +% letters, dissertations, poems, newspapers, articles, archives of +% mailing lists,''~\cite{DCMI2012:meta-terms} and other forms of +% text---all things \LaTeX\ is commonly used to typeset. +% % It is usually more convenient to provide values for those options using % \pkgname{hyperref}'s |\hypersetup| command than on the |\usepackage| % command line. See @@ -713,6 +750,11 @@ % \newblock Available from % \url{http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/cc-201306/XMPSpecificationPart1.pdf}. % +% \bibitem{DCMI2012:meta-terms} +% DCMI Usage Board +% \newblock {\em DCMI Metadata Terms}, June~14, 2012. +% \newblock Available from \url{http://dublincore.org/documents/dcmi-terms/}. +% % \bibitem{Downes1994:ATB15} % Michael Downes. % \newblock Around the bend~\#15, answers, 4th (last) installment. @@ -884,6 +926,14 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@pdftype} +% Prepare to store the document's logical type, which defaults to ``|Text|''. +% \begin{macrocode} +\def\@pdftype{Text} +\define@key{Hyp}{pdftype}{\hyxmp@pdfstringdef\@pdftype{#1}} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@pdflicenseurl} % Prepare to store the \acro{URL} containing the document's license % agreement. @@ -919,6 +969,22 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@pdfapart} +% Prepare to store the \acro{PDF/A} part ID, which defaults to~``1''. +% \begin{macrocode} +\def\@pdfapart{1} +\define@key{Hyp}{pdfapart}{\hyxmp@pdfstringdef\@pdfapart{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@pdfaconformance} +% Prepare to store the \acro{PDF/A} conformance ID, which defaults to~``B''. +% \begin{macrocode} +\def\@pdfaconformance{B} +\define@key{Hyp}{pdfaconformance}{\hyxmp@pdfstringdef\@pdfaconformance{#1}} +% \end{macrocode} +% \end{macro} +% % The following eight macros---|\@pdfcontactaddress|, % |\@pdfcontactcity|, |\@pdfcontactregion|, |\@pdfcontactpostcode|, % |\@pdfcontactcountry|, |\@pdfcontactphone|, |\@pdfcontactemail|, and @@ -1201,7 +1267,8 @@ % at all. This excludes metadata that is included automatically such as % the current timestamp. Note that we don't consider |\@pdfmetalang| as % metadata as that value is meaningful only when used in conjunction -% with other information. +% with other information. We also don't examine |\@pdfapart| or +% |\@pdfaconformance| because those have nonempty default values. % \begin{macrocode} \newcommand*{\hyxmp@find@metadata}{% \edef\hyxmp@concated@metadata{% @@ -1218,6 +1285,7 @@ \@pdfcontactregion \@pdfcontacturl \@pdfcopyright + \@pdftype \@pdfdatetime \@pdfkeywords \@pdflang @@ -2484,18 +2552,33 @@ _________<#1>\hyxmp@xmlified^^J% % \label{sec:dublin-core} % % \begin{macro}{\hyxmp@rdf@dc} -% Given a Dublin Core property~(|#1|) and a macro containing some -% |\pdfstringdef|-defined text~(|#2|), append the appropriate block of -% \acro{XML} to the |\hyxmp@xml| macro but only if |#2| is non-empty. +% Given an optional |\if|\meta{something} statement (|#1|), a Dublin Core +% property~(|#2|) and a macro containing some |\pdfstringdef|-defined +% text~(|#3|), append the appropriate block of \acro{XML} to the |\hyxmp@xml| +% macro. % \changes{v1.4}{2011/06/12}{Included metadata in the \texttt{x-default} % language regardless of the specified metadata language} % \begin{macrocode} -\newcommand*{\hyxmp@rdf@dc}[2]{% - \ifx#2\@empty +\newcommand*{\hyxmp@rdf@dc}[3][\iffalse]{% +% \end{macrocode} +% Set |\@tempswatrue| only if the given text is nonempty or the provided +% conditional evaluates to \textsc{true}. +% \begin{macrocode} + \@tempswafalse + \ifx#3\@empty \else - \hyxmp@xmlify{#2}% + \@tempswatrue + \fi + #1 + \@tempswatrue + \fi +% \end{macrocode} +% Append the corresponding \acro{XML} only if |\@tempswatrue|. +% \begin{macrocode} + \if@tempswa + \hyxmp@xmlify{#3}% \hyxmp@add@to@xml{% -_________^^J% +_________^^J% ____________^^J% }% \ifx\@pdfmetalang\hyxmp@x@default @@ -2507,26 +2590,41 @@ _______________\hyxmp@xmlified^^J% \hyxmp@add@to@xml{% _______________\hyxmp@xmlified^^J% ____________^^J% -_________^^J% +_________^^J% }% - \fi% + \fi }% % \end{macrocode} % \end{macro} % % \begin{macro}{\hyxmp@list@to@xml} -% Given a Dublin Core property~(|#1|), an RDF array~(|#2|), and a macro -% containing a comma-separated list~(|#3|), append the appropriate block -% of \acro{XML} to the |\hyxmp@xml| macro but only if |#3| is non-empty. +% Given an optional |\if|\meta{something} statement (|#1|), a Dublin Core +% property~(|#2|), an \acro{RDF} array~(|#3|), and a macro containing a +% comma-separated list~(|#4|), append the appropriate block of \acro{XML} to +% the |\hyxmp@xml| macro. % \changes{v2.0}{2012/08/02}{Modified by Heiko Oberdiek to use the new % \term{Unicode}-processing macros} % \begin{macrocode} -\newcommand*{\hyxmp@list@to@xml}[3]{% - \ifx#3\@empty +\newcommand*{\hyxmp@list@to@xml}[4][\iffalse]{% +% \end{macrocode} +% Set |\@tempswatrue| only if the given list is nonempty or the provided +% conditional evaluates to \textsc{true}. +% \begin{macrocode} + \@tempswafalse + \ifx#4\@empty \else + \@tempswatrue + \fi + #1 + \@tempswatrue + \fi +% \end{macrocode} +% Append the corresponding \acro{XML} only if |\@tempswatrue|. +% \begin{macrocode} + \if@tempswa \hyxmp@add@to@xml{% -_________^^J% -____________^^J% +_________^^J% +____________^^J% }% \bgroup % \end{macrocode} @@ -2535,7 +2633,7 @@ ____________^^J% % |\@elt| to \acro{XML}-ify each element of the list and append it to % |\hyxmp@xmlified|. % \begin{macrocode} - \hyxmp@xmlify{#3}% + \hyxmp@xmlify{#4}% \hyxmp@commas@to@list\hyxmp@list{\hyxmp@xmlified}% \def\@elt##1{% \hyxmp@add@to@xml{% @@ -2545,8 +2643,8 @@ _______________##1^^J% \hyxmp@list \egroup \hyxmp@add@to@xml{% -____________^^J% -_________^^J% +____________^^J% +_________^^J% }% \fi } @@ -2580,13 +2678,14 @@ ______^^J% _________application/pdf^^J% }% - \hyxmp@rdf@dc{title}{\@pdftitle}% - \hyxmp@rdf@dc{description}{\@pdfsubject}% + \hyxmp@rdf@dc[\ifHy@pdfa]{title}{\@pdftitle}% + \hyxmp@rdf@dc[\ifHy@pdfa]{description}{\@pdfsubject}% \hyxmp@rdf@dc{rights}{\@pdfcopyright}% - \hyxmp@list@to@xml{creator}{Seq}{\hyxmp@pdfauthor}% + \hyxmp@list@to@xml[\ifHy@pdfa]{creator}{Seq}{\hyxmp@pdfauthor}% \hyxmp@list@to@xml{subject}{Bag}{\hyxmp@pdfkeywords}% \hyxmp@list@to@xml{date}{Seq}{\hyxmp@today}% \hyxmp@list@to@xml{language}{Bag}{\@pdflang}% + \hyxmp@list@to@xml{type}{Bag}{\@pdftype}% \hyxmp@add@simple{dc:source}{\jobname.tex}% \hyxmp@add@to@xml{% ______^^J% @@ -2828,6 +2927,10 @@ _________<#1>% % % \begin{macro}{\hyxmp@photometa@schema} % \changes{v2.2}{2012/12/07}{Added this macro} +% \changes{v2.9}{2016/04/23}{Use \textsf{Iptc4xmpCore} instead of +% \textsf{Iptc4ContInfo} as the contact-information metadata prefix. +% Leonid Sinev reports that Acrobat's \acro{PDF/A} validator seems to +% prefer \textsf{Iptc4xmpCore}} % \begin{macro}{\hyxmp@photometa@data} % Add properties defined by the \acro{IPTC} Photo Metadata % schema~\cite{IPTC2010:photo-meta} to the |\hyxmp@xml| macro. We @@ -2857,16 +2960,15 @@ _________<#1>% \hyxmp@iptc@extensions \hyxmp@add@to@xml{% ______^^J% +___________xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/">^^J% _______^^J% }% \fi - \hyxmp@list@to@lines{IptcContInfo:CiAdrExtadr}{\@pdfcontactaddress}% - \hyxmp@add@simple{IptcContInfo:CiAdrCity}{\@pdfcontactcity}% - \hyxmp@add@simple{IptcContInfo:CiAdrRegion}{\@pdfcontactregion}% - \hyxmp@add@simple{IptcContInfo:CiAdrPcode}{\@pdfcontactpostcode}% - \hyxmp@add@simple{IptcContInfo:CiAdrCtry}{\@pdfcontactcountry}% + \hyxmp@list@to@lines{Iptc4xmpCore:CiAdrExtadr}{\@pdfcontactaddress}% + \hyxmp@add@simple{Iptc4xmpCore:CiAdrCity}{\@pdfcontactcity}% + \hyxmp@add@simple{Iptc4xmpCore:CiAdrRegion}{\@pdfcontactregion}% + \hyxmp@add@simple{Iptc4xmpCore:CiAdrPcode}{\@pdfcontactpostcode}% + \hyxmp@add@simple{Iptc4xmpCore:CiAdrCtry}{\@pdfcontactcountry}% % \end{macrocode} % \begin{macro}{\xmplinesep} % The \acro{IPTC} standard states that sets of telephone numbers, email @@ -2881,9 +2983,9 @@ _______^^J% % \begin{macrocode} \bgroup \def\xmplinesep{,}% - \hyxmp@list@to@lines{IptcContInfo:CiTelWork}{\@pdfcontactphone}% - \hyxmp@list@to@lines{IptcContInfo:CiEmailWork}{\@pdfcontactemail}% - \hyxmp@list@to@lines{IptcContInfo:CiUrlWork}{\@pdfcontacturl}% + \hyxmp@list@to@lines{Iptc4xmpCore:CiTelWork}{\@pdfcontactphone}% + \hyxmp@list@to@lines{Iptc4xmpCore:CiEmailWork}{\@pdfcontactemail}% + \hyxmp@list@to@lines{Iptc4xmpCore:CiUrlWork}{\@pdfcontacturl}% \egroup \ifx\hyxmp@photometa@data\@empty \else @@ -2943,8 +3045,8 @@ ______________^^J% ________________^^J% __________________^^J% ____________________contactinfo^^J% -____________________http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/contactinfo/^^J% -____________________IptcContInfo^^J% +____________________http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/^^J% +____________________Iptc4xmpCore^^J% ____________________contact information^^J% ____________________^^J% ______________________^^J% @@ -2999,9 +3101,12 @@ ________________________^^J% % Add properties defined by the \acro{PDF/A} Identification % schema~\cite{PDFA2008:xmp-props} to the |\hyxmp@xml| macro. These % properties identify a document as conforming to a particular -% \acro{PDF/A} standard. Currently, we assume \acro{PDF/A}-1b if any -% \acro{PDF/A} compliance is detected. +% \acro{PDF/A} standard. We default to \acro{PDF/A}-1b if any \acro{PDF/A} +% compliance is detected but let the author override the ``1'' with +% \optname{pdfapart} and the ``B'' with \optname{pdfaconformance}. % \changes{v2.4}{2013/12/21}{Added this macro} +% \changes{v2.9}{2016/04/12}{Let the author specify the \protect\acro{PDF/A} +% part and conformance IDs, as requested by Leonid Sinev} % \begin{macrocode} \newcommand*{\hyxmp@pdfa@id@schema}{% \ifHy@pdfa @@ -3009,8 +3114,8 @@ ________________________^^J% ______^^J% }% - \hyxmp@add@simple{pdfaid:part}{1}% - \hyxmp@add@simple{pdfaid:conformance}{B}% + \hyxmp@add@simple{pdfaid:part}{\@pdfapart}% + \hyxmp@add@simple{pdfaid:conformance}{\@pdfaconformance}% \hyxmp@add@to@xml{% ______^^J% }% -- cgit v1.2.3