From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/aeb_pro/aebxmp/README.md | 53 ++ macros/latex/contrib/aeb_pro/aebxmp/aebxmp.dtx | 812 +++++++++++++++++++++ macros/latex/contrib/aeb_pro/aebxmp/aebxmp.ins | 60 ++ .../contrib/aeb_pro/aebxmp/doc/aebxmp_man.pdf | Bin 0 -> 133445 bytes .../contrib/aeb_pro/aebxmp/doc/aebxmp_man.tex | 580 +++++++++++++++ .../aeb_pro/aebxmp/examples/aebxmp_test.pdf | Bin 0 -> 50399 bytes .../aeb_pro/aebxmp/examples/aebxmp_test.tex | 138 ++++ 7 files changed, 1643 insertions(+) create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/README.md create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/aebxmp.dtx create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/aebxmp.ins create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.pdf create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.tex create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.pdf create mode 100644 macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.tex (limited to 'macros/latex/contrib/aeb_pro/aebxmp') diff --git a/macros/latex/contrib/aeb_pro/aebxmp/README.md b/macros/latex/contrib/aeb_pro/aebxmp/README.md new file mode 100644 index 0000000000..668b93f019 --- /dev/null +++ b/macros/latex/contrib/aeb_pro/aebxmp/README.md @@ -0,0 +1,53 @@ +The aebxmp Package +Author: D. P. Story +Dated: 2017-02-17 + +This is a package that requies the document author to have the full Acrobat +application. In this case the dvips/Distiller, pdflatex, or xelatex workflow +may be use to create the PDF. + +The package provides commands for populating certain additional metadata, +beyond that already provided by hyperref. + +1. Commands to set the copyright status, notice, and url fields (as seen in the + Additional Metadata dialog accessed from the Document Properties > + Description tab. + +2. (v2.0) Added support for two other fields found in the Additional Metadata + dialog box: for populating Author Title and Description Writer. + +3. (v2.0) aebxmp also sets the value of Created as seen at the bottom of the + Additional Metadata dialog box + +4. (v2.0) aebxmp defines the \Authors command for setting multiple authors, + the authors are accessible separately using Doc.info.Authors. + +5. (v2.0) Finally, aebxmp defines a command for setting custom document + properties, this is seen on the Custom tab of the Document Properties + dialog box. + +6. (v2.2) Added a \Keywords command that takes a comma-delimited list + of keywords, and creates an array of keywords. These keywords can be + accessed individually using a special document-level JavaScript + function. + +7. (v2.3) Rewrote some of the code so that now the XMP package is set + using only E4X; removed all literal elements. + +8. (v2.3d) Added access functions getCopyrightStatus(), + getCopyrightInfoURL(), getAuthorTitle(), and getDescriptionWriter(). + +9. (v2.5) Extended aebxmp to include a non-Distiller workflow as long as + the document author has the Acrobat application. + +10. (v2.5a) Require insdljs dated 2016/07/31 to make colon syntax available. + Values of customProperties can use the colon notation. + +My other web site is http://www.acrotex.net/, follow my articles at +http://blog.acrotex.net. + +Now, I simply must get back to my retirement. + +D. P. Story +dpstory at acrotex dot net + diff --git a/macros/latex/contrib/aeb_pro/aebxmp/aebxmp.dtx b/macros/latex/contrib/aeb_pro/aebxmp/aebxmp.dtx new file mode 100644 index 0000000000..35f46a5a8f --- /dev/null +++ b/macros/latex/contrib/aeb_pro/aebxmp/aebxmp.dtx @@ -0,0 +1,812 @@ +%\iffalse +% makeindex -s gglo.ist -o web.gls web.glo +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% aebxmp.sty package, 2016-05-29 %% +%% Copyright (C) 2006--2016 D. P. Story %% +%% dpstory@uakron.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of %% +%% the License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{aebxmp} +% [2017/02/17 v2.5a Populate advanced metadata (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{aebxmp}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{aebxmp}{aebdocfmt.def cannot be found}} +\begin{document} +\def\CMD#1{\textbackslash#1} + \GetFileInfo{aebxmp.sty} + \title{AeBXMP: Updating XMP using E4X and {\LaTeX}} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \DocInput{aebxmp.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o aebxmp.ind aebxmp.idx} on the command line and recompile + \texttt{aebxmp.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o aebxmp.gls aebxmp.glo} on the command line and recompile + \texttt{aebxmp.dtx}.} +\end{document} +% +% \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{aebxmp}{Inputting aebdonotindex.def}} +% {\PackageInfo{aebxmp}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% \changes{v2.5}{2016/05/20}{Moved DJLS from \string\texttt{addScript} in \string\texttt{insDLJS} env.} +% \changes{v2.3c}{2012/09/20}{Changed \cs{copyrightNotice} and a +% added \cs{Title} and \cs{Subject}, and . These now accept multiple entries with a required +% language specification.Also defined the JavaScript arrays \texttt{aTitle}, \texttt{aSubject} +% \texttt{aRights}. Added \cs{sourceFile} to save the name of the source file in the +% DC packet. Added \cs{metaLang}, also to the DC packet.} +% \changes{v2.3a}{2012/01/12}{Set the \texttt{lang} attribute to a value of \texttt{x-default} +% for \cs{copyrightNotice}. Added a choice key to \cs{copyrightStatus} to force an +% acceptable argument.} +% \changes{v2.3}{2012/01/09}{All XMP elements now is inserted by E4X.} +% \changes{v2.2}{2012/01/04}{Added the \cs{Keywords} command for creating an array +% of keywords that can be accessed individually using the JavaScript function +% \texttt{aKeyWords}, also defined in this package.} +% \changes{v2.1a}{2011/12/30}{More code efficiencies} +% \changes{v2.1}{2011/12/30}{Cleaned up the code, fixed a bug.} +% \changes{v2.0}{2011/12/30}{Defined commands to producing custom document properties, +% defined the \cs{Authors} command.} +% \changes{v1.0}{2011/12/29}{Made a proper DTX file for this package; added +% \cs{authortitle} and \cs{descriptionwriter}; support for \texttt{xmp:CreateDate}.} +% \changes{v0.2}{2007/03/13}{Added support for unicode escape sequences in the +% \cs{copyrightNotice} and \cs{copyrightInfoURL} fields.} +% \changes{v0.1}{2006/12/01}{Original distribution} +% \begin{macrocode} +\RequirePackage{xkeyval} +\@ifpackageloaded{insdljs}{\let\execjs=y} +% \end{macrocode} +% (2017/02/17) Require 2016/07/31 for insdljs to make colon syntax available. +% \changes{v2.5a}{2017/02/17}{Require 2016/07/31 for insdljs} +% \begin{macrocode} + {\RequirePackage[execJS]{insdljs}[2016/07/31]} % incls conv-xkv +% \end{macrocode} +% \section{Utility commands and switches} +% \begin{macrocode} +\newif\if@xmp@several \@xmp@severaltrue +% \end{macrocode} +% The following is a utility command used in \cs{copyrightStatus}, \cs{Title}, +% and \cs{Subject}. +% \begin{macrocode} +\def\xmp@testBrace#1{\@ifnextchar\bgroup + {\@xmp@severaltrue#1}{\@xmp@severalfalse#1}} +% \end{macrocode} +% \cs{xmpLangAndArg} is used by the same commands listed above. These are the ones +% that have a language attribute. +% \begin{macrocode} +\newcommand{\xmpLangAndArg}[1][]{%x-default + \edef\xmpLang{#1}\xmpGetNextArg} +\def\xmpGetNextArg#1\@nil{\edef\xmpArg{#1}} +% \end{macrocode} +% A major utility command used by \cs{copyrightStatus}, \cs{Title}, +% and \cs{Subject}. \texttt{\#1} is the arguments of the calling command, +% and \texttt{\#2} is the ``array'' macro. +% \begin{macrocode} +\edef\xmp@dquoteCat{\the\catcode`\"} +\catcode`\"=12\relax +\def\xmp@ProcessArgs#1#2{% + \if@xmp@several + \@tfor\xmpArg:=#1\do{% + \expandafter\xmpLangAndArg\xmpArg\@nil + \ifnum\count0=0\relax + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="x-default";}% + \ifx\xmpLang\@empty\else + \advance\count0by1\relax + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="\xmpLang";}% + \fi + \else + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="\xmpLang";}% + \fi + \advance\count0by1\relax + }% + \else + \@tfor\xmpArg:={#1}\do{% + \expandafter\xmpLangAndArg\xmpArg\@nil + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="x-default";}% + \ifx\xmpLang\@empty\else + \advance\count0by1 + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="\xmpLang";}% + \fi + \advance\count0by1\relax + }% + \fi +} +\bgroup\obeyspaces +\gdef\tabiv{ }% +\egroup +% \end{macrocode} +% +% \section{Top-level Interface to Metadata} +% Through this package, the author can specify certain ``Advanced Metadata'' +% items: copyright notice; copyright notice; copyright url; author title; +% and writer description. +% +% \subsection{Dublin Core Properties} +% +% \begin{macro}{\copyrightNotice} +% The argument \texttt{\#1} is the text of the \textsf{Copyright Notice}, +% multiple languages supported. The first copyright notice is also tagged +% as the default, \texttt{x-default}. +%\begin{verbatim} +%\copyrightNotice{% +% {[lang_1] Copyright notice} +% {[lang_2] Copyright notice} +% ... +%} +%\end{verbatim} +% \begin{macrocode} +\let\arrayOfRights\@empty +\newcommand{\copyrightNotice}[1]{\def\xmpcopyrightNotice{#1}% + \xmp@testBrace{\xmp@cont@CopyRightNotice}#1\@nil}% +\let\xmpcopyrightNotice\@empty +% \end{macrocode} +% \cs{copyrightNotice} continues with \cs{xmp@cont@CopyRightNotice} +% \begin{macrocode} +\def\xmp@cont@CopyRightNotice#1\@nil{% + \begingroup\let\u\relax\count0=0\relax + \def\xmp@insItem{p.aebdc::rights.aebrdf::Alt.aebrdf::li}% + \ifx\xmpcopyrightNotice\@empty\else + \xmp@ProcessArgs{#1}{\arrayOfRights}% + \fi + \endgroup +} +% \end{macrocode} +% \begin{macro}{\Authors} +% Enter multiple authors using a token list +%\begin{verbatim} +%\Authors +%{% +% {D. P. Story} +% {A. P. Story} +% ... +%} +%\end{verbatim} +% We use \cs{@tfor} to build an array of authors, and use the simple mechanism +% of \texttt{this.info.Authors} to set the multiple authors. +% \begin{macrocode} +\let\arrayOfAuthors\@empty +\let\xmpAuthors\@empty +\newcommand{\Authors}[1]{\def\xmpAuthors{#1}% + \begingroup\let\u\relax\count0=0\relax + \def\insSeqItem{p.aebdc::creator.aebrdf::Seq.aebrdf::li}% + \ifx\xmpAuthors\@empty\else + \let\arrayOfAuthors\@gobble + \@tfor\xmpAuthor:=#1\do{% + \xdef\arrayOfAuthors{\arrayOfAuthors^^J% + \insSeqItem[\the\count0]="\xmpAuthor";}% + \advance\count0by1 + }% + \fi + \endgroup +} +\def\insertAuthors{\ifx\arrayOfAuthors\@empty\else + ^^J\arrayOfAuthors\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\Title} +% Allow multiple Titles, with language specification; syntax +%\begin{verbatim} +%\Title{% +% {[lang_1] Title} +% {[lang_2] Title} +% ... +%} +%\end{verbatim} +% Begin \cs{Title} +% \begin{macrocode} +\let\arrayOfTitles\@empty +\newcommand{\Title}[1]{\edef\xmpTitle{#1}% + \xmp@testBrace{\xmp@cont@Title}#1\@nil} +% \end{macrocode} +% continuation of \cs{Title} +% \begin{macrocode} +\def\xmp@cont@Title#1\@nil{% + \begingroup\let\u\relax\count0=0\relax + \def\xmp@insItem{p.aebdc::title.aebrdf::Alt.aebrdf::li}% + \ifx\xmpTitle\@empty\else + \xmp@ProcessArgs{#1}{\arrayOfTitles}% + \fi + \endgroup +} +\def\insertTitles{\ifx\arrayOfTitles\@empty\else + ^^J\arrayOfTitles\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\Subject} +% Allow multiple subjects, with language specification. +% Begin \cs{Subject} +% \begin{macrocode} +\let\arrayOfSubjects\@empty +\newcommand{\Subject}[1]{\edef\xmpSubject{#1}% + \xmp@testBrace{\xmp@cont@Subject}#1\@nil}% +% \end{macrocode} +% Continue \cs{Subject} +% \begin{macrocode} +\def\xmp@cont@Subject#1\@nil{% + \begingroup\let\u\relax\count0=0\relax + \def\xmp@insItem{p.aebdc::description.aebrdf::Alt.aebrdf::li}% + \ifx\xmpSubject\@empty\else + \xmp@ProcessArgs{#1}{\arrayOfSubjects}% + \fi + \endgroup +} +\def\insertSubjects{\ifx\arrayOfSubjects\@empty\else + ^^J\arrayOfSubjects\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\metaLang} +% A list of languages used in this document. +% \begin{macrocode} +\let\arrayOfLangs\@empty +\newcommand{\metaLang}[1]{\def\xmplangOfDoc{#1}% + \begingroup\let\u\relax\count0=0\relax + \def\insBagItem{p.aebdc::language.aebrdf::Bag.aebrdf::li}% + \ifx\xmpLangs\@empty\else + \let\arrayOfLangs\@gobble + \@for\xmpLang:=#1\do{% + \xdef\arrayOfLangs{\arrayOfLangs^^J% + \insBagItem[\the\count0]="\xmpLang";}% + \advance\count0by1 + }% + \fi + \endgroup +} +\def\insertLangs{\ifx\arrayOfLangs\@empty\else + ^^J\arrayOfLangs\fi} +% \end{macrocode} +% \end{macro} +% \DescribeMacro{\sourceFile} is used to insert the name of the source file +% in to the Dublin Core. By default \cs{jobname.tex} is used. If this command +% is not executed, \cs{jobname.tex} is used. If executed with +% an empty argument, no \texttt{dc:source} is not inserted at all. If executed +% with a nonempty argument, that argument is assumed to be a file name and is +% inserted as the value of the \texttt{dc:source}. +% \begin{macrocode} +\newcommand{\sourceFile}[1]{\let\xmp@bSourcefile=1 + \def\xmp@sourcefile{#1}} +\let\xmp@bSourcefile=0 +\let\xmp@sourcefile\@empty +\def\insertSource{% + \if\xmp@bSourcefile0 + ^^Jp.aebdc::source="\jobname.tex"\else + \ifx\xmp@sourcefile\@empty\else + ^^Jp.aebdc::source="\xmp@sourcefile"\fi\fi} +% \end{macrocode} +% \begin{macro}{\Keywords} +% We try to implement keywords in a manner similar to \cs{Authors}; that is, +% we want to reference each key word. The individual keywords are listed in +% \texttt{dc:subject}, in a \texttt{Bag}, an unordered array. +% \begin{macrocode} +\let\arrayOfKeywords\@empty +\let\aKeywords\@empty +\let\xmpKeywords\@empty +\newcommand{\Keywords}[1]{\def\xmpKeywords{#1}% + \begingroup\let\u\relax\count0=0\relax + \def\insBagItem{% + p.aebdc::subject.aebrdf::Bag.aebrdf::li}% + \ifx\xmpKeywords\@empty\else + \let\arrayOfKeywords\@gobble + \let\aKeywords\@gobbletwo + \@for\xmpKeyword:=#1\do{% + \xdef\arrayOfKeywords{\arrayOfKeywords^^J% + \insBagItem[\the\count0]="\xmpKeyword";}% + \xdef\aKeywords{\aKeywords;\space\xmpKeyword}% + \advance\count0by1 + }% + \xdef\aKeywords{"\aKeywords"}% + \fi + \endgroup +} +% \end{macrocode} +% \cs{insertKeywords} does what the other ``insert'' commands do, insert the +% code, we use the \texttt{dc:subject} tag, which corresponds to keywords. +% Used in the disposable code below. +% \begin{macrocode} +\def\insertKeywords{\ifx\arrayOfKeywords\@empty\else + ^^J\arrayOfKeywords\fi} +% \end{macrocode} +% \end{macro} +% We set the keywords using the JavaScript property \texttt{Doc.info}, rather +% than a pdfmark. We also optionally include document-level JS so the document +% user can access individual keywords. \DescribeMacro{\xmpDoNotInsKWScript}\cs{xmpDoNotInsKWScript} +% optionally turns off the insertion of the function \texttt{aKeywords()}. +% \begin{macrocode} +\let\xmpInsScript\@empty +\newcommand{\xmpDoNotInsKWScript}{\let\xmpInsScript\null} +% \end{macrocode} +%\subsection{XMP Rights Management Properties} +% \begin{macro}{\copyrightStatus} +%If \texttt{\#1} is \texttt{True}, the \textsf{Copyright Status} is set to +%\texttt{Copyrighted}; if \texttt{False}, \textsf{Copyright Status} is set +%to \textsf{Public Domain}. If left empty, the status is set to +%\textsf{Unknown}. +% \begin{macrocode} +\newcommand{\copyrightStatus}[1]{% + \setkeys{aebxmp}{copyrightstatus=#1}} +% \end{macrocode} +% We offer choices of \texttt{true}, \texttt{false}, or \texttt{unknown} (case insensitive) +% for the argument of \cs{copyrightStatus} +% \begin{macrocode} +\define@choicekey*+{aebxmp}{copyrightstatus}[\val\nr]% + {true,false,unknown}[unknown]{% + \ifcase\nr\relax + \def\xmpcopyrightStatus{True}\or + \def\xmpcopyrightStatus{False}\else + \let\xmpcopyrightStatus\@empty\fi +}{\PackageWarning{aebxmp}{% + Bad choice for \string\copyrightStatus,\MessageBreak + you entered '#1'.\MessageBreak + Permissible values are true, false, or unknown\MessageBreak + (or an empty argument). Setting status to 'unknown'.\MessageBreak + Try again,}} +\let\xmpcopyrightStatus\@empty +% \end{macrocode} +% \end{macro} +% \cs{insertMarked} inserts the copyright status and is used in the +% disposable code. It only if one has been declared. If none is declared, +% the copyright notice will be \texttt{Unknown}. +% \begin{macrocode} +\def\insertMarked{\ifx\xmpcopyrightStatus\@empty + \else^^Jp.aebxapRights::Marked="\xmpcopyrightStatus";\fi} +% \end{macrocode} +% \begin{macrocode} +\def\insertCopyrightNotice{\ifx\arrayOfRights\@empty\else + \arrayOfRights\fi} +% \end{macrocode} +% Insert copyright notice and specify the language attribute, which is +% \texttt{x-default}. Used in the disposable code below. +% \begin{macro}{\copyrightInfoURL} +% The argument \texttt{\#1} is the \textsf{URL} to the copyright information +% \begin{macrocode} +\newcommand{\copyrightInfoURL}[1]{\def\xmpcopyrightInfoURL{#1}} +\let\xmpcopyrightInfoURL\@empty +% \end{macrocode} +% Insert the web statement. Used in the disposable code below. +% \begin{macrocode} +\def\insertWebStatement{\ifx\xmpcopyrightInfoURL\@empty + \else^^Jp.aebxapRights::WebStatement="\xmpcopyrightInfoURL";\fi} +% \end{macrocode} +% \end{macro} +%\subsection{Acrobat Custom Properties} +% \begin{macro}{\customProperties} +%\begin{verbatim} +%\customProperties +%{ +% {name=dps,value=5} +% {name=jg,value=good} +% ... +%} +%\end{verbatim} +% \begin{macrocode} +\let\insertCusProps\@empty +\newcommand\customProperties[1]{\def\pdfx@cusProps{#1}% + \begingroup\let\u\relax + \@tfor\thisproperty:=#1\do{% + \edef\tmp@exp{\noexpand +% \end{macrocode} +% (2017/02/17) Values of \texttt{customProperties} can use the colon notation +% \changes{v2.5a}{2017/02/17}{Values of customProperties can use the colon notation} +% \begin{macrocode} + \cxkvsetkeys{pdfx@cusPropKV}{name,value,\thisproperty}}\tmp@exp + \xdef\insertCusProps{\insertCusProps^^J% +% \end{macrocode} +% We permit the use of \cs{u} the the value of the custom property, +% the name of the custom property should be a restricted XML name, basically +% \texttt{A-Z},\texttt{a-z}, and \texttt{0-9}. +% \begin{macrocode} + p.aebpdfx::\pdfx@KName="\pdfx@VValue";} + }% + \endgroup +} +% \end{macrocode} +% The \texttt{pdfx@cusPropKV} family has two keys, \texttt{name} and \texttt{value}. +% These keys are used in the command \cs{customProperties} defined above. +% \begin{macrocode} +\define@key{pdfx@cusPropKV}{name}[]{\def\pdfx@KName{#1}} +\define@key{pdfx@cusPropKV}{value}[]{\def\pdfx@VValue{#1}} +% \end{macrocode} +% \end{macro} +% We define a simple tabbing command \cs{tabiv} to use within the JavaScript. +% +% \subsection{XMP Core Properties} +% These are some helper macros that conditionally fill in metadata when it exists. +% All these commands are used internally; the document author has no reason to use them. +% \changes{v2.5}{2016/05/20}{Added the \string\texttt{ModifyDate} property} +% \begin{macrocode} +\def\insertCreateDate{^^Jp.@aebxap::CreateDate=createDateStr;% +^^Jp.@aebxap::ModifyDate=createDateStr;} +\def\xmpnEOL{\string\n\string\^^J} +% \end{macrocode} +% \subsection{Adobe Photoshop Properties} +% \begin{macro}{\authortitle} +% The \texttt{} (argument \texttt{\#1}) appears in the +% \textsf{Author Title} line on the \textsf{Advanced Metadata} dialog box. +% This is a \textbf{Photoshop} property. (See the Advanced category in the left +% panel.) +% \begin{macrocode} +\newcommand{\authortitle}[1]{\def\xmpauthortitle{#1}} +% \end{macrocode} +% \DescribeMacro{\authorTitle} is an alias for \cs{authortitle}. +% \begin{macrocode} +\let\authorTitle\authortitle +\let\xmpauthortitle\@empty +% \end{macrocode} +% Insert the author title. Used in the disposable code below. +% \begin{macrocode} +\def\insertAuthorTitle{\ifx\xmpauthortitle\@empty + \else^^Jp.aebphotoshop::AuthorsPosition="\xmpauthortitle";\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\descriptionwriter} +% The \texttt{} (argument \texttt{\#1}) appears in the +%\textsf{Description Writer} line on the \textsf{Advanced Metadata} dialog box. +%This is a \textbf{Photoshop} property. (See the Advanced category in the left +%panel.) +% \begin{macrocode} +\newcommand{\descriptionwriter}[1]{\def\xmpdescriptionwriter{#1}} +% \end{macrocode} +% \DescribeMacro{\descriptionWriter} is an alias for \cs{descriptionwriter}. +% \begin{macrocode} +\let\descriptionWriter\descriptionwriter +\let\xmpdescriptionwriter\@empty +% \end{macrocode} +% Insert the description writer. Used in the disposable code below. +% \begin{macrocode} +\def\insertDescriptionWriter{\ifx\xmpdescriptionwriter\@empty + \else^^Jp.aebphotoshop::CaptionWriter="\xmpdescriptionwriter";\fi} +% \end{macrocode} +% \end{macro} +% +% \section{Disposable JavaScript} +% Most of this package consists of a few new commands to populate the ``disposable'' +% JavaScript that is input as an \textsf{FDF} when the PDF file is first opened after distilling. +% This code does all the work. +% \par\medskip\noindent +% \cs{insertKWJS} expands to a JavaScript property assignment if there are \cs{aKeywords} +% is nonempty. +% \begin{macrocode} +\def\insertKWJS{\ifx\aKeywords\@empty\else + this.info.Keywords=\aKeywords;^^J\fi} +% \end{macrocode} +% When \textsf{pdflatex} is used (MiKTeX version), the package fails +% when \texttt{p.@xmlns::pdfx} is included. This seems to because the +% \textsf{pdflatex} version defines its own custom property. Haven't figured +% how to detect the presence of a custom property yet. +% \begin{macrocode} +%\edef\insertPDFX{\ifpdf\else p.@xmlns::pdfx=aebpdfx.uri;^^J\fi} +% \end{macrocode} +% Some namespace definitions +% \begin{macrocode} +\def\xNNS{new Namespace} +\def\xAdbNS{http://ns.adobe.com} +\def\xWiiiNS{http://www.w3.org} +\begin{execJS}{execXMP} +% \end{macrocode} +% Get the metadata from the current document. +% \begin{macrocode} +var meta=this.metadata; +var aebXMPData=new XML(meta); +% \end{macrocode} +% Define the needed namespaces +% \begin{macrocode} +var aebx=\xNNS("x","adobe:ns:meta/"); +var xmlns=\xNNS("xmlns","\xWiiiNS/2000/xmlns/"); +var xml=\xNNS("xml", "\xWiiiNS/XML/1998/namespace"); +var aebrdf=\xNNS("rdf","\xWiiiNS/1999/02/22-rdf-syntax-ns#"); +var aebdc=\xNNS("dc","http://purl.org/dc/elements/1.1/"); +var aebpdf=\xNNS("pdf","\xAdbNS/pdf/1.3/"); +var aebxap=\xNNS("xmp","\xAdbNS/xap/1.0/"); +var aebxapRights=\xNNS("xmpRights","\xAdbNS/xap/1.0/rights/"); +var aebphotoshop=\xNNS("photoshop","\xAdbNS/photoshop/1.0/"); +var aebpdfx=\xNNS("pdfx","\xAdbNS/pdfx/1.3/"); +% \end{macrocode} +% \begin{macrocode} +var p=aebXMPData.aebrdf::RDF.aebrdf::Description; +% \end{macrocode} +% The MiKTeX version of \textsf{pdflatex} places a custom property at the creation +% of the PDF. We detect whether any custom properties already exist, if they do, +% don't emit \texttt{p.@xmlns::pdfx=aebpdfx.uri}, otherwise, an exception it thrown +% when the metadata is updated at the end of this code. +% \begin{macrocode} +if ( p.@aebpdfx::*.toString() == "" ) p.@xmlns::pdfx=aebpdfx.uri; +p.@xmlns::photoshop=aebphotoshop.uri; +p.@xmlns::xmpRights=aebxapRights.uri; +% \end{macrocode} +% The creation date shall be the time this \textsf{FDF} is imported into the document. +% \begin{macrocode} +var d=new Date(); +var createDateStr=util.printd("yyyy-mm-ddTHH:MM:ss",d); +% \end{macrocode} +% We delete the element, in case it already has a value (unlikely), the we +% assign it our value. +% \begin{macrocode} +delete p.@aebdc::rights.aebrdf::Alt.aebrdf::li; +% \end{macrocode} +% \paragraph*{Dublin Core Properties +% (\texttt{dc}, \begin{NoHyper}\url{http://purl.org/dc/elements/1.1/}\end{NoHyper})}\strut\\ +% Core properties include \texttt{dc:format}, \texttt{dc:title}, +% \texttt{dc:rights}, \texttt{dc:creator}, and \texttt{dc:subject} (aka, keywords). +% Here, we set \texttt{dc:rights}, called \textsf{Copyright Notice} in the user interface. +% \begin{macrocode} +/* + Dublin Core Properties +*/% +\insertTitles% +\insertAuthors% +\insertSubjects% +\insertKeywords% +\insertLangs% +\insertSource% +\insertCopyrightNotice% + +% \end{macrocode} +% We delete all old values of \texttt{xapRights:Marked} and \texttt{xap:WebStatement}, +% and replace them with the new values. +% \begin{macrocode} +/* + XMP Rights Management Properties +*/ +delete p.@aebxapRights::Marked; +delete p.@aebxapRights::WebStatement;% +% \end{macrocode} +% Now we insert additional properties, if there are any +% \begin{macrocode} +% \end{macrocode} +% \paragraph*{XMP Rights Management}\strut\\(\texttt{xmpRights}, +% \begin{NoHyper}\url{http://ns.adobe.com/xap/1.0/rights/}\end{NoHyper})\\ +% These include \texttt{xmpRights:Marked} and \texttt{xmpRights:WebStatement}, both of which +% are set. +% \begin{macrocode} +\insertMarked% +\insertWebStatement% + +% \end{macrocode} +% \paragraph*{Adobe Photoshop Properties}\strut\\(\texttt{photoshop}, +% \begin{NoHyper}\url{http://ns.adobe.com/photoshop/1.0/}\end{NoHyper})\\ +% These include \texttt{photoshop:AuthorsPosition} and \texttt{photoshop:CaptionWriter}, both of which +% are set. +% \begin{macrocode} +delete p.@aebphotoshop::AuthorsPosition; +delete p.@aebphotoshop::CaptionWriter; +delete p.@aebxap::CreateDate; +/* + Adobe Photoshop Properties +*/% +\insertAuthorTitle% +\insertDescriptionWriter% + +% \end{macrocode} +% \paragraph*{Acrobat Custom Properties} (\texttt{pdfx}, +% \begin{NoHyper}\url{http://ns.adobe.com/pdfx/1.3/}\end{NoHyper})\\ +% Adobe allows the creation of custom properties that are accessible +% through the \texttt{Doc.info} object. +% \begin{macrocode} +/* + Acrobat Custom Properties +*/% +\insertCusProps% + +% \end{macrocode} +% \paragraph*{XMP Core Properties} (\texttt{xmp}, +% \begin{NoHyper}\url{http://ns.adobe.com/xap/1.0/}\end{NoHyper})\\ +% These properties include \texttt{xmp:CreatorTool}, +% \texttt{xmp:ModifyDate}, \texttt{xmp:CreateDate}, and \texttt{xmp:MetadataDate}. +% Here we set only \texttt{CreateDate}. +% \begin{macrocode} +/* + XMP Core Properties +*/% +\insertCreateDate% + +% \end{macrocode} +% Convert \texttt{aebXMPData} into a string +% \begin{macrocode} +/* + Convert aebXMPData into an XML String + and save is as this.metadata +*/ +var aebNewXMPStr=aebXMPData.toXMLString(); +% \end{macrocode} +% and assign it to the document metadata +% \begin{macrocode} +try { this.metadata=aebNewXMPStr; } + catch(e) {console.println(e.toString());} +% \end{macrocode} +% Insert a JavaScript assignment for keywords. +% \begin{macrocode} +\insertKWJS% +\end{execJS} +% \end{macrocode} +% +% \section{Document JavaScript} +% +% This definition environment defines four functions and four arrays. +% The functions are used to build the arrays. The arrays are user accessible, +% they are \texttt{aKeywords}, \texttt{aTitle}, \texttt{aSubject}, and \texttt{aRights}. +% \begin{macrocode} +\ifx\xmpInsScript\@empty +\begin{insDLJS}{xmpjs}{Access to Title, Subject, and Keywords} +function getKeywordsXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + return p.aebdc::subject.aebrdf::Bag.aebrdf::li[i]; +} +var i=0; +var aKeywords=new Array(); +while ( typeof getKeywordsXMP(i)!="undefined" ) { + aKeywords[i]=getKeywordsXMP(i).toString(); i++; +} +function getTitleXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var uriXML="http://www.w3.org/XML/1998/namespace"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var xml=new Namespace("xml",uriXML); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + var retnStr; + try { retnStr="[" + p.aebdc::title.aebrdf::Alt.aebrdf::li[i].% +@xml::lang.toString()+"]: " + + p.aebdc::title.aebrdf::Alt.aebrdf::li[i].toString(); + } catch(e) { retnStr="undefined" }; + return retnStr; +} +var i=0; +var aTitle=new Array(); +while ( getTitleXMP(i)!="undefined" ) { + aTitle[i]=getTitleXMP(i); i++; +} +function getSubjectXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var uriXML="http://www.w3.org/XML/1998/namespace"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var xml=new Namespace("xml",uriXML); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + var retnStr; + try { retnStr="[" + p.aebdc::description.aebrdf::Alt.aebrdf::li[i].% +@xml::lang.toString()+"]: " + + p.aebdc::description.aebrdf::Alt.aebrdf::li[i].toString(); + } catch(e) { retnStr="undefined" }; + return retnStr; +} +var i=0; +var aSubject=new Array(); +while ( getSubjectXMP(i)!="undefined" ) { + aSubject[i]=getSubjectXMP(i); i++; +} +function getRightsXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var uriXML="http://www.w3.org/XML/1998/namespace"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var xml=new Namespace("xml",uriXML); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + var retnStr; + try { retnStr="["+ p.aebdc::rights.aebrdf::Alt.aebrdf::li[i]% +.@xml::lang.toString()+"]: " + + p.aebdc::rights.aebrdf::Alt.aebrdf::li[i].toString(); + } catch(e) { retnStr="undefined" }; + return retnStr; +} +var i=0; +var aRights=new Array(); +while ( getRightsXMP(i)!="undefined" ) { + aRights[i]=getRightsXMP(i); i++; +} +function getCopyrightStatus() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriXAP="http://ns.adobe.com/xap/1.0/rights/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebxapRights=new Namespace("xmpRights",uriXAP); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::xmpRights=aebxapRights.uri; + var copyrightStatus = p.@aebxapRights::Marked; + if ( copyrightStatus=="True" ) + return "Copyrighted"; + else if ( copyrightStatus=="False" ) + return "Public Domain"; + else return "Unknown"; +} +function getCopyrightInfoURL() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriXAP="http://ns.adobe.com/xap/1.0/rights/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebxapRights=new Namespace("xmpRights",uriXAP); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::xmpRights=aebxapRights.uri; + var copyrightInfoURL=(p.@aebxapRights::WebStatement.toString()!="")? + (p.@aebxapRights::WebStatement):"Not provided"; + return copyrightInfoURL; +} +function getAuthorTitle() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriPhotoshop="http://ns.adobe.com/photoshop/1.0/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebPhotoshop=new Namespace("photoshop",uriPhotoshop); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::photoshop=aebPhotoshop.uri; + var authorTitle=(p.@aebPhotoshop::AuthorsPosition.toString()!="")? + (p.@aebPhotoshop::AuthorsPosition):"Not provided"; + return authorTitle; +} +function getDescriptionWriter() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriPhotoshop="http://ns.adobe.com/photoshop/1.0/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebPhotoshop=new Namespace("photoshop",uriPhotoshop); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::photoshop=aebPhotoshop.uri; + var captionWriter=(p.@aebPhotoshop::CaptionWriter.toString()!="")? + (p.@aebPhotoshop::CaptionWriter):"Not provided"; + return captionWriter; +} +\end{insDLJS} +\fi +\catcode`\"=\xmp@dquoteCat +% \end{macrocode} +% \begin{macrocode} +% +% \end{macrocode} +\endinput + +p.aebdc::description.aebrdf::Alt.aebrdf::li[0]="Euro \u20AC"; +p.aebdc::description.aebrdf::Alt.aebrdf::li[0].@xml::lang="x-default"; diff --git a/macros/latex/contrib/aeb_pro/aebxmp/aebxmp.ins b/macros/latex/contrib/aeb_pro/aebxmp/aebxmp.ins new file mode 100644 index 0000000000..79ee0a1818 --- /dev/null +++ b/macros/latex/contrib/aeb_pro/aebxmp/aebxmp.ins @@ -0,0 +1,60 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 2006-2012 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed 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. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2011/12/29} +\def\batchfile{aebxmp.ins} + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate +{% + \file{aebxmp.sty}{\from{aebxmp.dtx}{copyright,package}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.pdf b/macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.pdf new file mode 100644 index 0000000000..63ab122658 Binary files /dev/null and b/macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.pdf differ diff --git a/macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.tex b/macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.tex new file mode 100644 index 0000000000..8abc26b96d --- /dev/null +++ b/macros/latex/contrib/aeb_pro/aebxmp/doc/aebxmp_man.tex @@ -0,0 +1,580 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv, + forcolorpaper,tight*,latextoc,pro}, + eforms,aebxmp +]{aeb_pro} +\usepackage{aeb_mlink} +\usepackage{graphicx,array} +%\usepackage{myriadpro} +%\usepackage[usecmtt]{myriadpro} +\usepackage[altbullet]{lucidbry} + +%\usepackage{makeidx} +%\makeindex +\usepackage{acroman} +\usepackage[active]{srcltx} + +\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$} +\def\meta#1{\textit{\texttt{#1}}} +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\pkg\textsf +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\let\uif\textsf + +\edef\amtIndent{\the\parindent} %\leftmargini +\def\SUB#1{${}_{\text{#1}}$} + +\newdimen\aebdimen \aebdimen\abovedisplayskip +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} + +\def\cmdtitle#1{\texorpdfstring{\protect\cs{#1}}{\textbackslash{#1}}} + +%\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom +%\screensize{6.5in}{5in} % height, width + +\university{\AcroTeX.Net} +\title{The aebXMP Package\texorpdfstring{\\[1em]}{: }Updating XMP using E4X and {\LaTeX}} +\author{D. P. Story} +\Authors{{D. P. Story}{J\u00FCrgen Gilg}} +\subject{Documentation of the AeBXMP Package} +\Keywords{XMP,E4X,Adobe Acrobat,JavaScript} +\email{dpstory@acrotex.net} +\version{2.5a, 2017/02/17} +\talksite{\url{www.acrotex.net}} +\copyrightStatus{True} +\copyrightNotice{Copyright (C) 2006-\the\year, D. P. Story} +\copyrightInfoURL{http://www.acrotex.net} +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=J\u00FCrgen Gilg} +} + +\DeclareInitView{windowoptions=showtitle} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\def\AcroTeX{Acro\negthinspace\TeX} + +\makeatletter +\@mparswitchfalse\reversemarginpar +\makeatother + +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.5em}} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\newcommand{\aebDescriptionlabel}[1]{% + \setlength\dimen@{\amtIndent+\labelsep}% + {\hspace*{\dimen@}#1}} +\makeatother +\newenvironment{aebDescript} + {\begin{list}{}{\setlength{\labelwidth}{0pt}% + \setlength{\leftmargin}{\leftmargin}% + \setlength{\leftmargin}{\leftmargin+\amtIndent}% + \setlength\itemindent{-\leftmargin}% + \let\makelabel\aebDescriptionlabel + }}{\end{list}} + +%\pagestyle{empty} +%\parindent0pt\parskip\medskipamount + + +\definePath\bgPath{"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_AeB.pdf"} +\begin{docassembly} +\addWatermarkFromFile({ + bOnTop:false, + cDIPath:\bgPath +}); +\executeSave(); +\end{docassembly} + + +\begin{document} + +\maketitle + +\changelinkcolorto{black} + +\tableofcontents + +\changelinkcolorto{webgreen} + + +\section{Introduction} + +The motivation for the development of this package came from +Herr~J\"{u}rgen Gilg, who had a need to fill in the metadata fields +beyond those normally populated by using \pkg{hyperref}: +\textsf{Title}, \textsf{Author}, \textsf{Subject} and +\textsf{Keywords}. Of particular interest to him were the metadata +fields \textsf{Copyright Status}, \textsf{Copyright Notice} and +\textsf{Copyright Info URL}. + +After doing some research on the CTAN archives, I came across the +\textsf{hyperxmp} package by Scott Pakin.\begin{NoHyper}\footnote{The reader is +invited to read the documentation of the \textsf{hyperxmp}, as +contained therein is a good discussion of XMP (eXtensible Metadata +Platform).}\end{NoHyper} The package works well with \textsf{pdftex} and +\textsf{dvipdfm}, but has a bit of a problem when using the +distiller. For this reason, I sought my own solution to the problem. + +As a beta tester of \app{Acrobat~8 Professional}, I had the opportunity to +use some of the new capabilities of the JavaScript interpreter as an +alternate approach to the one used by Mr.~Patkin. The JavaScript +version~1.6 interpreter, the one used in version 8, comes with E4X, +an XML parser, built in. I could see that E4X could be exploited to +manipulate the XMP data, and this was my approach. + +\section{Requirements} + +The techniques used by the \textsf{aebxmp} package to update the XMP data +require the \textcolor{blue}{{\AcroTeX} eDucation Bundle} (AeB), freely +available from \url{www.acrotex.net}. Because E4X is used, we also require +\app{Acrobat~8 Pro} or later, and, since you have \textsf{Acrobat~8} or +later, my \LaTeX ing friend, this package will work for you with all +workflows: \app{dvips/Distiller}, \app{pdflatex} (including \app{lualatex}), +and \app{xelatex}. To emphasize, for non-\app{Distiller} workflow, the full +\app{Acrobat} application is still required to be your default {\PDF} viewer +on your own computer. + +\section{The Test File} + +The package \textsf{aebxmp} has a simple test file, +\textsf{aebxmp\_test.tex}, which is found in the \texttt{examples} folder. +After you build the {\PDF} and open the document in \app{Acrobat} for the first time, +the new metadata is imported; \marginpar{\raggedleft save the document}\emph{it is important to save the document} after +the data is imported. + +To use this package, you must have, in addition to Acrobat~8 Pro (or later), +installed on your computer a standard {\TeX} system, including the +latest version of AeB.\footnote{AeB can be downloaded from any CTAN +server, from \url{www.math.uakron.edu/~dpstory/webeq.html}, or from +\url{www.acrotex.net}.} + +\section{Metadata} + +The \pkg{hyperref} package provides basic metadata support, providing +a mechanism for providing the title, author, subject, and keywords. Beyond +these, we can include additional metadata. + +\subsection{Author, Author} + +The \pkg{hyperref} package allows you to specify an author or authors; +the \textsf{Web} package uses this through the \cs{title} command, which +passes its argument on to \pkg{hyperref} of inclusion in the PDF Info +dictionary. The authors names are not individually assessable through +JavaScript. In Acrobat~9, I believe, the JavaScript API includes the +\texttt{Doc.info.Authors} property, its value is an array of authors, +We can access each author using array notation: First author is +\texttt{this.info.Authors[0]}, second author is +\texttt{this.info.Authors[1]}, and so on. The number of authors is +obtained using the length property of arrays, \texttt{this.info.Authors.length}. + +The \pkg{aebxmp} interface to this is through the \cs{Authors} command. It takes +a list of authors, each enclosed in braces, no commas (,) between the +authors. Like so: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\Authors{{D. P. Story}{J\u00FCrgen Gilg}} +\end{Verbatim} +Using \cs{Authors} will overwrite the author(s) named in the \cs{author} +command (of \pkg{web}), or more generally, passed to +\cs{hypersetup\darg{pdfauthor=\darg{\anglemeta{author}}}} of +\pkg{hyperref}.\begin{NoHyper}\footnote{This may be to your advantage when +using \textsf{Web}; the value of \cs{author} is used to display the author(s) +of the document, you may want to present the names one way on the title page, +for example, and another way in the \textsf{Description} tab of the +\textsf{Document Properties} dialog box.}\end{NoHyper} + +If you do use \cs{Authors} and overwrite the author(s) as passed through +\pkg{hyperref}, the first author listed will be the one returned by +\texttt{this.info.Author} (a JavaScript property) in the \uif{Document +Properties} dialog box (\texttt{Ctrl+D}), all authors are listed in a +semi-colon delimited list. + + +\subsection{The \texorpdfstring{\cs{Keywords}}{\textbackslash{Keywords}} Command} + +The \cs{Authors} command utilizes \texttt{Doc.info.Authors}, which takes +an array of authors names. There is no such property available for +\texttt{Doc.info.Keywords}, the value of this property takes only a string +of keywords. The keywords are stored by Acrobat in three ways, +(1) \texttt{pdf:Keywords}; (2) in the \textbf{Info} dictionary; and (3) in +\texttt{dc:subject}. In the latter case, \texttt{dc:subject} takes a \texttt{Bag} +of subjects (keywords). A \texttt{Bag}, in XMP parlance, is an unordered array. + +The command \cs{Keywords} takes a comma delimited list of keywords. Notice +the word is capitalized to distinguish it from \cs{keywords}, which is +defined in the \textsf{Web} package as the interface to inserting the +keywords, via \pkg{hyperref}, into the \textbf{Info} dictionary. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\Keywords{AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript} +\end{Verbatim} +The command takes each comma-delimited list of keywords and +inserts each into the \texttt{dc:subject} part of the metadata. +For this document, the keywords appear in the XML metadata as +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] + + + AcroTeX.Net + XMP + E4X + Adobe Acrobat + JavaScript + + +\end{Verbatim} +When the document is first opened, the following command is executed +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +this.info.Keywords="AcroTeX.Net; XMP; E4X; Adobe Acrobat; JavaScript" +\end{Verbatim} +Here, I have broken the string across lines for readability. This inserts +the same list of keywords into the \textbf{Info} dictionary. + +When you executed \texttt{this.info.Keywords} in the console, you'll get +% +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +AcroTeX.Net; XMP; E4X; Adobe Acrobat; JavaScript +\end{Verbatim} +as expected. + +To access the individual keywords, I've defined an array of keywords, +\texttt{aKeywords}. It takes as its argument the index of the +keyword you want to get; For example, executing \texttt{aKeywords[0]} in +the console returns a value of \texttt{"AcroTeX.Net"}, while +\texttt{aKeywords[4]} returns a value of \texttt{"JavaScript"}. If you +execute \texttt{aKeywords[5]}, a value of \texttt{undefined} is returned. +The number of keywords is \texttt{aKeywords.length}. + +Listing the keywords may be of interest to someone, it is an exercise to +me.\begin{NoHyper}\footnote{Actually, this is the way \textbf{Acrobat} handles a +comma-delimited list of keywords when the words are entered through +the user interface; it puts them in a \texttt{Bag}.}\end{NoHyper} + +The command \cs{xmpDoNotInsKWScript}, when expanded in the preamble, will +turn off the creation of the array \texttt{aKeywords}. + +\subsection{Additional Metadata} + +As mentioned previously, the \pkg{aebxmp} package addresses three areas of +interest: Setting the \uif{Copyright Status}, \uif{Copyright Notice}, and the +\textsf{Copyright Info URL}. Obviously, other elements of the XMP can be +addressed. To that end, the \pkg{aebxmp} package defines five new {\LaTeX} +commands to populate the values of the five metadata fields \textsf{Copyright +Status}, \uif{Copyright Notice}, \uif{Copyright Info URL}, \uif{Author +Title}, and \uif{Writer Description}. Values for the arguments of these +commands are documented below. +\begin{description} +\item[\cs{copyrightStatus\darg{True|False}}:] If \texttt{True}, + \uif{Copyright Status} is set to \texttt{Copyrighted}; if + \texttt{False}, \textsf{Copyright Status} is set to \uif{Public + Domain}. If left empty, the status is set to \uif{Unknown}. + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getCopyrightStatus()} + is available. The function returns the copyright status: + \texttt{Copyrighted}, \texttt{Public Domain}, and \texttt{Unknown}. + +\item[\cs{copyrightNotice\darg{\anglemeta{text}}}:] The \anglemeta{text} of + the \textsf{Copyright Notice} is defined + +\item[\cs{copyrightInfoURL\darg{\anglemeta{URL}}}:] The \anglemeta{URL} to + the copyright information + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getCopyrightInfoURL()} + is available. The function returns the copyrightinfo URL (\anglemeta{URL}). + +\item[\cs{authortitle\darg{\anglemeta{text}}}:] The \anglemeta{text} appears + in the \textsf{Author Title} line on the \textsf{Additional Metadata} + dialog box. This is a \uif{Photoshop} property. (See the \uif{Advanced} + category in the left panel.) + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getAuthorTitle()} + is available. The function returns the authortitle (\anglemeta{text}). + +\item[\cs{descriptionwriter\darg{\anglemeta{text}}}:] The \anglemeta{text} + appears in the \textsf{Description Writer} line on the \uif{Additional + Metadata} dialog box. This is a \uif{Photoshop} property. (See the + \uif{Advanced} category in the left panel.) + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getDescriptionWriter()} + is available. The function returns the descriptionwriter (\anglemeta{text}). + +\end{description} + +\newtopic\noindent +For example, for this document, we have in the preamble, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\copyrightStatus{True} +\copyrightNotice{Copyright (C) 2006-\the\year, D. P. Story} +\copyrightInfoURL{http://www.acrotex.net} +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} +\end{Verbatim} +Enter unicode (\cs{uXXXX}) directly into the \cs{copyrightNotice} and \cs{copyrightInfoURL} fields; for example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\copyrightNotice{Copyright (C) 2006-\the\year, J\u00FCrgen Gilg} +\end{Verbatim} +Unicode can be used all the metadata commands discussed in the manual. + +The \cs{copyrightNotice} can take multiple arguments, one for each +language. The syntax is +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont,commandchars=!()] +\copyrightNotice{% + {[!anglemeta(lang!SUB(1))] copyright in this language} + {[!anglemeta(lang!SUB(2))] copyright in this language} + ... +} +\end{Verbatim} +The first copyright item listed is also counted as the default language +and will be marked as \texttt{x-default} as the value of the +\texttt{xml:lang} attribute. Contrary to {\LaTeX} custom, the brackets do +not indicate optional arguments, they are required except for the first +item in the list. Each group, which are enclosed in braces +(\texttt{\{\}}), represents a copyright notice; the part enclosed on +brackets (\texttt{[]}) contains the language designator. This is a +two-letter code to indicate the language; it can also have a sub-tag to +indicate a country (see \texttt{en-US} in example below). See the ISO +639-1 standard, and the RFC 3066 standard, referenced at the end of the +manual, for more information on language codes. + +For example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\copyrightNotice{% + {[en-US]Copyright (C) \the\year, D. P. Story} + {[fr]Copyright (C) \the\year, D. P. Story} + {[de]Copyright (C) \the\year, D. P. Story} +} +\end{Verbatim} + +There is also a \cs{sourceFile} command that takes one argument. If +\cs{sourceFile} does not appear in the preamble, the \cs{jobname.tex} is +written to the metadata (as part of the Dublin Core Properties). If +\verb!\sourceFile{}! is expanded in the preamble, no source file data will +be inserted into the metadata. Finally, executing the command +\verb!\sourceFile{hw01_1100.tex}! causes the string +\texttt{hw01\_1100.tex} to be written as the value of the +\texttt{dc:source} key. + + +\subsection{\texorpdfstring{\cs{Title}, \cs{Subject}, and \cs{metaLang}} + {\textbackslash{Title}, \textbackslash{Subject}, \textbackslash{metaLang}}} + +The Title and Subject keys can also be recorded with alternate languages; +for this reason, \textsf{aebxmp} defines \cs{Title} and \cs{Subject}. +The syntax of these two are similar to \cs{copyrightNotice}, described +above +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +\Title{% + {[!anglemeta(lang!SUB(1))] title in this language} + {[!anglemeta(lang!SUB(2))] title in this language} + ... +} +\Subject{% + {[!anglemeta(lang!SUB(1))] subject in this language} + {[!anglemeta(lang!SUB(2))] subject in this language} + ... +} +\end{Verbatim} +The first one listed is also designated as the default language, marked +with \texttt{x-default}. + +For example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\Title{% + {[en-US]Testing the aebxmp Package} + {[fr]Test du paquet aebxmp} + {[de]Testen des aebxmp Pakets} +} +\Subject{% + {[en-US]Test file for using E4X to update the XMP Data Model} + {[fr]Fichier de test utilisant E4X pour mettre à jour + le modèle de données XMP} + {[de]Testdatei für die Verwendung von E4X, um das XMP Daten + Modell zu aktualisieren} +} +\end{Verbatim} +Note that literal characters such as \texttt{\"{u}} are also +recognized so that unicode is not needed here. + +The arrays \texttt{aTitle} and \texttt{aSubject} are defined in the +document, unless the command \cs{xmpDoNotInsKWScript} is executed in the +preamble. For example, if you executed \texttt{aTitle[0]} in the console +(or part of a JavaScript action of a button), the array element is seen to +be \texttt{"[x-default]:\,Testing the aebxmp Package"}, while +\texttt{aTitle[1]} is \texttt{"[en-US]:\,Testing the aebxmp Package"}. The +array \texttt{aSubject} behaves similarly. + +The data passed by \cs{Title} and \cs{Subject} overrides the data passed +by the \textsf{web} commands \cs{title} and \cs{subject}, and overrides +the data passed by the \pkg{hyperref} keys \texttt{pdftitle} and +\texttt{pdfsubject}. + +Special characters need to be entered using unicode (\cs{uXXXX}), not the +octal or unicode generated by \pkg{hyperref}. Do not use {\LaTeX} +markup that expands to special characters inside the arguments of any of +the commands defined in this package. + +The \cs{metaLang} command allows you to document the languages used in +the metadata. Multiple languages may be specified. +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +\metaLang{!anglemeta(lang!SUB(1)),!anglemeta(lang!SUB(2)),..,!anglemeta(lang!SUB(n))} +\end{Verbatim} +For example +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\metaLang{en,en-US,fr,de} +\end{Verbatim} + + +\subsection{Custom Document Properties} +You can define custom properties using the \cs{customProperties} command. +\bVerb +\begin{minipage}{.5\linewidth} +\def\1{\textbf{Standard Syntax}}% +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +!1 +\customProperties +{% + {name=!anglemeta(name!SUB(1)),value=!anglemeta(value!SUB(1))} + {name=!anglemeta(name!SUB(2)),value=!anglemeta(value!SUB(2))} +} +\end{Verbatim} +\end{minipage}\hfil +\begin{minipage}{.5\linewidth} +\def\1{\textbf{Colon Syntax}}% +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +!1 +\customProperties +{% + {name:!anglemeta(name!SUB(1)),value:!anglemeta(value!SUB(1))} + {name:!anglemeta(name!SUB(2)),value:!anglemeta(value!SUB(2))} +} +\end{Verbatim} +\end{minipage} +\eVerb +The `colon' syntax is also recognized, but do not mix the two syntaxes together, use either all equal signs or all colons. + +The value of the \texttt{name} key requires a unique name, which must not +be one of the standard property names \texttt{Title}, \texttt{Author}, \texttt{Subject}, \texttt{Keywords}, +\texttt{Creator}, \texttt{Producer}, \texttt{CreationDate}, \texttt{ModDate}, and +\texttt{Trapped}. The value of \texttt{name} shall consist of the +characters \texttt{A--Z}, \texttt{a--z}, and \texttt{0--9}, and beginning with a +letter. The value may contain unicode, for example, in the preamble of +this document we have, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=J\u00FCrgen Gilg} +} +\end{Verbatim} +Instead of unicode, this same set of custom properties can be defined as +follows: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=Jürgen Gilg} +} +\end{Verbatim} +That is, using literal characters, if your editor supports it. + +The properties may be accessed through the \texttt{info} property of the +\texttt{Doc} object. The button (on the left) \marginpar{\hfill\pushButton[\TU{Press to see the document +properties}\CA{Info} +\A{\JS{% + console.show();\r + console.clear();\r + for (var o in this.info)\r\t + console.println("info."+o+"="+this.info[o]);\r + if (aKeywords!=undefined) {\r\t + console.println("List Keywords:");\r\t + for (var i=0; i< aKeywords.length; i++){\r\t\t + console.println(" "+aKeywords[i]);\r\t + }\r + } +}}]{info}{}{11bp}} +opens the console debugger window and displays all the document +properties. + + +The custom properties may be viewed using the user interface; press +\texttt{Ctrl+D} and choose the \textsf{Custom} tab. + +For more information on this topic, see +\href{http://www.adobe.com/devnet/xmp.html}{% +Part 3, Storage in Files}, section 3.2 on \textbf{Native metadata in PDF files}, in particular, +see section~3.2.1 concerning user-defined document properties. + + +\section{Checking for validity} + +While looking at this file in Acrobat (or Adobe Reader), press +\texttt{Ctrl+D} to get the \textsf{Document Properties} dialog box. +Select the \textsf{Description} tab and click \textsf{Additional +Metadata}. Since this document was built using the \textsf{aebxmp} +package, with the declarations + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{12}\selectfont] +\copyrightStatus{True} +\copyrightNotice{Copyright (C) 2006-\the\year, D. P. Story} +\copyrightInfoURL{http://www.acrotex.net} +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} +\end{Verbatim} + +\newtopic In the Advanced Metadata dialog box, you should see, +\begin{itemize} + \item[] \textsf{Copyright Status}: \texttt{Copyrighted} + \item[] \textsf{Copyright Notice}: \texttt{Copyright (C) 2006-\the\year, D. P. Story} + \item[] \textsf{Copyright Info URL}: \texttt{http://www.acrotex.net} + \item[] \textsf{Author Title}: \texttt{Programming and Development, + AcroTeX.Net} + \item[] \textsf{Description Writer}: \texttt{Testing and Promotions Department, + AcroTeX.Net} +\end{itemize} +in addition to the usual Document Title, Author, Description, and +Keywords. I promise you that I did not enter these values through the user interface. \texttt{:-)} +\section{Resources} + +\newtopic The resources for the development of this package are +\begin{itemize} + \item \textsl{Standard ECMA-357: ECMAScript for XML (E4X) Specification},\\ + {\small\url{http://www.ecma-international.org/publications/standards/Ecma-357.htm}} + \item \textsl{XMP Specification}, \url{http://www.adobe.com/devnet/xmp.html} + \item \textsl{Acrobat JavaScript Scripting Reference}, Version 8.0\\ + \url{http://www.adobe.com/go/acrobat_developer} + \item \textsf{hyperxmp} package by Scott Pakin, + \url{http://ctan.org/pkg/hyperxmp} + \item The {\AcroTeX} System Tools, available for free download at \url{www.acrotex.net}. This is + a {\LaTeX}-based system. + \item ISO 639-1 two-letter abbreviation.\\ + \url{http://www.loc.gov/standards/iso639-2/php/English_list.php} + \item IETF RFC 3066\\ + \url{http://www.ietf.org/rfc/rfc3066.txt} + +% http://www.iana.org/assignments/language-subtag-registry + +\end{itemize} + +\newtopic\noindent +Now, I simply must get back to my retirement. \dps + +\end{document} diff --git a/macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.pdf b/macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.pdf new file mode 100644 index 0000000000..e79a5e905e Binary files /dev/null and b/macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.pdf differ diff --git a/macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.tex b/macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.tex new file mode 100644 index 0000000000..6fc826c2d6 --- /dev/null +++ b/macros/latex/contrib/aeb_pro/aebxmp/examples/aebxmp_test.tex @@ -0,0 +1,138 @@ +\documentclass{article} +\usepackage[designiv,tight]{web} % Requires use of Acrobat +\usepackage{eforms} +\usepackage{aebxmp} + +\university{Acro\negthinspace\TeX.Net} +\title{Testing the aebxmp Package} +%\Title{Testing the aebxmp Package} +\Title{% + {[en-US]Testing the aebxmp Package} + {[fr]Test du paquet aebxmp} + {[de]Testen des aebxmp Pakets} +} +\author{D. P. Story} +\Authors{{D. P. Story}{J\u00FCrgen Gilg}} +%\subject{Test file for using E4X to update the XMP Data Model} +%\Subject{[en-US]Test file for using E4X to update the XMP Data Model} +\Subject{% + {[en-US]Test file for using E4X to update the XMP Data Model} + {[fr]Fichier de test utilisant E4X pour mettre à jour + le modèle de données XMP} + {[de]Testdatei für die Verwendung von E4X, um das XMP Daten + Modell zu aktualisieren} +} +\pdfLang{en-US} +\metaLang{en,en-US,fr,de} +%\keywords{AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript} +\Keywords{AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript} +\email{dpstory@acrotex.net} +\copyrightStatus{True} +%\copyrightNotice{Copyright (C) \the\year, D. P. Story} +\copyrightNotice{% + {[en-us]Copyright \u00A9 \the\year, D. P. Story} + {[fr]Copyright \u00A9 \the\year, D. P. Story} + {[de]Copyright \u00A9 \the\year, D. P. Story} +} +\copyrightInfoURL{http://www.acrotex.net} + +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} + +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=Jürgen Gilg} +% {name=Motivator,value=J\u00FCrgen Gilg} +} +% Alternate notation +%\customProperties +%{% +% {name:Developer,value:{D. P. Story, Esq.}} +% {name:Motivator,value:Jürgen Gilg} +%% {name:Motivator,value:J\u00FCrgen Gilg} +%} + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + +\begin{document} + +\maketitle + +\section{Viewing Metadata} + +Press \texttt{Ctrl+D}, select the \textsf{Description} tab, and click +\textsf{Additional Metadata} to inspect the copyright metadata, populated +by the \textsf{aebxmp} package; or, just click on this button +\pushButton[\CA{View Metadata} +\A{\JS{app.execMenuItem("GeneralInfo");}}]{viewMeta}{}{11bp} + +\def\xmpTab{\space\space}% +\def\displayMeta#1{\JS{% + console.println("#1:");\r + for (var i=0; i<#1.length; i++)\r\t + console.println("\xmpTab"+#1[i]);\r +}} + +Open the \setLink[\A{\JS{console.clear();console.show();}}]{console +window} and view some of the advanced metadata: +\setLink[\A{\displayMeta{aKeywords}}]{keywords}, +\setLink[\A{\displayMeta{aTitle}}]{title}, +\setLink[\A{\displayMeta{aSubject}}]{subject}, and +\setLink[\A{\displayMeta{aRights}}]{copyrightNotice}. + +\section{Custom Document Properties} +You can define custom properties using the \cs{customProperties} command. +\begin{verbatim} + \customProperties + {% + {name=,value=} + {name=,value=} + } +\end{verbatim} +The value of the \texttt{name} key requires a unique name, which must not +be one of the standard property names \texttt{Title}, \texttt{Author}, +\texttt{Subject}, \texttt{Keywords}, \texttt{Creator}, \texttt{Producer}, +\texttt{CreationDate}, \texttt{ModDate}, and \texttt{Trapped}. + +The properties may be accessed through the \texttt{info} property of the +\texttt{Doc} object. The button \pushButton[\TU{Press to see the document +properties}\CA{Info}\A{\JS{% + console.show();\r + console.clear();\r + for (var o in this.info)\r\t + console.println("info."+o+"="+this.info[o]);\r + if (aKeywords!=undefined) {\r\t + console.println("List Keywords:");\r\t + for (var i=0; i< aKeywords.length; i++){\r\t\t + console.println(" "+aKeywords[i]);\r\t + }\r + } +}}]{info}{}{11bp} +opens the console debugger window and displays all the document +properties. Notice in the window, the keywords are listed twice: +the first time is the value of \texttt{this.info.Keywords}, single string; +the second time you see the keywords listed individually. The individual +keywords are accessed using the \texttt{aKeywords} array, see the +\texttt{aeb\_xmp} documentation for more details. + +The custom properties may be viewed using the user interface; press +\texttt{Ctrl+D} and choose the \textsf{Custom} tab. + +\section{Authors} + +As mentioned in the documentation, a new command \cs{Authors} was defined; +for this document, we have in the preamble, +\begin{verbatim} + \Authors{{D. P. Story}{J\u00FCrgen Gilg}} +\end{verbatim} +Each author can be accessed individually; the button +\pushButton[\CA{Authors}\TU{Get a listing of all authors}\A{\JS{% + console.show();\r + console.println("\\n");\r + for (var i=0; i