diff options
author | Karl Berry <karl@freefriends.org> | 2012-12-18 23:28:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-12-18 23:28:49 +0000 |
commit | 2036a05c122c8dd027354cd0cb0679f45db48f4b (patch) | |
tree | 985e58a3731159e28932e1713cd39adc3e5d4576 /Master/texmf-dist/tex | |
parent | 9d27ed716f49fb604685eba7a1162300afd7188e (diff) |
hyperxmp (18dec12)
git-svn-id: svn://tug.org/texlive/trunk@28568 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 171 |
1 files changed, 167 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty index 548b92fff4b..9c1a71148ee 100644 --- a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty +++ b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{hyperxmp} - [2012/09/16 v2.1 Store hyperref metadata in XMP format] + [2012/12/13 v2.2 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \def\hyxmp@driver{hpdftex} @@ -47,6 +47,31 @@ \define@key{Hyp}{pdfcaptionwriter}{\pdfstringdef\@pdfcaptionwriter{#1}} \def\@pdfmetalang{} \define@key{Hyp}{pdfmetalang}{\pdfstringdef\@pdfmetalang{#1}} +\def\@pdfcontactaddress{} +\define@key{Hyp}{pdfcontactaddress}{% + \let\xmpcomma=\hyxmp@comma + \def\xmpquote##1{##1}% + \pdfstringdef\@pdfcontactaddress{#1}% + \def\xmpcomma{,}% + \let\xmpquote=\relax +} +\def\@pdfcontactcity{} +\define@key{Hyp}{pdfcontactcity}{\pdfstringdef\@pdfcontactcity{#1}} +\def\@pdfcontactregion{} +\define@key{Hyp}{pdfcontactregion}{\pdfstringdef\@pdfcontactregion{#1}} +\def\@pdfcontactpostcode{} +\define@key{Hyp}{pdfcontactpostcode}{\pdfstringdef\@pdfcontactpostcode{#1}} +\def\@pdfcontactcountry{} +\define@key{Hyp}{pdfcontactcountry}{\pdfstringdef\@pdfcontactcountry{#1}} +\def\@pdfcontactphone{} +\define@key{Hyp}{pdfcontactphone}{\pdfstringdef\@pdfcontactphone{#1}} +\def\@pdfcontactemail{} +\define@key{Hyp}{pdfcontactemail}{\pdfstringdef\@pdfcontactemail{#1}} +\def\@pdfcontacturl{} +\define@key{Hyp}{pdfcontacturl}{\pdfstringdef\@pdfcontacturl{#1}} + +\def\hyxmp@pdfauthor{} +\def\hyxmp@pdfkeywords{} \newcommand*{\hyxmp@redefine@Hyp}{% \@ifundefined{KV@Hyp@pdfauthor}{}{% \@ifundefined{hyxmp@Hyp@pdfauthor}{% @@ -62,7 +87,7 @@ \def\xmpcomma{,}% \def\xmpquote####1{"####1"}% \hyxmp@Hyp@pdfauthor{##1}% - \let\xmpcomma=\relax + \def\xmpcomma{,}% \let\xmpquote=\relax }% \@ifundefined{KV@Hyp@pdfkeywords}{}{% @@ -79,7 +104,7 @@ \def\xmpcomma{,}% \def\xmpquote####1{"####1"}% \hyxmp@Hyp@pdfkeywords{##1}% - \let\xmpcomma=\relax + \def\xmpcomma{,}% \let\xmpquote=\relax }% } @@ -99,6 +124,14 @@ \@pdfauthor \@pdfauthortitle \@pdfcaptionwriter + \@pdfcontactaddress + \@pdfcontactcity + \@pdfcontactcountry + \@pdfcontactemail + \@pdfcontactphone + \@pdfcontactpostcode + \@pdfcontactregion + \@pdfcontacturl \@pdfcopyright \@pdfkeywords \@pdflang @@ -150,7 +183,7 @@ disabled}% \fi \next } -\let\xmpcomma=\relax +\def\xmpcomma{,}% \bgroup \catcode`\^^C=11 \gdef\hyxmp@comma{^^C} @@ -666,6 +699,135 @@ ______</rdf:Description>^^J% \fi } \begingroup + \catcode`\&=12 + \catcode`\#=12 + \gdef\xmplinesep{
} +\endgroup +\newcommand*{\hyxmp@list@to@lines}[2]{% + \ifx#2\@empty + \else + \bgroup + \hyxmp@add@to@xml{% +_________<#1>% + }% + \def\@elt@first##1{% + \hyxmp@add@to@xml{##1}% + \let\@elt=\@elt@rest + }% + \def\@elt@rest##1{% + \hyxmp@add@to@xml{\xmplinesep##1}% + }% + \let\@elt=\@elt@first + \hyxmp@xmlify{#2}% + \hyxmp@commas@to@list\hyxmp@list{\hyxmp@xmlified}% + \hyxmp@list + \hyxmp@add@to@xml{</#1>^^J}% + \egroup + \fi +} +\gdef\hyxmp@photometa@schema{% + \edef\hyxmp@photometa@data{% + \@pdfcontactaddress + \@pdfcontactcity + \@pdfcontactregion + \@pdfcontactpostcode + \@pdfcontactcountry + \@pdfcontactphone + \@pdfcontactemail + \@pdfcontacturl + }% + \ifx\hyxmp@photometa@data\@empty + \else + \hyxmp@iptc@extensions + \hyxmp@add@to@xml{% +______<rdf:Description rdf:about=""^^J% +___________xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/">^^J% +_______<Iptc4xmpCore:CreatorContactInfo rdf:parseType="Resource">^^J% + }% + \fi + \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}% + \bgroup + \def\xmplinesep{,}% + \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 + \hyxmp@add@to@xml{% +_______</Iptc4xmpCore:CreatorContactInfo>^^J% +______</rdf:Description>^^J% + }% + \fi +} +\newcommand*{\hyxmp@iptc@extensions}{% + \hyxmp@add@to@xml{% +______<rdf:Description rdf:about=""^^J% +__________xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"^^J% +__________xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema\hyxmp@hash"^^J% +__________xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property\hyxmp@hash"^^J% +__________xmlns:pdfaType="http://www.aiim.org/pdfa/ns/type\hyxmp@hash"^^J% +__________xmlns:pdfaField="http://www.aiim.org/pdfa/ns/field\hyxmp@hash">^^J% +________<pdfaExtension:schemas>^^J% +__________<rdf:Bag>^^J% +____________<rdf:li rdf:parseType="Resource">^^J% +______________<pdfaSchema:schema>IPTC Core Schema</pdfaSchema:schema>^^J% +______________<pdfaSchema:namespaceURI>http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/</pdfaSchema:namespaceURI>^^J% +______________<pdfaSchema:prefix>Iptc4xmpCore</pdfaSchema:prefix>^^J% +______________<pdfaSchema:property>^^J% +________________<rdf:Seq>^^J% +__________________<rdf:li rdf:parseType="Resource">^^J% +____________________<pdfaProperty:name>CreatorContactInfo</pdfaProperty:name>^^J% +____________________<pdfaProperty:valueType>contactinfo</pdfaProperty:valueType>^^J% +____________________<pdfaProperty:category>external</pdfaProperty:category>^^J% +____________________<pdfaProperty:description>contact information for the document's creator</pdfaProperty:description>^^J% +__________________</rdf:li>^^J% +________________</rdf:Seq>^^J% +______________</pdfaSchema:property>^^J% +______________<pdfaSchema:valueType>^^J% +________________<rdf:Seq>^^J% +__________________<rdf:li rdf:parseType="Resource">^^J% +____________________<pdfaType:type>contactinfo</pdfaType:type>^^J% +____________________<pdfaType:namespaceURI>http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/contactinfo/</pdfaType:namespaceURI>^^J% +____________________<pdfaType:prefix>Iptc4xmpCore</pdfaType:prefix>^^J% +____________________<pdfaType:description>contact information</pdfaType:description>^^J% +____________________<pdfaType:field>^^J% +______________________<rdf:Seq>^^J% + }% + \hyxmp@text@resource{CiAdrExtadr}{contact address}% + \hyxmp@text@resource{CiAdrCity}{contact city}% + \hyxmp@text@resource{CiAdrRegion}{contact region}% + \hyxmp@text@resource{CiAdrPcode}{contact postal code}% + \hyxmp@text@resource{CiAdrCtry}{contact country}% + \hyxmp@text@resource{CiTelWork}{contact telephone number}% + \hyxmp@text@resource{CiEmailWork}{contact email address}% + \hyxmp@text@resource{CiUrlWork}{contact url}% + \hyxmp@add@to@xml{% +______________________</rdf:Seq>^^J% +____________________</pdfaType:field>^^J% +__________________</rdf:li>^^J% +________________</rdf:Seq>^^J% +______________</pdfaSchema:valueType>^^J% +____________</rdf:li>^^J% +__________</rdf:Bag>^^J% +________</pdfaExtension:schemas>^^J% +______</rdf:Description>^^J% + }% +} +\newcommand*{\hyxmp@text@resource}[2]{% + \hyxmp@add@to@xml{% +________________________<rdf:li rdf:parseType="Resource">^^J% +__________________________<pdfaField:name>#1</pdfaField:name>^^J% +__________________________<pdfaField:valueType>Text</pdfaField:valueType>^^J% +__________________________<pdfaField:description>#2</pdfaField:description>^^J% +________________________</rdf:li>^^J% + } +} +\begingroup \ifhyxmp@unicodetex \lccode`\!="FEFF % \lowercase{% @@ -690,6 +852,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns\hyxmp@hash">^^J% \hyxmp@xmpRights@schema \hyxmp@dc@schema \hyxmp@photoshop@schema + \hyxmp@photometa@schema \hyxmp@xmp@basic@schema \hyxmp@mm@schema \hyxmp@add@to@xml{% |