From 2d7b43b9c65926345b1e9114edc86016c75e5d71 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 13 May 2020 21:07:20 +0000 Subject: hyperxmp (13may20) git-svn-id: svn://tug.org/texlive/trunk@55130 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 66 +++++++++++++++++++---- 1 file changed, 56 insertions(+), 10 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 e538450b175..9aaa6b6e101 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} - [2020/04/08 v5.1 Store hyperref metadata in XMP format] + [2020/05/12 v5.2 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \def\hyxmp@driver{hpdftex} @@ -141,12 +141,15 @@ \define@key{Hyp}{pdfinstanceid}{\hyxmp@pdfstringdef\hyxmp@InstanceID{#1}} \def\@pdfversionid{1} \define@key{Hyp}{pdfversionid}{\hyxmp@pdfstringdef\@pdfversionid{#1}} +\begingroup +\let\ifdraft=\relax \RequirePackage{ifdraft} \ifdraft{% - \def\@pdfrendition{draft}% + \gdef\@pdfrendition{draft}% }{% - \def\@pdfrendition{default}% + \gdef\@pdfrendition{default}% } +\endgroup \define@key{Hyp}{pdfrendition}{\hyxmp@pdfstringdef\@pdfrendition{#1}} \def\@pdfpublication{} \define@key{Hyp}{pdfpublication}{\hyxmp@pdfstringdef\@pdfpublication{#1}} @@ -176,6 +179,8 @@ \define@key{Hyp}{pdfdoi}{\hyxmp@pdfstringdef\@pdfdoi{#1}} \def\@pdfurl{} \define@key{Hyp}{pdfurl}{\hyxmp@pdfstringdef\@pdfurl{#1}} +\def\@pdfidentifier{} +\define@key{Hyp}{pdfidentifier}{\hyxmp@pdfstringdef\@pdfidentifier{#1}} \def\@pdfsubtitle{} \define@key{Hyp}{pdfsubtitle}{\hyxmp@pdfstringdef\@pdfsubtitle{#1}} \def\@pdfcontactaddress{} @@ -299,6 +304,7 @@ \@pdfdatetime \@pdfdoi \@pdfeissn + \@pdfidentifier \@pdfisbn \@pdfissn \@pdfissuenum @@ -338,6 +344,7 @@ \gdef\@pdfapart{1}% \gdef\@pdfaconformance{B}% }% + {}% \fi \edef\hyxmp@standards{% \@pdfapart @@ -351,6 +358,7 @@ compliance)% }% }% + {}% }% } \AtBeginDocument{% @@ -569,7 +577,8 @@ \def\hyxmp@try@today#1#2{% \@ifmtargexp{\hyxmp@today@xmp}{% \@ifundefined{#1}{}{#2}% - }{}% + }% + {}% } \def\hyxmp@today@xmp{} \hyxmp@try@today{pdfcreationdate}{% @@ -841,6 +850,18 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified^^J% }% }% } +\newcommand*{\hyxmp@add@simple@pfx}[3]{% + \@ifnotmtargexp{#3}{% + \hyxmp@add@to@xml{\hyxmp@extra@indent______<}% + \xdef\hyxmp@xml{\hyxmp@xml#1}% + \hyxmp@pdfstringdef\hyxmp@iprefix{#2}% + \hyxmp@xmlify{\hyxmp@iprefix}% + \hyxmp@add@to@xml{>\hyxmp@xmlified}% + \hyxmp@xmlify{#3}% + \hyxmp@add@to@xml{\hyxmp@xmlified^^J}% + }% +} \def\hyxmp@alt@title{} \def\hyxmp@alt@description{} \def\hyxmp@alt@rights{} @@ -1020,19 +1041,28 @@ _______________________________________________________________^^J% \hyxmp@define@pdfproducer \fi } -\newcommand*{\hyxmp@pdf@schema}{% - \hyxmp@add@simple@var{pdf:Producer}{@pdfproducer}% - \hyxmp@add@simple@var{pdf:Keywords}{@pdfkeywords}% - \hyxmp@add@simple{pdf:Trapped}{\@pdftrapped}% +\newcommand*{\hyxmp@assign@major@minor}{% \@ifundefined{pdfvariable}{% \@ifundefined{pdfminorversion}{% }{% - \hyxmp@add@simple{pdf:PDFVersion}{1.\the\pdfminorversion}% + \xdef\hyxmp@major@minor{\the\pdfminorversion}% + \@ifundefined{pdfmajorversion}{% + \xdef\hyxmp@major@minor{1.\hyxmp@major@minor}% + }{% + \xdef\hyxmp@major@minor{\the\pdfmajorversion.\hyxmp@major@minor}% + }% }% }{% - \hyxmp@add@simple{pdf:PDFVersion}{1.\the\pdfvariable minorversion}% + \xdef\hyxmp@major@minor{\the\pdfvariable majorversion.\the\pdfvariable minorversion}% }% } +\newcommand*{\hyxmp@pdf@schema}{% + \hyxmp@add@simple@var{pdf:Producer}{@pdfproducer}% + \hyxmp@add@simple@var{pdf:Keywords}{@pdfkeywords}% + \hyxmp@add@simple{pdf:Trapped}{\@pdftrapped}% + \hyxmp@assign@major@minor + \hyxmp@add@simple@var{pdf:PDFVersion}{hyxmp@major@minor}% +} \newcommand*{\hyxmp@rdf@dc}[3][\iffalse]{% \@ifmtargexp{#3}{\@tempswafalse}{\@tempswatrue}% #1 @@ -1106,6 +1136,13 @@ ______^^J% }% } } +\newcommand*{\hyxmp@cond@dc@identifier}[2]{% + \ifx\hyxmp@xmlified\@empty + \@ifnotmtargexp{#2}{% + \hyxmp@add@simple@pfx{dc:identifier}{#1}{#2}% + }% + \fi +} \newcommand*{\hyxmp@dc@schema}{% \hyxmp@add@simple{dc:format}{application/pdf}% \hyxmp@rdf@dc[\ifHy@pdfa]{title}{\@pdftitle}% @@ -1121,6 +1158,15 @@ ______^^J% \else \hyxmp@add@simple{dc:source}{\@pdfsource}% \fi + \@ifmtargexp{\@pdfidentifier}{% + \let\hyxmp@xmlified=\@empty + \hyxmp@cond@dc@identifier{info:doi/}{\@pdfdoi}% + \hyxmp@cond@dc@identifier{urn:ISSN:}{\@pdfeissn}% + \hyxmp@cond@dc@identifier{urn:ISSN:}{\@pdfissn}% + \hyxmp@cond@dc@identifier{urn:ISBN:}{\@pdfisbn}% + }{% + \hyxmp@add@simple{dc:identifier}{\@pdfidentifier}% + }% } \newcommand*{\hyxmp@xmpRights@schema}{% \let\hyxmp@rights=\@empty -- cgit v1.2.3