From e4d3b62937c429d281f1e1fca5957ea8611abd23 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 20 Apr 2011 01:01:33 +0000 Subject: hyperxmp 1.2 (19apr11) git-svn-id: svn://tug.org/texlive/trunk@22127 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 94 +++++++++++++++++++---- 1 file changed, 77 insertions(+), 17 deletions(-) (limited to 'Master/texmf-dist/tex/latex/hyperxmp') diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty index 6824688b0e5..175df1bbfd0 100644 --- a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty +++ b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty @@ -8,39 +8,49 @@ %% %% This is a generated file. %% -%% Copyright (C) 2006 by Scott Pakin +%% Copyright (C) 2011 by Scott Pakin %% %% This file may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License, either version 1.3b of this license +%% the LaTeX Project Public License, either version 1.3c 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.3b or later is part of all distributions of LaTeX -%% version 2006/01/07 or later. +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008/05/04 or later. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{hyperxmp} - [2006/05/21 v1.1 Store hyperref metadata in XMP format] + [2011/04/17 v1.2 Store hyperref metadata in XMP format] +\edef\hyxmp@dq@code{\the\catcode`\"} +\catcode`\"=12 \RequirePackage{keyval} \def\@pdfcopyright{} \define@key{Hyp}{pdfcopyright}{\pdfstringdef\@pdfcopyright{#1}} \def\@pdflicenseurl{} \define@key{Hyp}{pdflicenseurl}{\pdfstringdef\@pdflicenseurl{#1}} +\def\@pdfauthortitle{} +\define@key{Hyp}{pdfauthortitle}{\pdfstringdef\@pdfauthortitle{#1}} +\def\@pdfcaptionwriter{} +\define@key{Hyp}{pdfcaptionwriter}{\pdfstringdef\@pdfcaptionwriter{#1}} \newcommand*{\hyxmp@find@metadata}{% \ifx\@pdfauthor\@empty \ifx\@pdfcopyright\@empty \ifx\@pdfkeywords\@empty \ifx\@pdflicenseurl\@empty - \ifx\@pdfsubject\@empty - \ifx\@pdftitle\@empty - \PackageWarningNoLine{hyperxmp}{% + \ifx\@pdfauthortitle\@empty + \ifx\@pdfcaptionwriter\@empty + \ifx\@pdfsubject\@empty + \ifx\@pdftitle\@empty + \PackageWarningNoLine{hyperxmp}{% \jobname.tex did not specify any metadata to\MessageBreak include in the XMP packet.\space\space Please see the hyperxmp\MessageBreak documentation for instructions on how to provide\MessageBreak metadata values to hyperxmp% - }% + }% + \fi + \fi \fi \fi \fi @@ -421,6 +431,36 @@ _________\hyxmp@InstanceID^^J% ______^^J% }% } +\gdef\hyxmp@photoshop@schema{% + \def\hyxmp@photoshop@data{\@pdfauthortitle\@pdfcaptionwriter}% + \ifx\@hyxmp@photoshop@data\@empty + \else + \hyxmp@add@to@xml{% +______^^J% + }% + \fi + \ifx\@pdfauthortitle\@empty + \else + \hyxmp@xmlify{\@pdfauthortitle}% + \hyxmp@add@to@xml{% +_________\hyxmp@xmlified^^J% + }% + \fi + \ifx\@pdfcaptionwriter\@empty + \else + \hyxmp@xmlify{\@pdfcaptionwriter}% + \hyxmp@add@to@xml{% +_________\hyxmp@xmlified^^J% + }% + \fi + \ifx\@hyxmp@photoshop@data\@empty + \else + \hyxmp@add@to@xml{% +______^^J% + }% + \fi +} \bgroup \catcode`\^^ef=12 \catcode`\^^bb=12 @@ -435,6 +475,7 @@ ___^^ \hyxmp@pdf@schema \hyxmp@xapRights@schema \hyxmp@dc@schema + \hyxmp@photoshop@schema \hyxmp@mm@schema \hyxmp@add@to@xml{% ___^^J% @@ -454,14 +495,19 @@ ___^^J% \ifx\hyxmp@driver\Hy@driver \hyxmp@embed@packet@dvipdfm \else - \@ifundefined{pdfmark}{% - \PackageWarningNoLine{hyperxmp}{% - Unrecognized hyperref driver `\Hy@driver'.\MessageBreak - \jobname.tex's XMP metadata will *not* be\MessageBreak - embedded in the resulting file}% - }{% - \hyxmp@embed@packet@pdfmark - }% + \def\hyxmp@driver{hxetex}% + \ifx\hyxmp@driver\Hy@driver + \hyxmp@embed@packet@xetex + \else + \@ifundefined{pdfmark}{% + \PackageWarningNoLine{hyperxmp}{% + Unrecognized hyperref driver `\Hy@driver'.\MessageBreak + \jobname.tex's XMP metadata will *not* be\MessageBreak + embedded in the resulting file}% + }{% + \hyxmp@embed@packet@pdfmark + }% + \fi \fi \fi } @@ -544,6 +590,20 @@ ___^^J% \expandafter\hyxmp@count@non@spaces \fi } +\newcommand*{\hyxmp@embed@packet@xetex}{% + \special{pdf:stream @hyxmp@Metadata (\hyxmp@xml) + << + /Type /Metadata + /Subtype /XML + >> + }% + \special{pdf:put @catalog + << + /Metadata @hyxmp@Metadata + >> + }% +} +\catcode`\"=\hyxmp@dq@code \endinput %% %% End of file `hyperxmp.sty'. -- cgit v1.2.3