diff options
Diffstat (limited to 'texmf-dist/source/latex/annot-pro')
-rw-r--r-- | texmf-dist/source/latex/annot-pro/annot_pro.dtx | 1162 | ||||
-rw-r--r-- | texmf-dist/source/latex/annot-pro/annot_pro.ins | 63 | ||||
-rw-r--r-- | texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex | 1120 |
3 files changed, 2345 insertions, 0 deletions
diff --git a/texmf-dist/source/latex/annot-pro/annot_pro.dtx b/texmf-dist/source/latex/annot-pro/annot_pro.dtx new file mode 100644 index 00000000..7e30b00e --- /dev/null +++ b/texmf-dist/source/latex/annot-pro/annot_pro.dtx @@ -0,0 +1,1162 @@ +% \iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% annot_pro package, %% +%% Copyright (C) 2002-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 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e} +%<package>\ProvidesPackage{annot_pro} +%<package> [2016/10/18 v1.1b Provides selected PDF annotation support (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[fleqn]{amsmath} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\let\uif\textsf\let\app\textsf +\let\pkg\textsf\let\env\texttt +\def\psf#1{\textsf{\textbf{#1}}} +%\def\texorpdfstring#1#2{#1} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +\OnlyDescription % comment out for implementation details +\EnableCrossrefs \CodelineIndex \RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{annot_pro}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{annot_pro}{aebdocfmt.def cannot be found}} +\begin{document} + \GetFileInfo{annot_pro.sty} + \title{annot\_pro: Selected PDF Annotations} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{annot_pro.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} +The index goes here. Execute +\begin{quote} + \texttt{makeindex -s gind.ist -o annot\_pro.ind annot\_pro.idx} +\end{quote} + on the command line and recompile \texttt{annot\_pro.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list +of changes goes here. Execute +\begin{quote} + \texttt{makeindex -s gglo.ist -o annot\_pro.gls annot\_pro.glo} +\end{quote} + on the command line and recompile \texttt{annot\_pro.dtx}.} +\end{document} +%</driver> +% \fi +% +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}} +% {\PackageInfo{web}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +%<*package> +\RequirePackage{xkeyval} +% \end{macrocode} +% \changes{v1.1}{2016/09/29}{Introduced Free Text annotation} +% \changes{v1.0c}{2016/09/28}{Reformatted manual, reformatted DTX file} +% \section{Background Information} +% +% The following annotation types will be supported (taken from table 8.20) +%\begin{itemize} +% \item \textbf{Text}: Subtype \textbf{Text}. See Table 8.23, page 621. In particular, the values +% of the \textbf{Name} key are \textbf{Comment}, \textbf{Help}, \textbf{Insert}, \textbf{Key}, \textbf{NewParagraph}, +% \textbf{Note} (the default), and \textbf{Paragraph}. Other supported names are \textbf{Check}, \textbf{Circle}, \textbf{Cross}, +% \textbf{Star}, \textbf{RightArrow}, \textbf{RightPointer}, \textbf{UpArrow}, \textbf{UpLeftArrow} +% \item \textbf{Stamp}: Subtype \textbf{Stamp}. See Table 8.32, page 635. The values of the \textbf{Name} key are +% \textbf{Approved}, \textbf{AsIs}, \textbf{Confidential}, +% \textbf{Departmental}, \textbf{Draft} (the default), +% \textbf{Experimental}, \textbf{Expired}, \textbf{Final}, +% \textbf{ForComment}, \textbf{ForPublicRelease}, \textbf{NotApproved}, +% \textbf{NotForPublicRelease}, \textbf{Sold}, \textbf{TopSecret}. +% \item \textbf{FileAttachment}: Subtype \textbf{FileAttachment}. Table 8.35, page 638. The Name key has values +% \textbf{Graph}, \textbf{Paperclip}, \textbf{PushPin}, and \textbf{Tag}. +%\end{itemize} +% The options available for any supported annotation +%\begin{itemize} +% \item \verb!type=text | stamp | fileattachment! (text, the default) +% \item \texttt{Contents} will be an argument of the command \cs{annotpro} +% \item \texttt{NM} unique name for the page, optional, if not provided, +% one will be generated. +% \item \texttt{color}, to color the annotation +% \item \verb!margin! to place the annotation in the margin +% \item \texttt{nohspace}, leave no horizontal space +% \item \texttt{novspace}, leave no vertical space +% \item \texttt{nospace}, leave neither vertical or horizontal space. +%\end{itemize} +% \section{Annotation types supported} +% \subsection{Text Annotations} +% The options for the text annotation (\texttt{type=text}) are +%\begin{itemize} +% \item \texttt{name}, one of the standard icons listed above, default Note +% \item \texttt{open}, default \texttt{false} +%\end{itemize} +% \subsection{Rubber Stamp Annotations} +% The options for the text annotation (\texttt{type=stamp}) are +%\begin{itemize} +% \item \texttt{name}, the default is draft. If a name begins with \texttt{\#}, that signals +% a custom appearance. +% \item \texttt{ap}, when the name is a custom name, the \texttt{ap} is used to hold the indirect reference +% to the appearance. If a custom name is specified, \texttt{ap} is required, and \textsf{graphicxsp} is required. +% \item \texttt{open}, default \texttt{false} +%\end{itemize} +% \subsection{File Attachment Annotations} +% The options for the text annotation (\texttt{type=fileattachement}) are +%\begin{itemize} +% \item \texttt{name}, the default is \texttt{PushPin}. +% \item \texttt{file}, the file specification \textbf{FS} key +%\end{itemize} +% \subsection{Text Box (Free Text) Annotations} +% Beginning with Free Text +% \begin{macrocode} +\DeclareOptionX{preview}{\previewtrue} +\@ifundefined{ifpreview}{\newif\ifpreview\previewfalse}{} +% \end{macrocode} +% \changes{v1.1}{2016/09/29}{Added \string\texttt{useA10Icons} and \string\texttt{useTextBox} options} +% (2016/09/29) Added \texttt{useA10Icons} and \texttt{useTextBox} options +% \begin{macrocode} +\newif\ifuseAAXdim\useAAXdimtrue +\DeclareOptionX{useA10Icons}{\useAAXdimtrue} +\DeclareOptionX{!useA10Icons}{\useAAXdimfalse} +% \end{macrocode} +% Require \pkg{richtext}, dated 2016/10/03 or later. +% \changes{v1.1a}{2016/10/18}{Require \string\pkg{richtext}, dated 2016/10/03 or later.} +% \changes{v1.1b}{2016/10/18}{Corrected date specification} +% \begin{macrocode} +\DeclareOptionX{useTextBox}{\def\ap@requireRichTextAsNeeded{% + \RequirePackage{richtext}[2016/10/03]}} +\let\ap@requireRichTextAsNeeded\relax +\ProcessOptionsX\relax +\RequirePackage{hyperref} +\RequirePackage{calc} +\RequirePackage{insdljs} +\RequirePackage[structure]{taborder} +\ap@requireRichTextAsNeeded +% \end{macrocode} +% We see if \textsf{graphicxsp} is loaded, and set a simple switch one way or the other. +% This switch is later used when creating a custom stamp. +% \begin{macrocode} +\@ifpackageloaded{graphicxsp}{% + \let\ap@graphicxsp=1}{\let\ap@graphicxsp=0} +% \end{macrocode} +% For now, we'll support setting the tab order only if the \pkg{eforms} package is loaded. +% \begin{macrocode} +\@ifpackageloaded{eforms}{} + {\newif\ifto@structOrder\to@structOrderfalse} +% \end{macrocode} +% \cs{csarg} from \pkg{comments} package, handy. +% \begin{macrocode} +\def\ap@csarg#1#2{\expandafter#1\csname#2\endcsname} +% \end{macrocode} +% Definitions for creating a rectangle used to create a building box for the annot. +% This switch is later used when creating a custom stamp. +% \begin{macrocode} +\def\ap@Bbox#1#2{% + \edef\bbox@width{#1}\edef\bbox@height{#2}% + \hbox{\ifpreview\setlength\fboxrule{0.4pt}\setlength\fboxsep{0pt}% + \@tempdima=\bbox@width\advance\@tempdima by-\fboxrule + \@tempdimb=\bbox@height\advance\@tempdimb by-\fboxrule + \fbox{\parbox[c][\@tempdimb][c]{\@tempdima}{\hfill\vfill}}\else + \parbox[c][\bbox@height][c]{\bbox@width}{\hfill\vfill}\fi}% +} +% \end{macrocode} +% The postscript operators \texttt{pdf@llx}, etc., are defined in \textsf{hyperref}. +% \begin{macrocode} +\def\ap@Rect{/Rect [pdf@llx pdf@ury pdf@urx pdf@lly]} +% \end{macrocode} +% \begin{macro}{\defineAPath} +% A simple macro to define path. +% \begin{macrocode} +\newcommand{\defineAPath}[1]{\def\ap@ctrl@Name{#1}% + \hyper@normalise\ap@defineAPath} +\def\ap@defineAPath#1{\expandafter\xdef\ap@ctrl@Name{#1}} +% \end{macrocode} +% \end{macro} +% \section{Key-Value Pairs for \texorpdfstring{\protect\cs{annotpro}}{\textbackslash annotpro}} +% \begin{macro}{type} +% We support three types of annotation, text, stamp, and fileattachment. +% \begin{macrocode} +\define@choicekey+{annotpro}{type}[\val\nr]% + {text,stamp,fileattachment,textbox}[text]{% + \edef\ap@save@type{\nr}% + \ifcase\nr\relax + \def\ap@type{Text}\or + \def\ap@type{Stamp}\or + \def\ap@type{FileAttachment}\or + \def\ap@type{FreeText}\fi +}{\PackageWarning{annot_pro}{Bad choice for type, permissible values + are text, stamp, fileattachment, textbox. Try again}} +\def\ap@freetext@type{3} +\let\ap@type\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{name} +% The name key can have many different values. The permitted values are +% a function of the \texttt{type}. +% \begin{macrocode} +\define@key{annotpro}{name}[]{\def\annotpro@name{#1}} +\let\annotpro@name\@empty +% \end{macrocode} +% \end{macro} +% For a text annotation, the following are permitted values for \texttt{name}: +% \begin{macrocode} +\define@choicekey+{annnotprotext}{name}{% +Comment,Key,Note,Help,NewParagraph,Paragraph,Insert,Check,% +Circle,Cross,Star,RightArrow,RightPointer,UpArrow,UpLeftArrow,% +CrossHairs}[Note]{\def\annotpro@@name{#1}}% +{\PackageWarning{annot_pro}{Bad choice for name, permissible values +are Comment, Key, Note, Help, NewParagraph, Paragraph, Insert, Check, +Circle, Cross, Star, RightArrow, RightPointer, UpArrow, +UpLeftArrow, CrossHairs. Try again}} +\let\annotpro@@name\@empty +% \end{macrocode} +% For a stamp annotation, the following are permitted values for \texttt{name}. +% \begin{macrocode} +\define@choicekey+{annnotprostamp}{name}{% +Approved,AsIs,Confidential,Departmental,Draft,% +Experimental,Expired,Final,ForComment,% +ForPublicRelease,NotApproved,NotForPublicRelease,Sold,% +TopSecret}[Draft]{\def\annotpro@@name{#1}}% +{\def\ap@custom@name{#1}} +\let\ap@custom@name\@empty +% \end{macrocode} +% If the user enters a value other than the one listed, that value is recorded +% in the text macro \cs{ap@custom@name}. Usually, the user would enter the +% names of stamps that come on his system, but are not part of the PDF Specs. +% \begin{macrocode} +% \end{macrocode} +% \begin{macro}{customStamp} +% There is a third case. The user can create a custom stamp using graphicxsp +% package. +% \begin{macrocode} +\define@key{annotpro}{customStamp}[]{\def\ap@customstamp@name{#1}} +\let\ap@customstamp@name\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{ap} +% When the user specifies \texttt{customStamp}, he must supply a custom appearence +% for the stamp with the \texttt{ap} key. The \textsf{graphicxsp} package is required +% for this option. +% \begin{macrocode} +\define@key{annotpro}{ap}[]{\def\annotpro@ap{#1}} +\let\annotpro@ap\@empty +% \end{macrocode} +% \end{macro} +% There is a third case. The user can create a custom stamp using graphicxsp +% package. +% \begin{macro}{width} +% \begin{macro}{height} +% \begin{macro}{rotate} +% \begin{macro}{scale} +% \begin{macro}{widthTo} +% \begin{macro}{heightTo} +% As of this writing, these are used when the user sets the name key equal +% to one of the many stamp names that come with Acrobat (other than ones +% that are documented in the PDF Specs. Use the width and height to set the +% bounding box. Normally, distiller, will place the largest stamp the box +% will hold, and center it in that box. (I think.) +% \begin{macrocode} +\define@key{annotpro}{width}[]{\def\annotpro@width{#1}} +\let\annotpro@width\@empty +\define@key{annotpro}{height}[]{\def\annotpro@height{#1}} +\let\annotpro@height\@empty +\define@key{annotpro}{rotate}[]{\def\annotpro@rotate{#1}} +\let\annotpro@rotate\@empty +\define@key{annotpro}{scale}[]{\def\annotpro@scale{#1}} +\let\annotpro@scale\@empty +\define@key{annotpro}{widthTo}[]{\def\annotpro@widthTo{#1}} +\let\annotpro@widthTo\@empty +\define@key{annotpro}{heightTo}[]{\def\annotpro@heightTo{#1}} +\let\annotpro@heightTo\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% For a file attachment annotation, the following are permitted values for \texttt{name}. +% \begin{macrocode} +\define@choicekey+{annnotprofileattach}{name}{% +Graph,Paperclip,PushPin,Tag}[PushPin]{\def\annotpro@@name{#1}} +{\PackageWarning{annot_pro}{Bad choice for name, permissible values +are Graph,Paperclip,PushPin,Tag. Try again}} +% \end{macrocode} +% \begin{macro}{file} +% When there is a file attachment, the absolute path to the file must be +% specified using the \texttt{file} key. A path to the file can be defined +% using \cs{defineAPath}. +% \begin{macrocode} +\define@key{annotpro}{file}[]{% + \edef\annotpro@file{#1}% + \ifx\annotpro@file\@empty\else + \edef\ap@exp@tmp{\noexpand\filename@parse{#1}}\ap@exp@tmp + \edef\ap@thisFileName{\filename@base.\filename@ext}\fi +} +\let\annotpro@file\@empty +\define@key{annotprofreetext}{name}[FreeText]{\def\annotpro@@name{#1}} +\define@key{annotprofreetext}{defstyle}[]{\def\annotpro@@ds{#1}} +\let\annotpro@@ds\@empty +\define@key{annotprofreetext}{richtext}[]{\def\annotpro@@rt{#1}} +\let\annotpro@@rt\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{margin} +% \begin{macro}{margintext} +% \begin{macro}{\margintextformat} +% When margin is used, the command \cs{marginpar} is used to place the annotation +% in the margins, this is nice for sticky notes (text annotations), small stamps, +% and file attachments. +% +% You can optionally place (small amount of) text under the icon in the margins. The +% format for the text can be redefined using the command \cs{margintextformat}. +% \begin{macrocode} +\define@key{annotpro}{margin}[0]{% + \def\annotpro@margin{0}} +\let\annotpro@margin\@empty +\define@key{annotpro}{margintext}[]{% + \def\apmargintext{\centering\break + \parbox{\linewidth}{\apmargintextformat\strut#1}}} +\let\apmargintext\@empty +\newcommand{\margintextformat}[1]{\def\apmargintextformat{#1}} +\margintextformat{\bfseries\tiny\color{blue}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{presets} +% A convenience key to allow the introduction of pre-defined options, for example, +% you might like all your comment fields to be red, so you can define +% \verb!\def\myComments{type=text,name=Comment,color=red}!, then say +%\begin{verbatim} +% \annotpro[presets=\myComment]{Way to go!} +%\end{verbatim} +% \begin{macrocode} +\define@key{annotpro}{presets}[]{\def\annotpro@presets{#1}} +\let\annotpro@presets\@empty +% \end{macrocode} +% Added 07/08/09 to support structure tab order. +% \end{macro} +% \begin{macro}{objdef} +% This is a pdfmark feature that inserts a references to this COS object, +% used with setting the tab order using the structure. Tabbing using structure +% is supported by \textsf{eforms}. +% \begin{macrocode} +\define@key{annotpro}{objdef}[]{\def\eq@objdef{/_objdef {#1}}% + \def\eq@objdefName{#1}} +\let\eq@objdef\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{taborder} +% \begin{macrocode} +\define@key{annotpro}{taborder}[]{\def\eq@taborder{#1}} +\let\eq@taborder\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{open} +% A key to set whether the popup annotation is open or not. +% \begin{macrocode} +\define@choicekey+{annotpro}{open}[\val\nr]{true,false}[true]{% + \def\annotpro@open{#1}}{\PackageWarning{annot_pro}{Bad + choice for open, permissible values are true and false. Try again}} +\def\annotpro@open{false} +% \end{macrocode} +% \end{macro} +% \begin{macro}{subject} +% \begin{macro}{title} +% The subject and title (usually the author's name) of the annotation +% \begin{macrocode} +\define@key{annotpro}{subject}[]{\def\annotpro@subject{#1}} +\define@key{annotpro}{title}[]{\def\annotpro@title{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{color} +% The color of the annotation. +% \begin{macrocode} +\define@key{annotpro}{color}[1 0 0]{\def\annotpro@color{#1}} +% \end{macrocode} +% For the FreeText annotation, we can specify background color \IndexOpt{bgcolor}\texttt{bgcolor}, +% (default white) and border color \IndexOpt{bcolor}\texttt{bcolor} (default black). +% \begin{macrocode} +\define@key{annotpro}{bgcolor}[]{\def\annotpro@bgcolor{#1}} +\def\annotpro@bgcolor{white} +\define@key{annotpro}{bcolor}[]{\def\annotpro@bcolor{#1}} +\let\annotpro@bcolor\@empty +\def\annotpro@def@bcolor{black} +\def\ap@BE@i{4.08768} +\def\ap@BE@i@calc{\ap@BE@i\space\ap@bwidthNum\space add} +\def\ap@BE@ii{8.26857} +\def\ap@BE@ii@calc{\ap@BE@ii\space add \ap@bwidthNum} +\define@choicekey+{annotpro}{borderstyle}[\val\nr]{none,solid,% + dash1,dash2,dash3,dash4,dash5,dash6,cloud1,cloud2}[solid]{% + \ifcase\nr\relax + \def\ap@border@code{}\or + \def\ap@border@code{/BS <</S/S\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[2.0 2.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[3.0 3.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[4.0 4.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[4.0 3.0 2.0 3.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[4.0 3.0 16.0 3.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[8.0 4.0 4.0 4.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BE<</I 1.0/S/C>>/RD[\ap@BE@i@calc\space\ap@BE@i@calc + \space\ap@BE@i@calc\space\ap@BE@i@calc]% + \ifx\ap@bwidth\@empty\else/BS <<\ap@bwidth>>\fi}\or + \def\ap@border@code{/BE<</I 2.0/S/C>>/RD[\ap@BE@ii@calc\space\ap@BE@ii@calc + \space\ap@BE@ii@calc\space\ap@BE@ii@calc]% + \ifx\ap@bwidth\@empty\else/BS <<\ap@bwidth>>\fi}\fi + \def\annotpro@border{#1}}{\PackageWarning{annot_pro}{Bad + choice for borderstyle,\MessageBreak permissible values are none, solid,% + dash1, dash2, dash3,\MessageBreak dash4, dash5, dash6, cloud1, cloud2. Try again}} +\def\ap@border@code{/BS <</S/S\ap@bwidth>>} +\define@choicekey+{annotpro}{borderwidth}[\val\nr]{.5,1,2,3,4,6,8,10}[1]{% + \edef\ap@bwidthNum{\val}% + \def\ap@bwidth{/W #1}}{\PackageWarning{annot_pro}{Bad + choice for borderwidth,\MessageBreak permissible values are .5, 1, 2,\MessageBreak + 3, 4, 6, 8, 10. Try again}} +\def\ap@bwidthNum{1} +\let\ap@bwidth\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{readonly} +% Set the annotation to readonly. +% \begin{macrocode} +\define@key{annotpro}{readonly}[ 64 add]{\def\ap@readonly{#1}} +\let\ap@readonly\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{nohspace} +% \begin{macro}{nohspace} +% \begin{macro}{nospace} +% These are used only with text annotations. The position of the +% annotation depends only on the upper-right corner. The bounding +% box can be made to have no width or not height, or both. The upper-left +% corner is always defined. The text annotation will take no horizontal, +% vertical, or no space at all in {\TeX} space. The same effect can be accomplished +% using 0pt width boxes or by smashing the bounding box. +% \begin{macrocode} +\define@key{annotpro}{nohspace}[]{\def\annotpro@hspace{0pt}} +\define@key{annotpro}{novspace}[]{\def\annotpro@vspace{0pt}} +\define@key{annotpro}{nospace}[]{\def\annotpro@hspace{0pt}% + \def\annotpro@vspace{0pt}} +\let\annotpro@hspace\@empty\let\annotpro@vspace\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{opacity} +% Set the \texttt{opacity} of the annot, if creating a custom stamp using +% graphicxsp, then the file needs to be distilled using \texttt{standard\_transparency} +% job settings for distiller. +% \begin{macrocode} +\define@key{annotpro}{opacity}[]{% + \def\ap@add@ops{[ /ca #1 /SetTransparency pdfmark}% + \def\annotpro@opacity{#1}} +\let\annotpro@opacity\@empty +% \end{macrocode} +% \end{macro} +% \subsection{Dimensions of Standard Text Icons} +% Using the user interface, and the dimensions of each of the standard text annotations +% were obtained and recorded here. +% \begin{macrocode} +% Note in A10, text annots are not 18bp x 18bp and A10 adds CrossHairs +\def\getargsiii#1#2#3{\def\ap@argi{#1}\def\ap@argii{#2}% + \def\ap@argiii{#3}} +\ifuseAAXdim +\@tfor\ap@text@dimen:={{Comment}{18bp}{18bp}}% +{{Key}{13bp}{18bp}}{{Note}{18bp}{20bp}}{{Help}{20bp}{20bp}}% +{{NewParagraph}{13bp}{20bp}}{{Paragraph}{20bp}{20bp}}% +{{Insert}{17bp}{20bp}}{{Check}{20bp}{19bp}}% +{{Circle}{20bp}{20bp}}{{Cross}{20bp}{19bp}}% +{{Star}{20bp}{19bp}}{{RightArrow}{20bp}{20bp}}% +{{RightPointer}{20bp}{17bp}}{{UpArrow}{17bp}{20bp}}% +{{UpLeftArrow}{17bp}{17bp}}{{CrossHairs}{20bp}{20bp}}\do{% + \expandafter\getargsiii\ap@text@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} \else +\@tfor\ap@text@dimen:={{Comment}{20bp}{18bp}}% +{{Key}{18bp}{17bp}}{{Note}{18bp}{20bp}}{{Help}{20bp}{20bp}}% +{{NewParagraph}{13bp}{20bp}}{{Paragraph}{11bp}{20bp}}% +{{Insert}{20bp}{17bp}}{{Check}{20bp}{19bp}}% +{{Circle}{20bp}{20bp}}{{Cross}{20bp}{20bp}}% +{{Star}{20bp}{19bp}}{{RightArrow}{20bp}{14bp}}% +{{RightPointer}{20bp}{18bp}}{{UpArrow}{19bp}{20bp}}% +{{UpLeftArrow}{17bp}{17bp}}{{CrossHairs}{24bp}{24bp}}\do{% + \expandafter\getargsiii\ap@text@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} \fi +% \end{macrocode} +% \subsection{Dimensions of Standard File Attachment Icons} +% Similarly, the dimensions of each of the standard file attachment annotations +% were obtained and recorded. All these dimensions have been reduced by 2pt, so that there final +% dimensions match what is displayed through the ui. +% \begin{macrocode} +\ifuseAAXdim +\@tfor\ap@fa@dimen:={{Graph}{20bp}{20bp}} + {{Paperclip}{7bp}{17bp}}{{PushPin}{14bp}{20bp}} + {{Tag}{20bp}{16bp}}\do{% + \expandafter\getargsiii\ap@fa@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +\else +\@tfor\ap@fa@dimen:={{Graph}{18bp}{18bp}} + {{Paperclip}{5bp}{15bp}}{{PushPin}{12bp}{18bp}} + {{Tag}{18bp}{14bp}}\do{% + \expandafter\getargsiii\ap@fa@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} \fi +% \end{macrocode} +% \subsection{Dimensions of Standard Stamp Appearances} +% +% Some default stamp dimensions, when the dimensions are not known or provided. May be +% redefined. +% \begin{macrocode} +\newcommand{\defaultStampWidth}{50bp} +\newcommand{\defaultStampHeight}{50bp} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{Standard.pdf} +% \begin{macrocode} +\newcommand{\standardStampWidth}{245.38bp} +\newcommand{\standardStampHeight}{64.53bp} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{StandardBusiness.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{SBApproved}{163.50bp}{49.50bp}} +{{SBCompleted}{175.87bp}{49.50bp}} +{{SBConfidential}{209.62bp}{49.50bp}} +{{SBDraft}{113.14bp}{49.75bp}} +{{SBFinal}{97.80bp}{49.75bp}} +{{SBForComment}{211.87bp}{49.50bp}} +{{SBForPublicRelease}{290.04bp}{49.55bp}} +{{SBInformationOnly}{275.00bp}{49.55bp}} +{{SBNotApproved}{218.62bp}{49.50bp}} +{{SBNotForPublicRelease}{346.04bp}{49.55bp}} +{{SBPreliminaryResults}{304.04bp}{49.55bp}} +{{SBVoid}{91.04bp}{49.75bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{SignHere.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{SBRejected}{22.68bp}{22.66bp}} +{{SHAccepted}{23.29bp}{20.45bp}} +{{SHInitialHere}{99.69bp}{30.34bp}} +{{SHSignHere}{99.69bp}{30.34bp}} +{{SHWitness}{99.69bp}{30.34bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{\texttt{Dynamic.pdf}} +% \begin{macrocode} +\catcode`\#=11\relax +\@tfor\ap@dimen:={{#DApproved}{255.64bp}{53.83bp}} +{{#DConfidential}{163.28bp}{57.10bp}} +{{#DReceived}{255.64bp}{55.11bp}} +{{#DReviewed}{255.64bp}{55.11bp}} +{{#DRevised}{127.47bp}{55.85bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +\catcode`\#=6\relax +\newcommand{\stampWidth}[1]{\csname ap@#1Width\endcsname} +\newcommand{\stampHeight}[1]{\csname ap@#1Height\endcsname} +% \end{macrocode} +% The dimensions of the stamp appearances in the file Words.pdf +% \begin{macrocode} +\@tfor\ap@dimen:={{WordsAGenuineFind}{120.68bp}{190.83bp}} +{{WordsBigSavings}{282.84bp}{117.86bp}} +{{WordsDeals}{345.40bp}{132.55bp}} +{{WordsHappyBirthday}{326.50bp}{166.32bp}} +{{WordsHot}{249.64bp}{176.75bp}} +{{WordsLookWhatsNew}{316.59bp}{229.81bp}} +{{WordsNeato}{171.12bp}{86.88bp}} +{{WordsTheBestJustGotBetter}{153.53bp}{153.53bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{Faces.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{FacesEcstatic}{223.20bp}{202.80bp}} +{{FacesElectric}{295.80bp}{280.50bp}} +{{FacesGrumpy}{289.92bp}{194.64bp}} +{{FacesHappy}{161.65bp}{161.65bp}} +{{FacesHurt}{289.50bp}{285.75bp}} +{{FacesNeutral}{291.04bp}{279.32bp}} +{{FacesSmirk}{276.75bp}{292.50bp}} +{{FacesSurprised}{220.08bp}{215.04bp}} +{{FacesWorried}{298.11bp}{235.12bp}} +{{FacesWow}{242.32bp}{289.17bp}} +{{FacesZippy}{290.59bp}{263.81bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{Pointers.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{PointersBogus}{128.32bp}{53.82bp}} +{{PointersBug}{128.32bp}{51.94bp}} +{{PointersDOA}{136.99bp}{51.48bp}} +{{PointersFYEO}{128.32bp}{48.60bp}} +{{PointersFix}{145.60bp}{58.11bp}} +{{PointersNuke}{128.32bp}{52.30bp}} +{{PointersOptimize}{128.32bp}{48.60bp}} +{{PointersRedFlag}{128.32bp}{57.12bp}} +{{PointersValidate}{128.32bp}{48.60bp}} +{{PointersWarning}{128.32bp}{57.23bp}} +{{PointersWhen}{128.32bp}{63.79bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% \subsection{Default dimensions of Free Text annotation} +% \begin{macrocode} +\def\ap@FreeTextWidth{144bp} +\def\ap@FreeTextHeight{72bp} +% \end{macrocode} +% \begin{macro}{\makeStamp} +% A command to help the creation of custom stamps using graphicxsp. You've got to see it +% to believe it. +% \begin{macrocode} +\newcommand{\makeStamp}[3]{% +\ap@csarg\def{stamp@#2}{% + \begin{sp@createImage}{#1}{#2\the\ap@cusstamp@cnt} + \ap@add@ops#3 + \end{sp@createImage}}} +\let\ap@add@ops\@empty +% \end{macrocode} +% \end{macro} +% This command is used internal in \cs{annotpro} to generate an appearance for +% the stamp. +% \begin{macrocode} +\newcommand{\ap@useStamp}[1]{% + \global\advance\ap@cusstamp@cnt1\relax + \@nameuse{stamp@#1}} +% \end{macrocode} +% \begin{macro}{\setAnnotOptions} +% A command for setting global options. +% \begin{macrocode} +\newcommand{\setAnnotOptions}[1]{% + \setkeys{annotpro}{#1}% +} +% \end{macrocode} +% \end{macro} +% The following code is taken from the \textsf{datetime} package (and modified) as maintained by +% Nicola Talbot. There is no need for the whole package, we just need +% \cs{pdfdate}, named \cs{ap@pdfdate} in \textsf{annot\_pro}. We make all calculations in a group. +%\changes{v1.0a}{2011/07/14}{Added \cs{ap@pdfdate}} +% \begin{macrocode} +\begingroup +\def\withoptz@#1{\ifnum#1<10 0\fi\the#1} +\edef\ap@pdfdate{\the\year\withoptz@\month\withoptz@\day} +% \end{macrocode} +% Calculate the minutes after the hour time by dividing by 60. +% \begin{macrocode} +\count0=\time \count2=\count0 +% \end{macrocode} +% Calculate the number of hours after midnight by dividing by 60 +% \begin{macrocode} +\divide\count2by60 +\edef\ap@pdfdate{\ap@pdfdate\withoptz@{\count2}} +\multiply\count2by60 \advance\count0by-\count2 +\xdef\ap@pdfdate{\ap@pdfdate\withoptz@{\count0}00} +\endgroup +% \end{macrocode} +% \section{The main code} +% \begin{macrocode} +\newcount\ap@annot@cnt +\newcount\ap@cusstamp@cnt +{\catcode`\#=12\gdef\ap@signalCustomAP{#}} +\def\pStamp#1{\ap@signalCustomAP#1} +% \end{macrocode} +% \begin{macrocode} +\def\ap@RV@Body{<?xml version="1.0"?><body % + xfa:APIVersion="Acrobat:9.5.5" % + xfa:contentType="text/html" % + xfa:spec="2.0.2" xmlns="http://www.w3.org/1999/xhtml" % + xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">} +\def\ap@RV@endBody{<body>} +% \end{macrocode} +% The implementation of rich text in a FreeText annotation is a little different from +% that of a rich text form field. We made some adjustments here for an annotation. +% \begin{macrocode} +\def\ap@sub#1{\rvorvstring{<span style="vertical-align:-0.0pt;">#1</span>}{#1}}% +\def\ap@sup#1{\rvorvstring{<span style="vertical-align:+0.0pt;">#1</span>}{#1}}% +\def\ap@uDec#1{\rt@amp\rt@hashtag#1;} +\def\ap@uHex#1{\rt@amp\rt@hashtag x#1;} +\def\ap@afterParaFont{% +% \end{macrocode} +% Cancel out certain attributes that are not used in annotation. +% \begin{macrocode} + \rt@formfieldfalse +} +\def\ap@afterFont{% + \rt@formfieldfalse + \let\rt@url\@empty +} +% \end{macrocode} +% \begin{environment}{textboxpara} +% \begin{macrocode} +\newenvironment{textboxpara}{% + \let\rt@sub\ap@sub\let\rt@sup\ap@sup + \let\rt@afterParaFont\ap@afterParaFont + \let\rt@afterFont\ap@afterFont + \def\rt@br{\rvorvstring{\rt@amp\rt@hashtag13;}{\string\r}}% + \def\rt@spc{\space}\let\uDec\ap@uDec\let\uHex\ap@uHex +}{} +% \end{macrocode} +% \end{environment} +% \begin{macro}{\annotpro} +% Here is the main command of this package, the first optional parameter +% are key-value pairs, as defined above; the second parameter is the content +% of the message. File attachments have not popup message, so the content +% becomes the description of the attachment in the attachments panel; hence, +% in this case, the length of the message should be short. +% \begin{macrocode} +\newcommand{\annotpro}{% + \begingroup +% \end{macrocode} +% Some of the stamp names begin with \texttt{\#}, the user must use +% \verb!\#! +% \begin{macrocode} + \let\#\ap@signalCustomAP + \@nnotpro +} +\newcommand{\@nnotpro}[1][]{% +% \end{macrocode} +% Increment a global counter, to count the annots as we create them. +% \begin{macrocode} + \global\advance\ap@annot@cnt1\relax +% \end{macrocode} +% Process options +% \begin{macrocode} + \setkeys{annotpro}{#1}% + \@nn@tpro +} +\newcommand{\@nn@tpro}[1] +{% +% \end{macrocode} +% See if there were any presets, if so, expand them, and apply +% \cs{setkeys} again. +% \begin{macrocode} + \ifx\annotpro@presets\@empty\else + \edef\ap@exp@tmp{\noexpand\setkeys{annotpro}{\annotpro@presets}}% + \ap@exp@tmp\fi +% \end{macrocode} +% If no type was specified, assume \texttt{Text}. +% \cs{setkeys} again. +% \begin{macrocode} + \ifx\ap@type\@empty\def\ap@type{Text}\def\ap@save@type{0}\fi +% \end{macrocode} +% Now get the value of the name parameter, permissible values depend +% on the stated \texttt{type}. +% \begin{macrocode} + \ifcase\ap@save@type\relax + \def\annot@subtype{annnotprotext}% + \ifx\annotpro@subject\@empty\def\annotpro@subject{Sticky Note}\fi + \ifx\annotpro@name\@empty\def\annotpro@name{Note}\fi + \def\ap@def@name{Note}\or + \ifx\annotpro@subject\@empty\def\annotpro@subject{Rubber Stamp}\fi + \def\annot@subtype{annnotprostamp}% + \def\ap@def@name{Draft}\or + \ifx\annotpro@subject\@empty + \def\annotpro@subject{File Attachment}\fi + \def\annot@subtype{annnotprofileattach}% + \def\ap@def@name{PushPin}\or + \ifx\annotpro@subject\@empty + \def\annotpro@subject{Text Box}\fi + \def\annot@subtype{annotprofreetext}% + \def\ap@def@name{FreeText}% + \fi +% \end{macrocode} +% Get the name! +% \begin{macrocode} + \edef\ap@exp@tmp{% + \noexpand\setkeys{\annot@subtype}{name=\annotpro@name}}% + \ap@exp@tmp\xdef\ap@def@type{\ap@type}% +% \end{macrocode} +% Encode text for contents, title, subject, and color; here \textsf{hyperref} +% commands are used. +% \begin{macrocode} + \let\annotpro@enc@contents\@empty +% \end{macrocode} +% \changes{v1.0b}{2012/11/10}{Included \cs{makespecialJS}} +% We'll use \cs{makespecialJS} here. +% \begin{macrocode} + \makespecialJS +% \end{macrocode} +% If this is a FreeText annot, we get the rich text and default style from \texttt{\#1}. +% Supported keys are richtext and defstyle. The values of these keys are names defined +% by \cs{setRVVContents} and \cs{setDefaultStyle}. If \texttt{defstyle} is not specified, we +% use \cs{useDefaultDS}. +% \begin{macrocode} +\if\ap@save@type\ap@freetext@type + \let\eq@RV@Body\ap@RV@Body\let\eq@RV@endBody\ap@RV@endBody + \setkeys{annotprofreetext}{#1}% + \ifx\annotpro@@ds\@empty + \def\ap@defaultstyle{\useDefaultDS}\else + \edef\ap@defaultstyle{\noexpand\useDS{\annotpro@@ds}}\fi + \ifx\annotpro@@rt\@empty + \let\annotpro@RC\@empty\let\annotpro@C\@empty\else + \edef\annotpro@RC{\noexpand\useRVContent{\annotpro@@rt}}% + \edef\annotpro@C{\noexpand\useVContent{\annotpro@@rt}}\fi +% \end{macrocode} +% If this is a FreeText annot, we define its rich and plain values; requires \pkg{richtext} package +% \begin{macrocode} +\else + \pdfstringdef\annotpro@enc@contents{#1}% +\fi + \let\annotpro@enc@title\@empty + \pdfstringdef\annotpro@enc@title{\annotpro@title}% + \let\annotpro@enc@subject\@empty + \pdfstringdef\annotpro@enc@subject{\annotpro@subject}% +% \end{macrocode} +% Color handling for \texttt{color}, \texttt{bgcolor}, and \texttt{bcolor} via \pkg{hycolor} package +% \begin{macrocode} + \HyColor@XZeroOneThreeFour{\annotpro@color}% + {\annotpro@enc@color}{annotpro}{color}% +\ifx\annotpro@bgcolor\@empty\else + \HyColor@XZeroOneThreeFour{\annotpro@bgcolor} + {\annotpro@enc@bgcolor}{annotpro}{bgcolor}\fi +\ifx\annotpro@bcolor\@empty + \edef\annotpro@bcolor{\annotpro@def@bcolor}\fi + \HyColor@FieldColor{\annotpro@bcolor} + {\annotpro@enc@bcolor}{annotpro}{bcolor}% +% \end{macrocode} +% Initialize some commands to be used later +% \begin{macrocode} + \let\ap@this@AP\@empty\let\ap@this@FS\@empty\let\ap@this@CA\@empty + \let\ap@this@Rotate\@empty +% \end{macrocode} +% See if opacity is requested, and set appropriate key. +% \begin{macrocode} + \ifx\annotpro@opacity\@empty\else + \def\ap@this@CA{/CA \annotpro@opacity}\fi +% \end{macrocode} +% Now, perform annotation specific tasks such as setting the +% bounding box. +% \begin{macrocode} + \ifcase\ap@save@type +% \end{macrocode} +% \textbf{Text annotation.} We use the pre-defined dimensions for +% these text icons, unless the user has specified \texttt{nohspace}, +% \texttt{novspace}, and \texttt{nospace}. If the name has not been +% specified, we use the default (\texttt{Note}). +% \begin{macrocode} + \ifx\annotpro@@name\@empty\edef\annotpro@@name{\ap@def@name}\fi + \edef\ap@thisWidth{\ifx\annotpro@hspace\@empty + \@nameuse{ap@\annotpro@@name Width}\else + \annotpro@hspace\fi}% + \edef\ap@thisHeight{\ifx\annotpro@vspace\@empty + \@nameuse{ap@\annotpro@@name Height}\else + \annotpro@vspace\fi}% +% \end{macrocode} +% \textbf{Stamp annotation.} This is a bit trickier, there are three +% cases: (1) the user references a standard stamp; (2) the user +% references a non-standard stamp, one that ships with Acrobat; (3) +% the user wants to create his own custom stamp using +% \textsf{graphicxsp} techniques. +% \begin{macrocode} + \or + \ifx\annotpro@@name\@empty + \ifx\ap@custom@name\@empty + \ifx\ap@customstamp@name\@empty +% \end{macrocode} +% Neither \texttt{name} nor \texttt{customStamp} was specified, so we assume the default. +% \begin{macrocode} + \ifx\annotpro@@name\@empty + \edef\annotpro@@name{\ap@def@name}\fi + \edef\ap@thisWidth{\standardStampWidth}% + \edef\ap@thisHeight{\standardStampHeight}% + \else +% \end{macrocode} +% Here the user wants a stamp using \textsf{graphicxsp} techniques. +% \begin{macrocode} + \if\ap@graphicxsp0\PackageError{annot_pro}% + {Specifying a custom name for a stamp requires + the graphicxsp package.}\fi + \ifx\annotpro@ap\@empty + \PackageError{annot_pro}{You must specify a value + for the ap key}\fi + \def\ap@ImageRef{\annotpro@ap\the\ap@cusstamp@cnt}% + \expandafter\ap@useStamp\expandafter{\annotpro@ap}% +% \end{macrocode} +% After making many experiments, there seems to be a need to +% reduce dimensions by \texttt{2bp} so that the desired dimensions +% are displayed through the user interface. There seems to +% be an 1bp border around all stamps. +% \begin{macrocode} + \edef\ap@thisWidth{\widthOf{\ap@ImageRef}bp}% + \@tempdima=\ap@thisWidth\advance\@tempdima-2bp + \edef\ap@thisWidth{\the\@tempdima}% + \edef\ap@thisHeight{\heightOf{\ap@ImageRef}bp}% + \@tempdima=\ap@thisHeight\advance\@tempdima-2bp + \edef\ap@thisHeight{\the\@tempdima}% + \def\ap@this@AP{/AP << /N {\ap@ImageRef} >>}% + \edef\annotpro@@name{% + \ap@signalCustomAP\ap@customstamp@name}% + \fi + \else +% \end{macrocode} +% The command \cs{ap@custom@name} is non-empty, so the user it trying +% to access a stamp on his own system. The user has indicated one of +% the stamps documented in the PDF Reference, these all have the same +% dimension +% +% For the bounding box, we use \cs{defaultStampWidth} by +% \cs{defaultStampHeight} as the dimensions, unless the values of +% \texttt{width} and/or \texttt{height} are specified. +% \begin{macrocode} + \edef\annotpro@@name{\ap@custom@name}% + \@ifundefined{ap@\ap@custom@name Width}{% + \edef\ap@thisWidth{\ifx\annotpro@width\@empty + \defaultStampWidth\else\annotpro@width\fi}% + \edef\ap@thisHeight{\ifx\annotpro@height\@empty + \defaultStampWidth\else\annotpro@height\fi}% + }{% + \edef\ap@thisWidth{\ifx\annotpro@width\@empty + \@nameuse{ap@\annotpro@@name Width}\else + \annotpro@width\fi}% + \edef\ap@thisHeight{\ifx\annotpro@height\@empty + \@nameuse{ap@\annotpro@@name Height}\else + \annotpro@height\fi}% + }% + \fi + \else +% \end{macrocode} +% This is the case of specifying one of the document stamps, as +% listed in the PDF Reference. +% \begin{macrocode} + \edef\ap@thisWidth{\standardStampWidth}% + \edef\ap@thisHeight{\standardStampHeight}% + \fi +% \end{macrocode} +% Let's use calc to allow for calculations on dimensions, +% with this, we can conveniently resize the box. +% \begin{macrocode} + \ifx\annotpro@scale\@empty + \ifx\annotpro@widthTo\@empty + \ifx\annotpro@heightTo\@empty\else % heightTo + \edef\ap@thisWidth{% + (\ap@thisWidth)*\noexpand + \ratio{\annotpro@heightTo}{\ap@thisHeight}}% + \edef\ap@thisHeight{\annotpro@heightTo}% + \fi + \else % widthTo + \edef\ap@thisHeight{% + (\ap@thisHeight)*\noexpand + \ratio{\annotpro@widthTo}{\ap@thisWidth}}% + \edef\ap@thisWidth{\annotpro@widthTo}% + \fi + \else %scale + \edef\ap@thisWidth{(\ap@thisWidth)*\noexpand + \real{\annotpro@scale}}% + \edef\ap@thisHeight{(\ap@thisHeight)*\noexpand + \real{\annotpro@scale}}% + \fi + \setlength{\@tempdima}{\ap@thisWidth}% + \edef\ap@thisWidth{\the\@tempdima}% + \setlength{\@tempdima}{\ap@thisHeight}% + \edef\ap@thisHeight{\the\@tempdima}% + \ifx\annotpro@rotate\empty\else + \def\ap@this@Rotate{/Rotate \annotpro@rotate}% + \ap@set@Rotate@BBox + \fi + \or +% \end{macrocode} +% \textbf{File Attachment annotation.} There are only a few icons for +% file attachments, and I've determined their dimensions using the user +% interface. So, we use those. +% +% If a name has not been specified, we use the default (\texttt{PushPin}). +% \begin{macrocode} + \ifx\annotpro@@name\@empty\edef\annotpro@@name{\ap@def@name}\fi + \ifx\annotpro@file\@empty\PackageError{annot_pro}% + {You must specify a path the file to be + attached using the file key.}\fi +% \end{macrocode} +% Set the \textbf{FS} key to specify the file. +% \begin{macrocode} + \def\ap@this@FS{/FS {apEmbedFile\the\ap@annot@cnt}}% + \edef\ap@thisWidth{\@nameuse{ap@\annotpro@@name Width}}% + \edef\ap@thisHeight{\@nameuse{ap@\annotpro@@name Height}}% + \ap@EmbedThisFile + \or +% \end{macrocode} +% \textbf{Free text annotation.} +% \begin{macrocode} + \ifx\annotpro@@name\@empty\edef\annotpro@@name{\ap@def@name}\fi + \ifx\annotpro@width\@empty\else + \setlength\@tempdima{\annotpro@width}% + \def\annotpro@width{\the\@tempdima}\fi + \edef\ap@thisWidth{\ifx\annotpro@width\@empty + \@nameuse{ap@\annotpro@@name Width}\else + \annotpro@width\fi}% + \ifx\annotpro@height\@empty\else + \setlength\@tempdima{\annotpro@height}% + \def\annotpro@height{\the\@tempdima}\fi + \edef\ap@thisHeight{\ifx\annotpro@height\@empty + \@nameuse{ap@\annotpro@@name Height}\else + \annotpro@height\fi}% + \fi +% \end{macrocode} +% if \texttt{margin} is specified, we insert a \cs{marginpar} here. +% \begin{macrocode} + \ifx\annotpro@margin\@empty\let\apmargintext\@empty + \expandafter\relax\else\expandafter\marginpar\fi +% \end{macrocode} +% Set the bounding box, and layout the annotation using the \textbf{pdfmark} operator. +% \begin{macrocode} + {\pdf@rect{\ap@Bbox{\ap@thisWidth}{\ap@thisHeight}}\literalps@out{% + [ \eq@objdef\ap@Rect + /F 4\ap@readonly + /Open \annotpro@open + /Title (\annotpro@enc@title) + /Subj (\annotpro@enc@subject) +% \end{macrocode} +% We have different set of keys for FreeText when for the other annotation types. +% \begin{macrocode} +\if\ap@save@type\ap@freetext@type +% \end{macrocode} +% The definitions of \cs{eq@RV@Body} and \cs{eq@RV@endBody} come from \pkg{richtext}, originally from +% \pkg{eforms}. The \psf{RC} and \psf{Contents} keys get their entries from \cs{annotpro@RC} and +% \cs{annotpro@C}, which are acquired from the \pkg{richtext} package. +% \begin{macrocode} + /RC(\eq@RV@Body\annotpro@RC\eq@RV@endBody) + /Contents (\annotpro@C) + /DS (\ap@defaultstyle) + \ifx\annotpro@bgcolor\@empty\else + /C [\annotpro@enc@bgcolor]\fi + /DA (\annotpro@enc@bcolor\space/Helv 12 Tf) + \ap@border@code +\else + /Open \annotpro@open + /Contents (\annotpro@enc@contents) + /Color [\annotpro@enc@color] +\fi +% \end{macrocode} +% \changes{v1.0a}{2011/07/14}{Changed the value of the \texttt{/Name} key.} +% Changed the value of \texttt{/Name} form a name to a string +% \begin{macrocode} + /Name (\annotpro@@name) + /Subtype/\ap@type + /NM (annotpro\the\ap@annot@cnt) + /M (D:\ap@pdfdate) + \ap@this@AP\ap@this@FS\ap@this@CA\ap@this@Rotate + /ANN pdfmark}\apmargintext}% + \to@insertStrucTabOrder{Annot}\endgroup +} +% \end{macrocode} +% \end{macro} +% When the user specifies the rotate key, we need to enlarge the +% bounding box so the stamp can be rotated within that box. +% \begin{macrocode} +\def\ap@set@Rotate@BBox{% + \CalculateSin\annotpro@rotate\CalculateCos\annotpro@rotate + \edef\c@cos{\UseCos\annotpro@rotate}% + \edef\c@sin{\UseSin\annotpro@rotate}% +% \end{macrocode} +% Determine the quadrant i or iii versus ii or iv +% \begin{macrocode} + \@tempdimb=\c@cos pt + \@tempdimb=\c@sin\@tempdimb + \let\ap@sign\@empty + \ifdim\@tempdimb<\z@\def\ap@sign{-}\fi +% \end{macrocode} +%What we are doing is calculating the \emph{smallest rectangle} whose sides are parallel +%to the horizontal and vertical, that contained the rotated stamp. We use this computed +%rectangle as the bounding rectangle of the rectangle. +% +%The basic algorithm is as follows: +% If the angle is in the first or third quadrant, we use +%\begin{align*} +% \text{width} &=\text{width}'\cos(\theta)+\text{height}'\sin(\theta)\\ +% \text{height} &=\text{width}'\sin(\theta)+\text{height}'\cos(\theta) +%\end{align*} +%else, we use +%\begin{align*} +% \text{width} &=-\text{width}'\cos(\theta)+\text{height}'\sin(\theta)\\ +% \text{height}&=\text{width}'\sin(\theta)-\text{height}'\cos(\theta) +%\end{align*} +% where, $\text{width}'$ and $\text{height}'$ are the original width and height of the bounding rectangle, +% and $\text{width}$ and $\text{height}$ are the new dimensions of the rectangle, after rotation through +% an angle of $\theta$. +% \paragraph*{Width calculation.} Width held in \cs{ap@temp@thisWidth}. +% \begin{macrocode} + \@tempdima=\ap@sign\ap@thisWidth + \@tempdima=\c@cos\@tempdima + \@tempdimb=\ap@thisHeight + \@tempdimb=\c@sin\@tempdimb + \advance\@tempdima by\@tempdimb + \edef\ap@temp@thisWidth{\the\@tempdima}% +% \end{macrocode} +% \paragraph*{Height calculation.} Final height held is \cs{@tempdima}. +% \begin{macrocode} + \@tempdima=\ap@thisWidth + \@tempdima=\c@sin\@tempdima + \@tempdimb=\ap@thisHeight + \@tempdimb=\c@cos\@tempdimb + \advance\@tempdima by\ap@sign\@tempdimb +% \end{macrocode} +% Any negative dimensions are changed to positive. +% \begin{macrocode} + \@tempdimb=\ap@temp@thisWidth\relax + \ifdim\@tempdimb<\z@\@tempdimb=-\the\@tempdimb\fi + \ifdim\@tempdima<\z@\@tempdima=-\the\@tempdima\fi +% \end{macrocode} +% Here are the final calculations, \cs{ap@thisWidth} and \cs{ap@thisHeight}. +% \begin{macrocode} + \edef\ap@thisWidth{\the\@tempdimb}% + \edef\ap@thisHeight{\the\@tempdima}% +} +% \end{macrocode} +% Some code for embedding a file in the PDF document. +% \begin{macrocode} +\def\ap@EmbedThisFile{% + \literalps@out{% + [ /_objdef {apEmbedFile\the\ap@annot@cnt}/type/dict/OBJ pdfmark + [ {apEmbedFile\the\ap@annot@cnt} << + /F (\ap@thisFileName) + /UF (\ap@thisFileName) + /EF << /F {apFileStream\the\ap@annot@cnt} >> + /Type/Filespec + >> /PUT pdfmark}% + \literalps@out{% + [ /_objdef {apFileStream\the\ap@annot@cnt}/type/stream/OBJ pdfmark + [ {apFileStream\the\ap@annot@cnt} (\annotpro@file) + (r) file /PUT pdfmark + [ {apFileStream\the\ap@annot@cnt} << + /Type/EmbeddedFile + >> /PUT pdfmark + [ {apFileStream\the\ap@annot@cnt} /CLOSE pdfmark}% +} +% \end{macrocode} +% Set global options for this package. +% \begin{macrocode} +\setAnnotOptions{title,subject,open=false,color} +%</package> +% \end{macrocode} +% \Finale +\endinput diff --git a/texmf-dist/source/latex/annot-pro/annot_pro.ins b/texmf-dist/source/latex/annot-pro/annot_pro.ins new file mode 100644 index 00000000..db093b1d --- /dev/null +++ b/texmf-dist/source/latex/annot-pro/annot_pro.ins @@ -0,0 +1,63 @@ +%% +%% 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 1999-2006 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{2009/02/26} +\def\batchfile{annot_pro.ins} +% +% If you can assume that the target audience for the document all have +% Acrobat Reader 5.0 or later, then chance the following switch to true, +% else, leave it as false. + +\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{annot_pro.sty}{\from{annot_pro.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/texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex b/texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex new file mode 100644 index 00000000..167bc0ea --- /dev/null +++ b/texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex @@ -0,0 +1,1120 @@ +% +% http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf +% +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass[12pt]{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,tight*, + forcolorpaper,latextoc,extended}, + aebxmp,eforms,graphicxsp={showembeds} +]{aeb_pro} +\usepackage{array} +\usepackage{aeb_mlink} +%\usepackage{myriadpro} %[usecmtt] +\usepackage[altbullet]{lucidbry} +\usepackage{annot_pro} +\usepackage{richtext} + +\DeclareInitView +{% + layoutmag={mag=100}, +% windowoptions={fit} +} + +%\useAAXdimtrue + +\usepackage{makeidx} +\makeindex +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\def\expath{../examples} + +\urlstyle{rm} +\def\pkg{\textsf} +\let\app\textsf +\let\opt\texttt +\let\uif\textsf +\let\env\texttt +\def\meta#1{\textit{\texttt{#1}}} +\def\ameta#1{$\langle\textit{\texttt{#1}}\rangle$} +\newdimen\aebdimen \aebdimen6pt %\partopsep \advance\aebdimen\partopsep +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} +\def\SUB#1{\ensuremath{{}_{\text{#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\amtIndent\leftmargini + +%\def\tutpath{doc/tutorial} +%\def\tutpathi{tutorial} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \texorpdfstring{\textsf{annot\_pro} Package\\[1em]}{annot\textunderscore pro Package: } + Text, Stamp, File Attachment, and Text Box Annotations}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Documentation for annot\textunderscore pro from AcroTeX}, + talksite={\url{www.acrotex.net}}, + version={1.1b, 2016/10/18}, + keywords={sticky notes, stamps, file attachment text box, free text, annotations}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-40pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-20pt,color=aeb} +\subsubsectionLayout{indent=0pt,color=aeb} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\embedEPS[hiresbb,transparencyGroup]{AdobeDon}{../examples/graphics/AdobeDon} + +\makeStamp{0.0 0.0 20.0 20.0}{AdobeDon}{% + [ 20 \widthOf{AdobeDon} div 20 \widthOf{AdobeDon} div scale {AdobeDon} /SP pdfmark +} + +\makeatletter +\def\setDisplayNumber#1#2{\kern0pt + \setlength\abovedisplayshortskip{0pt}% + \setlength\belowdisplayshortskip{0pt}% + \setlength\abovedisplayskip{0pt}% + \setlength\belowdisplayskip{0pt}% + \begin{equation}\label{#2}\end{equation}\kern0pt +} +\renewenvironment{quote}[1][] + {\def\@rgi{#1}\ifx\@rgi\@empty + \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi + \list{}{\rghtm} %{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{5} +\renewcommand*{\theparagraph}{\texorpdfstring{\protect\P\protect\ }{\textparagraph}} +\renewcommand{\paragraph} + {\renewcommand{\@seccntformat}[1]{\theparagraph}% + \@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\color{\aeb@subsubsectioncolor}\bfseries}} +\renewcommand*\l@paragraph{\@dottedtocline{4}{5.0em}{1em}} %{7.0em}{4.1em}} +\def\chgCurrLblName#1{\def\@currentlabelname{#1}} +\def\echgCurrLblName#1{\edef\@currentlabelname{#1}} +\makeatother + + +\setAnnotOptions{subject={AcroTeX Communiqu\'e},title={D.P. Story}} + +%\pagestyle{empty} +%\parindent0pt\parskip\medskipamount + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The annot_pro MANUAL"; +var manualfilename="Manual_BG_Print_annotpro.pdf"; +var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); +\end{docassembly} +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + +\section{Introduction} + +This package is used to create text, stamp, and file attachment +annotations using \textbf{Adobe Distiller}, these annotations can be +viewed in Adobe Reader. For users of \textsf{pdf(la)tex}, use the +\textsf{pdfcomment} package by Josef Kleber.\footnote{Available at \href{http://ctan.org/pkg/pdfcomment}{ctan.org/pkg/pdfcomment}} + +The package primarily in support of my \href{http://www.math.uakron.edu/~dpstory} +{{Acro\negthinspace\TeX} PDF Blog}. I plan to use sticky notes, file attachments, and +custom stamps to make side-comments, and to provide source files. + +\section{Requirements} + +The requirements for your {\LaTeX} system, and well as any other +software, is highlighted in this section. + +\subsection{{\LaTeX} Package Requirements} + +The following packages, in addition to the standard {\LaTeX} +distribution, are required: +\begin{enumerate} + \item The \textsf{xkeyval} package is used to set up the key-value + pairs of the \cs{annot\-pro} command. Get a recent version. + \item The \textsf{xcolor} package is strongly recommended. + \item The \textsf{hyperref} package, a recent version. + \item If you want to create custom stamps (on the fly) using the techniques + developed for that purpose, the \textsf{graphicxsp} Package is required.\footnote + {Available at \href{http://ctan.org/pkg/graphicxsp}{ctan.org/pkg/graphicxsp}} +\end{enumerate} +The \textsf{annot\_pro} package is part of the \textcolor{blue}{AeB +Pro} family, which means \textbf{Adobe Distiller} is required. The +components of \textcolor{blue}{AeB} and \textcolor{blue}{AeB Pro} +are not required.\footnote{AeB: \href{http://ctan.org/pkg/acrotex}{ctan.org/pkg/acrotex}}${}^{,}$\footnote{AeB Pro: +\href{http://ctan.org/pkg/aeb-pro}{ctan.org/pkg/aeb-pro}} + +\subsection{PDF Creator Requirements} + +The \textsf{annot\_pro} package requires \textbf{Acrobat Distiller 5.0} (or +later) as the PDF creator. The document author typically uses dvips (or dvipsone) to +produce a PostScript file, which is then distilled to obtain a PDF. + +If you wish to use (dynamically) created stamps that have opacity less than 1, +you need to distill using \textbf{Standard\_transparancy.joboptions} with distiller, +in this case, \textbf{Acrobat Distiller 6.0} (or later) is required; otherwise, this +distiller job options file is not needed. + +The \textbf{Standard\_transparancy.joboptions} file is supplied with the \textsf{graphicxsp} +package; the documentation of the \textsf{graphicxsp} package includes installation instructions. + +\section{Installation} + +The installation is simple enough. Unzip \texttt{annot\_pro.zip} in a +folder that is on your {\LaTeX} search path. Refresh your filename +database, if appropriate. + +\begin{defineJS}{\winedtDist} +Run(|"c:\\Program Files\\Adobe\\Acrobat 9.0\\Acrobat\\acrodist.exe" -F "%P\\%N.ps"|,'%P',0,0,'%N.ps - Distiller',1,1); +\end{defineJS} + +\paragraph*{\textcolor{red}{Important:}} When creating a file attachment annotation, +you must specify a path to the file to be attached, and distiller must embed +this file. In recent versions of Acrobat, +security restrictions have been put in place to prevent +\textbf{Distiller} from reading files (the PostScript \textbf{file} +operator does not work). Fortunately, Distiller has a switch that +turns off this particular restriction. To successfully use this +package, therefore, you need to run Distiller by using the +\texttt{-F} command line switch. + + +Those using \app{Windows OS} can create a shortcut on the desktop, for example, +that starts \app{Distiller} with the \texttt{-F} switch. The \uif{Target} of the shortcut might read +\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] +"C:\Program Files (x86)\Adobe\ + Acrobat 9.0\Acrobat\acrodist.exe" -F +\end{Verbatim} +where we have wrapped the path to the next line to fit within the margins. +Once \app{Distiller} is started with \texttt{-F}, the switch remains in effect +until \app{Distiller} is closed. + +If this package is used to create file attachment annotations without the +\texttt{-F} switch, you typically get the following error message in +the Distiller log file +\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] +%%[ Error: undefinedfilename; OffendingCommand: file ]%% +\end{Verbatim} +This tells you that either you have not started Distiller with the +\texttt{-F} command line switch, or Distiller can't find one of the +files that the \textbf{file} operator was trying to read. + + + +\newtopic \textbf{Mac OS Users.} The above comments on the \texttt{-F} command line switch +is for Windows users, Mac OS users must choose the \texttt{AllowPSFileOps} user preference, this is located +in the \texttt{plist}, possibly located at +\begin{Verbatim}[fontsize=\small] +/Users/[User]/Library/Preferences/com.adobe.distiller9.plist +\end{Verbatim} +You can also use Spotlight, the search utility on Mac, to search for the string \texttt{com.adobe.distiller}; +the result might be +\begin{quote} +\texttt{com.adobe.distiller9.plist}.\footnote{In the case of Adobe Distiller, version 9.0} +\end{quote} +Clicking on this find, +Spotlight opens \texttt{com.adobe.distiller9.plist} in the \texttt{plist} editor, see \hyperref[plist]{Figure~\ref*{plist}}. +If necessary, click on the arrow next to the Root to expand the +choices, then click the up and down arrows at the far +right in the \texttt{AllowPSFileOps} row to select Yes as the value. +\begin{figure}[hbt]\setlength{\fboxsep}{0pt} +\begin{center} +\fbox{\includegraphics[width=.75\linewidth]{plistEditor}} +\caption{com.adobe.distiller9.plist}\label{plist} +\end{center} +\end{figure} + +\section{The \texorpdfstring{\protect\cs{annotpro}}{\CMD{annotpro}} Command} + +The main command of this package is \Com{annotpro}; the command is controlled by +its optional parameters. The same command can create a text annotation (sticky note), +a stamp annotation, a file attachment or a Free Text (Text Box) annotation. The syntax of this command is +\bVerb\takeMeasure{\string\annotpro[\ameta{KV-pairs}]\darg{\ameta{text}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\annotpro[!ameta(KV-pairs)]{!ameta(text)} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:arbproCmd} +\end{minipage}\end{minipage}\eVerb +\PD The optional argument is one or more key-value pairs that describe the +annotation; the required argument, \ameta{text}, is the ``contents'' of the +annotation; for the text and stamp annotation, \ameta{text} becomes the +contents of the popup annotation, for a file attachment annotation, which has +not associated pop-up, it is the description of the file attachment that +appears in the file attachment panel of Adobe Reader. In the latter case, the +value of \ameta{text} should be rather short. The key-value pairs (\ameta{KV-pairs}) are +described over the next few sections. + +\paragraph*{\color{red}Sample files.} The sample files \texttt{annots.tex} and \texttt{textbox.tex} illustrate the features +of the \pkg{annotpro} package. + +\subsection{Key-values common to all annotations}\label{s:CommonKeys} + +The following are key-value pairs common to all annotations. + +\begin{itemize} + \item \texttt{type=\ameta{\upshape{text|stamp|fileattachment|textbox}}} The \texttt{type} key determines the type of annotation to be produced; + permissible values are \texttt{text}, \texttt{stamp}, and \texttt{fileattachment}. This + key is optional, if not present, \texttt{type=text} is assumed. + \item \texttt{name=\ameta{name}} The name of the icon to use for the declared \texttt{type}. Permissible + values are dependent on the \texttt{type}, and are discussed in subsequent sections. + \item \texttt{title=\ameta{text}} Text to be displayed in the title bar of the annotation's pop-up window + when open and active. By convention, this entry identifies the user who made the annotation, + though any (short) text may be used. You can use \cs{setAnnotOptions} to globally set + the title of each annotation, perhaps using your name. +\begin{Verbatim}[fontsize=\small] + \setAnnotOptions{title={D. P. Story}} +\end{Verbatim} + \item \texttt{subject=\ameta{text}} Text representing a short description of the subject of the annotation. + You can use \cs{setAnnotOptions} to globally set the subject of each annotation, +\begin{Verbatim}[fontsize=\small] + \setAnnotOptions{title={D. P. Story}, + subject={AcroTeX Communiqu\'e}} +\end{Verbatim} + \item \texttt{color}: The color of the title bar of the pop-up window of the annotation. + \item \texttt{readonly=\ameta{\upshape{true|false}}} Set the annotation to readonly. The user can click on the annot to + see the popup, but the user, if using Acrobat, cannot move the annotation around on the page. + The popup window can still be move by the user. (This property makes no difference to the + user of Adobe Reader.) + \item \texttt{opacity=\ameta{dec}}: The opacity value ($ + \text0\le\text{\ameta{dec}}\le\text1$) to be used in painting the (icon of + the) annotation, but does apply to the pop-up window. The default + is 1.0. + \item[] Adobe Distiller handles the opacity for us in all cases except when we create a (dynamic) stamp. + If an opacity value less than 1 is desired, special techniques are needed, and the file needs to + be distilled using the \textbf{Standard\_tranparency} job options. + +\end{itemize} +The following key-values are {\LaTeX} based concerning placement of the annotation in the margin. +\begin{itemize} + \item \texttt{margin}: Use this key (it has no value), to declare that you want the annotation + to appear in the margin. The \cs{marginpar} command from core {\LaTeX} is used, the placement + of the annotation follows the rules set down by {\LaTeX}. You can reverse the placement of the + annotation by using the {\LaTeX} command \cs{reversemarginpar} (annots placed in the right margin, and now placed in the left); + you can return to the default by using \cs{normalmarginpar}. + + \item[] Given that you have use the \texttt{margin} key, there is an associated key that can be used, as well + as a command. + \begin{itemize} + \item \texttt{margintext}: The value of this key is text that will be typeset just below the annotation icon. + \item \cs{marginpartextformat}: A {\LaTeX} command for + formatting the text in the margin, the default definition is\smallskip +\begin{Verbatim} +\margintextformat{\bfseries\tiny\color{blue}} +\end{Verbatim} + \end{itemize} + \item[] For an annotation placed in the margin with margin text, you might want to use the \texttt{readonly} + key, this prevents the user---even one using Acrobat---from moving the annotation away from its caption. +\end{itemize} +The following key-value is for your convenience. +\begin{itemize} + \item \texttt{presets}: A key to allow the introduction of pre-defined options, for example, + you might like all your comment annotations to be red, so you can define +\begin{verbatim} + \def\myComments{type=text,name=Comment,color=red} +\end{verbatim} +then say +\begin{verbatim} + \annotpro[presets=\myComment]{Way to go!} +\end{verbatim} +Additional options may be included, +\begin{verbatim} + \annotpro[presets=\myComment,margin]{Way to go!} +\end{verbatim} +for example. + +\end{itemize} + +\subsection{Key-values for text annotations} + +The position of the annotation is determined by its bounding rectangle; for the +text annotation, an icon is placed so that its upper left corner is at the upper +left corner of the bounding rectangle. The icons themselves have certain dimensions +that have been recorded within the \texttt{annot\_pro} package, so you need not worry +about leaving space for them. + +An important fact about the icons used by text annotation is that they \emph{do not zoom in or out} as the page +magnification is changed; furthermore, the graphics commands \cs{scalebox} and \cs{resizebox} do not rescale +the icons as expected. + +The following are options specific to the text annotation. Recall, the text annotation +is of \texttt{type=text}. +\begin{itemize} + \item \texttt{name}: The name of the icon to use when displaying this annotation in closed form (no pop-up window visible). + Possible values---as specified in the \textsl{PDF Reference}---are + \texttt{Comment}, \texttt{Key}, \texttt{Note}, \texttt{Help}, + \texttt{NewParagraph}, \texttt{Paragraph}, and \texttt{Insert}. + Additional icons that are available in recent versions of Adobe + Reader are +\begin{quote}\raggedright + \texttt{Check}, \texttt{Circle}, \texttt{Cross}, \texttt{Star}, \texttt{RightArrow}, \texttt{RightPointer}, + \texttt{UpArrow}, \texttt{UpLeftArrow} +\end{quote} + If you are using comments in your document, and your audience have + older versions of Adobe Reader, it is best to use only the seven + listed in the \textsl{PDF Reference}. + + \item \texttt{open}: A Boolean value that determines whether the pop-up + window is open or not. When \texttt{true} the pop-up is open. The + package default is \texttt{false}. You can use \cs{setAnnotOptions} + to set this option globally. + + \item \texttt{nohspace}, \texttt{novspace}, \texttt{nospace}: The + presence of these commands zeroes out the dimension(s) of the + bounding rectangle. Specifying \texttt{nohspace} as an option + causes the icon to take up no horizontal space as the page is + latexed. Here\annotpro[nohspace]{This a sticky note with the + nospace option} is an example of a sticky note with the + \texttt{nohspace} option. Without any of these three keys, the text + annotation \annotpro[type=text,name=Key]{A sticky note that takes + up TeX space. If you put the document into 100\% magnification, + you'll see the note fits precisely into the allotted space.} fits + exactly into the allotted space at + \setLinkText[\A{\JS{this.zoom=100;}}\Color{0 .6 0}]{100\% + magnification}, try it. + + When the icon takes up no {\TeX} space, it may cover content on + the page, as it does above. Acrobat users can move the icon + around, but AR users cannot move the icon. The pop-up window is + movable and scalable, but the icon cannot be moved. Therefore, + you must be careful about placement. + + Additional positioning of the icons can be made using standard {\LaTeX} + commands such as \cs{raisebox} and \cs{smash}. For example,\smash{\raisebox{1in}{\annotpro[nospace,color=blue,opacity=.25]{I've raised this annot by 1in. + I've also used the nospace key, the icon does not take up any TeX space.}}} the blue icon above was created by +\begin{Verbatim}[fontsize=\footnotesize] + For example,\smash{\raisebox{1in}\raisebox{1in}{% + \annotpro[nospace,color=blue, + opacity=.25]{...clever message...}}} +\end{Verbatim} +Note that I've set the \texttt{opacity} to .25. + +\end{itemize} + + +\subsection{Key-values for stamp annotations} + +A stamp annotation is similar to a text annotation in the sense that +it has a pop-up window in which the contents of the message is +displayed; however, unlike the text annotation icons, the stamp +appearance by be re-scaled using \cs{scalebox} and \cs{resizebox} of +the graphics package; however, the keys \texttt{scale}, +\texttt{widthTo}, and \texttt{heightTo}, as described below, are the +recommended methods of re-scaling a stamp. + +The following are the key-values associated with this annotation type. + +\begin{itemize} + +\begingroup\raggedright + + \item \texttt{name}: The stamps listed in the \textsl{PDF + Reference} are \texttt{Approved}, \texttt{AsIs}, + \texttt{Confidential}, \texttt{Departmental}, \texttt{Draft}, + \texttt{Experimental}, \texttt{Expired}, \texttt{Final}, + \texttt{ForComment}, \texttt{ForPublicRelease}, + \texttt{NotApproved}, \texttt{NotForPublicRelease}, + \texttt{Sold}, and \texttt{TopSecret}. If \texttt{name} + is not specified, \texttt{Draft} is the default.\par\endgroup + + \item[] There are other stamps, not listed in the \textsl{PDF + Reference}, but available in more recent versions of Acrobat. + The file \texttt{stamps.pdf} lists all the stamps that I have + access to. The names of these other stamps are recognized by the + \texttt{name} key. + + \item[] The dimensions of the stamps listed above are all the + same, they are \texttt{150bp} width and \texttt{40bp} high. + + \item[] Additional stamps are shipped by Acrobat, a listing of these + appears in the file \texttt{stamps.pdf} (\texttt{stamps.tex}). + + \item\texttt{width}, \texttt{height}: If the value of + \texttt{name} key is something other than one of the stamps + listed above (one of the stamps listed in the file + \texttt{stamps.pdf}), the width and height are not known to + \textsf{annot\_pro}. In this case, use the \texttt{height} and \texttt{width} keys + to set the dimensions of the bounding box. Adobe Distiller will + resize the stamp to the stamp is the largest one that can fit in + the bounding box, the stamp will be centered vertically and + horizontally within the bounding box. + + \item[] Here are a couple of examples, the bounding box is should as a black \cs{fbox}. + +\begin{itemize} + +\previewtrue + + \item This one \annotpro[type=stamp,name=SBApproved,widthTo=106bp,color=webbrown]{This package just got better!} + fits more or less exactly. I determined the dimensions of this stamp through some controls of the user interface. + Contrast this this stamp + \annotpro[type=stamp,width=50bp,height=50bp,name=SBApproved,color=webbrown]{This package just got better!} + obtained by setting \texttt{width=50bp} and \texttt{height=50bp}. Notice the ``best fit,'' and that the bounding + box takes up space. We can use \cs{smash} to smash its vertical height, let's see how that looks, + \smash{\annotpro[type=stamp,width=50bp,height=50bp,name=SBApproved,color=webbrown]{This package just got better!}} + +\smallskip + +\begin{defineJS}{\annotstampi} +Exact fit: +\\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!} +\end{defineJS} +\begin{defineJS}{\annotstampii} +Bad rectangle, but stamp fits the best it can: +\\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!} +\end{defineJS} + +\previewfalse + + \item[] The code for producing these stamps are given in the margins. + \annotpro[margin,readonly,margintext={\centering Good Fit}]{\annotstampi}% + \annotpro[margin,readonly,margintext={\centering Bad Fit}]{\annotstampii}% + +\begin{defineJS}{\annotstampiii} +Resize using \\resizebox. \\raisebox was used to lift the same up a little: +\\raisebox{4pt}{\\resizebox{.5in}{!}{\\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!}}} +\end{defineJS} + + \item[] You can resize these stamps using \cs{scalebox} and \cs{resizebox}, like so. + \raisebox{4pt}{\resizebox{.5in}{!}{\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!}}} + \enspace The code for producing this stamp are given here \annotpro{\annotstampiii}. + +\begin{defineJS}{\annotstampiv} +\smash{\makebox[0pt][l]{\annotpro[type=stamp,name=Approved,color=blue]{I give my stamp of approval!}}} +\end{defineJS} + +\item To create a stamp\smash{\makebox[0pt][l]{\annotpro[type=stamp,name=Approved,color=blue]{I give my stamp of approval!}}} that takes up no space, it is easiest to use \cs{smash} and \verb!\makebox[0pt][l]{text}!; + here is one of the standard stamps as listed in the \textsl{PDF Reference}. The code for this stamp is given + in this note \annotpro{\annotstampiv}. +\end{itemize} + +\item[] Try changing the magnification of the page, you'll see that stamps are re-scaled as you zoom in or out, while +the text annotations are not. I don't like text annotations for this reason. + +\begin{defineJS}{\annotstampv} +\\annotpro[type=stamp,customStamp=MyDPSImage,ap=AdobeDon,color=webbrown]{This is the best picture of me ever taken. Akron, about 2005.} +\end{defineJS} + +\item\texttt{rotate}: Stamps can be rotated, use this key to enter an angle of rotation, for example, + \texttt{rotate=30} rotates the stamp $\text{30}^\circ$ counter clock-wise. + +\item[\textcolor{red}{\ding{043}}] Do not use the \cs{rotatebox} command of \textsf{graphics} package, +this command \emph{does not rotate} the stamp. + +\item \texttt{scale}: Use this key to re-scale the stamp; the value of this key is a number between + 0 and 1. For example, \texttt{scale=.5} reduces both width and height in half. +\item \texttt{widthTo}: This key resizes the stamp so that the width is the value of this key; for example, + \texttt{widthTo=2in} re-scales the stamp to have a 2in width. +\item\texttt{heightTo}: This key resizes the stamp so that the height is the value of this key; for example, + \texttt{heightTo=2in} re-scales the stamp to have a 2in height. + +\item[] Only one of the keys \texttt{scale}, \texttt{widthTo}, and \texttt{heightTo} are recognized + for any stamp annotation. If all three are specified, only \texttt{scale} is used. If + \texttt{widthTo} and \texttt{heightTo} are both specified, then \texttt{widthTo} is used. + +\item[\textcolor{red}{\ding{043}}] The use of these keys is the recommend way of re-scaling +a stamp. These methods are compatible with the \texttt{rotate} key. + +\item \texttt{customStamp}: You can create a custom stamp from any + image you wish to use, here is + \annotpro[type=stamp,customStamp=MyDPSImage,ap=AdobeDon,color=webbrown]{This + is the best picture of me ever taken. Akron, about 2005.} one such + example. The code for the above stamp is given here + \annotpro{\annotstampv}. + +\item \texttt{ap}: When the \texttt{\texttt{customStamp}} key is + used, you have to supply an indirect reference to the appearance of + the stamp. This reference is made through the \texttt{ap} key. The + example above demonstrates the use of the \texttt{ap} key. +\end{itemize} +\textbf{\textcolor{red}{Important:}} When using the stamps of +\app{Acrobat} always perform a \uif{SaveAs} on the file when you have finished +building the file. This imports the appearances of the stamps into +the document and saves them. + +\redpoint The creation of a custom stamp requires detailed list of steps, at +some point I'll write a white paper on the subject.\footnote{Use the \pkg{mkstmp} package +(\href{http://ctan.org/pkg/mkstmp}{ctan.org/pkg/mkstmp}), +details of how to create custom stamps are included in the documentation.} + +\begin{defineJS}{\approvedStmp} +\\annotpro[type=stamp,name=Approved,widthTo=2in,rotate=30]{...} +\end{defineJS} + +\newtopic +Here's an example of the keys \texttt{rotate} and \texttt{widthTo}: +\begin{center} + \annotpro[type=stamp,name=Approved,widthTo=2in,rotate=30]{The source for this + stamp is ...\string\r\approvedStmp} +\end{center} + +\subsection{Key-values file attachment annotations} + +The file attachment annotation has no pop-up window, the value of the required parameter is used as a description +of the attached file, and appears in the file attachment window. + +The key-value pairs special to this type of annotation are as follows. + +\begin{itemize} + \item\texttt{name}: The name of the icon to use, permitted values are + \texttt{Graph}, \texttt{Paperclip}, \texttt{PushPin}, and \texttt{Tag}. If the value of name is not + specified, the default is \texttt{PushPin}. The annot\_pro package knows the dimensions of each of these + icons, so you need not worry about them. They can be re-scale using standard commands from the graphics package, + though, there may be little need of doing so. + \item \texttt{file}: The value of the file key is the \emph{absolute path} to the file to be attached. I've + devised a helper command \Com{defineAPath} that can be used to define the path to your file. For example, we can + define a path to wherever the files are, like so +\begin{Verbatim}[fontsize=\footnotesize] + \defineAPath{\graphicsPath} + {C:/Users/Public/Documents/My TeX Files/% + tex/latex/aeb/aebpro/annot_pro/examples/graphics} +\end{Verbatim} +\item[] The command takes two arguments, the name of the command to be defined, and the path. + +\defineAPath{\graphicsPath}{C:/Users/Public/Documents/My TeX Files/tex/latex/aeb/aebpro/annot_pro/examples/graphics} + +\begin{defineJS}{\fa} +\\annotpro[type=fileattachment,file={\graphicsPath/AdobeDon.pdf},name=Paperclip]{The author of annot\_pro (ho, ho).} +\end{defineJS} + +\item[] We can create a file attachment + \annotpro[type=fileattachment,file={\graphicsPath/AdobeDon.pdf},name=Paperclip]{The + author of annot\_pro (ho, ho).} like so, ho, ho. Here is the code + for this file attachment \annotpro[name=Star]{\fa}. Clicking the + file attachment icon will open the file, in recent versions of + Acrobat, the file is listed in the file attachments panel. Open it + using the user interface, and you'll see the file listed, as well + as a description, as passed to the annot as the second argument of + \cs{annotpro}. +\end{itemize} + +The file attachment icons can be resized using any of the graphics commands, \cs{scalebox} or \cs{resizebox}. + +\subsection{The \texorpdfstring{\protect\uif{Text Box}}{Text Box} + (\texorpdfstring{\protect\uif{Free Text}}{Free Text}) annotation} + +A \uif{Text Box} annotation is a rectangular region in which the user can +enter rich text. The annotation may be created and `pre-populated' with rich text from a +{\LaTeX} source through the \pkg{annot\_pro} package. + +The \uif{Text Box} annotation, as implemented by this package, requires the +\pkg{richtex} package, dated 2016/09/30 or later. A one simple method for +introducing \pkg{richtext} is through the \opt{useTextBox} option of +\pkg{annot\_pro}. Placing the following line in the preamble: +\begin{Verbatim}[xleftmargin=\amtIndent] +\usepackage[useTextBox]{annot_pro} +\end{Verbatim} +declares you are going to use \uif{Text Box} annotations. The option does +nothing more than to execute \cs{usepackage\darg{richtext}[2016/09/30]}. The +option is more of a convenience. + +To create a \uif{Text Box} (originally named \uif{Free Text}) annotation use the \cs{annotpro} command. +\bVerb\begin{minipage}{\linewidth} +\begin{minipage}{3.5in} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!(),fontsize=\small] +\annotpro[!textbf(type=textbox),!ameta(KV-pairs)] + {richtext=!ameta(name),defstyle=!ameta(name)} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:textbox} +\end{minipage}\end{minipage}\eVerb +Notice the second argument is not \ameta{text} as it is with the other annotations, but consists +of key-value pairs; recognized keys are \texttt{richtext} and \texttt{defstyle}. + +\newtopic\noindent The sample file \texttt{textbox.tex} illustrates the features of this section. + +\subsubsection{Creating an empty \texorpdfstring{\protect\uif{Text Box}}{Text Box}} + +A common application would be to create an empty \uif{Text Box} for the +document consumer to type in comments. Below is an example of a \uif{Free +Text} annotation, called \uif{Text Box} by the user-interface of +\app{Acrobat}/\app{Adobe Reader}. +\begin{flushleft} %\previewtrue +\begin{minipage}{2in} +\annotpro[title=dpstory,type=textbox,subject=Empty Text Box]{} +\end{minipage}\hfill +\begin{minipage}{\linewidth-2in-10pt}\small +Press \uif{Ctrl+E} (\app{Windows}) or \uif{Cmd+E} (\app{Mac OS}) to obtain +the \uif{Properties} toolbar, now click on the text box to obtain the +\uif{Text Box Properties} toolbar. Double clicking on the text box +brings up the \uif{Text Box Text Properties} toolbar. +\end{minipage} +\end{flushleft} +The verbatim listing of the above \uif{Text Box} is, +\begin{Verbatim}[xleftmargin=\leftmargini] +\annotpro[type=textbox, + title=dpstory,subject=Empty Text Box]{} +\end{Verbatim} +The required second argument is empty, which leads to an empty \uif{Text Box}. + +\subsubsection{Creating a non-empty \texorpdfstring{\protect\uif{Text Box}}{Text Box}} + +A much more interesting exercise is to pre-populate the \uif{Text Box} with rich text for the +document consumer to read and/or to respond. + +\paragraph[Steps to create rich text content]{Steps to create rich text content.}\chgCurrLblName{Steps to create rich text content}\label{para:StepsRC} +We briefly outline the techniques to create rich text +for a \uif{Text Box} annotation. +\begin{itemize} + \item Use the \env{textboxpara} environment and the \cs{rtpara} command + to declare your rich text paragraph. +\bVerb\takeMeasure{\string\rtpara[\ameta{KV-pairs}]\darg{\ameta{name\SUB{para}}}\darg{\ameta{rich-content}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\begin{textboxpara} +\rtpara[!ameta(KV-pairs)]{!ameta(name!SUB(para))}{!ameta(rich-content)} +... +\end{textboxpara} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:rtpara} +\end{minipage}\end{minipage}\eVerb +Details of the \cs{rtpara} command are found in the documentation manual of +the \pkg{richtext} package. The \env{textboxpara} environment is needed for +certain redefinitions of internals because of the different way rich text +is supported and implemented in the \uif{Text Box} annotation verses the +rich text field. + +\item Use the \cs{setRVVContent} command on your \cs{rtpara}-declared rich text and give it +a name \ameta{name\SUB{rvvc}}. +\bVerb\takeMeasure{\string\setRVVContent\darg{\ameta{name\SUB{rvvc}}}\darg{\ameta{name\SUB{para}}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\setRVVContent{!ameta(name!SUB(rvvc))}{!ameta(name!SUB(para))} +... +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:setRVVC} +\end{minipage}\end{minipage}\eVerb +This command expands the paragraph named \ameta{name\SUB{para}} and +develops the rich text version and the plain text version. It is +\ameta{name\SUB{rvvc}} that is used as a value for the \opt{richtext} key +above and illustrated below. To reduce the number of names, you can use +the same name for \ameta{name\SUB{rvvc}} as for \ameta{name\SUB{para}} +(\cs{setRVVContent\darg{para1}\darg{para1}}). + +The rich text \emph{form field} supports multiple paragraphs, and richer +formatting options than the \uif{Text Box} annotation. Of importance is +that the \uif{Text Box} annotation only permits a \emph{single paragraph}. + +\item (Optional) Declare a (named) default style using \cs{setDefaultStyle}: +\bVerb\takeMeasure{\string\setDefaultStyle\darg{\ameta{name\SUB{ds}}}\darg{\ameta{KV-pairs}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\setDefaultStyle{!ameta(name!SUB(ds))}{!ameta(KV-pairs)} +... +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:setDefStyle} +\end{minipage}\end{minipage}\eVerb +This default style is assignment a name that is used as the value of the +\opt{defstyle} key mentioned earlier, and illustrated below. If a value for +\opt{defstyle} is not provided, a standard default style is used. + +\end{itemize} +Once the \cs{rtpara}-declared paragraphs have been made and their names have passed through +\cs{setRVVContent}, you are ready to create a \uif{Text Box} annotation. + +\paragraph[Key-values for second argument]{Key-values for second argument.}\chgCurrLblName{Key-values for second argument}\label{para:KV2ndArg} +The required second argument, refer to display~\eqref{display:textbox}, has +two keys, both of which are optional. You are encouraged to read the +documentation for the \pkg{richtext} package for greater understanding of the +descriptions and examples found below. +\begin{description} + \item[\texttt{richtext=\ameta{name\SUB{rvvc}}}] The \opt{richtext} key + is the way the rich text is passed to the \uif{Text Box}. The + \ameta{name\SUB{rvvc}} is declared by the \cs{setRVVContent} + command. Use the command \cs{rtpara} within the \env{textboxpara} + environment to define the actual rich text paragraph. For example, +\begin{Verbatim}[fontsize=\small,commandchars=!()] +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \bf{rich text}!} +\end{textboxpara} +\setRVVContent{myContent}{para1} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{!textbf(richtext=myContent)} +\end{Verbatim} +The above code produces the following \uif{Text Box}: +\begin{quote} +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \bf{rich text}!} +\end{textboxpara} +\setRVVContent{myContent}{para1} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{richtext=myContent} +\end{quote} + + \item[\texttt{defstyle=\ameta{name\SUB{ds}}}] Through the + \opt{defstyle} you can define set the default style (refer to the + documentation of the \pkg{richtext} package. If this key does not + appear, then a predefined default style is provided. +\begin{Verbatim}[fontsize=\small,commandchars=!()] +\setDefaultStyle{myDS}{font={'Myriad Pro',sans-serif}, + color=0000FF} +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \it{rich text}!} +\setRVVContent{para1}{para1} +\end{textboxpara} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{richtext=para1,!textbf(defstyle=myDS)} +\end{Verbatim} +Notice that we've used the name `\texttt{para1}' for both \cs{setRVVContent} +and \cs{rtpara}. The above code produces the following \uif{Text Box}: +\begin{flushleft}%\previewtrue +\begin{minipage}{2in} +\setDefaultStyle{myDS}{font={'Myriad Pro',sans-serif},color=0000FF} +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \it{rich text}!} +\end{textboxpara} +\setRVVContent{para1}{para1} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{richtext=para1,defstyle=myDS} +\end{minipage}\hfill +\begin{minipage}{\linewidth-2in-10pt}\small +Press \uif{Ctrl+E} (\app{Windows}) or \uif{Cmd+E} (\app{Mac OS}) to +obtain the \uif{Properties} toolbar, now double click on the text box to +obtain the \uif{Text Box Text Properties} toolbar to verify the font used +is indeed Myriad Pro. +\end{minipage} +\end{flushleft} +\end{description} +If you are at all interested in generating the \uif{Text Box} annotation using rich text +strings, you are encouraged to read the documentation on \pkg{richtext}, +there you will learn about all the key-values available to format the text +and the paragraph. + +The \pkg{richtext} package was written for rich text form fields, but applies +to rich text annotations as well; however, it should be noted that there are +differences between forms and text box annotations in how they handle rich +text. One of the major differences is that rich text annotations (\uif{Text +Box}) \emph{do not support} multiple paragraphs as form fields do; as a +result, features listed in the \uif{Paragraph} and \uif{Link} tabs of the +\uif{Form Field Text Properties} dialog box are not available for the +\uif{Text Box}. + +\paragraph[Keys \& commands inherited from the \texorpdfstring{\protect\pkg{richtext}}{richtext} package]% +{Keys \& commands inherited from the \pkg{richtext} package.}% +\chgCurrLblName{Keys \& commands inherited from the \pkg{richtext} package}\label{para:InheritedKeys} +The following keys are supported by the \uif{Text Box} annotation: +\bVerb\begin{minipage}{\linewidth} +\begin{minipage}[c]{4in} +\xdef\panelWidth{\the\linewidth}% +\begin{quote}\raggedright +\opt{font}, \opt{size}, \opt{\st{raise}}, \opt{ulstyle}, +\opt{color}, \opt{\st{url}}, \opt{style}, \opt{\st{raw}}, \opt{halign} +\end{quote} +\end{minipage}\hfill +\begin{minipage}[c]{\linewidth-\panelWidth} +\setDisplayNumber\label{display:suppKeys} +\end{minipage}\end{minipage}\eVerb +The following commands are supported: +\bVerb\begin{minipage}{\linewidth} +\begin{minipage}[c]{4in} +\xdef\panelWidth{\the\linewidth}% +\begin{quote}\raggedright +\cs{span}, \cs{br}, \cs{it}, \cs{bf}, \cs{sup} and \cs{sub} +\end{quote} +\end{minipage}\hfill +\begin{minipage}[c]{\linewidth-\panelWidth} +\setDisplayNumber\label{display:suppCmds} +\end{minipage}\end{minipage}\eVerb +The ones having an overstrike are supported in a rich text \emph{form field}, but +not within an \uif{Text Box}. Refer to the documentation of the +\pkg{richtext} for details of these keys and commands. In this document, we +illustrate by example. + +\paragraph[Key-values of \texorpdfstring{\protect\cs{rtpara}}{\textbackslash{rtpara}}]{Key-values of \cs{rtpara}.}% +\chgCurrLblName{Key-values of \cs{rtpara}}\label{para:KeysPara} The +keys of display~\eqref{display:suppKeys} -- excluding the overstrike ones -- may be used in the +\ameta{KV-pairs} argument of \cs{rtpara} of display~\eqref{display:rtpara}. + +\paragraph[Permissible commands within \texorpdfstring{\protect\ameta{rich-content}}{<rich-content>}]{% +Permissible commands within \ameta{rich-content}.}\chgCurrLblName{Permissible +commands within \ameta{\ameta{rich-content}}}\label{para:KeysCmdsRC} The +\ameta{rich-content} argument of display~\eqref{display:rtpara} (normally) +consists of Latin 1 characters, plus any markup in the form of the commands +listed in display~\eqref{display:suppCmds}. +\begin{itemize} + \item \cs{span} has two arguments, more on this command in the paragraph below + titled \Nameref{para:Span}. + \item \cs{br} is a line break, it has no argument. + \item \cs{it} is italic font; it has one argument, the text to be + placed in italics: \cs{it\darg{this is italic}}. + \item \cs{bf} is bold font; it has one argument, the text to be placed in bold: + \cs{bf\darg{this is bold}}. + + \cs{it} and \cs{bf} may be nested: \cs{it\darg{\cs{bf\darg{bold and italic}}}}. + + \item \cs{sup} and \cs{sub} are superscript and subscript, respectively; they each + have one argument, the text to be raised or lowered. For example, + \verb~We can \sup{raise} or we can \sub{lower} text~. +\end{itemize} +The above markups, with the exception of \cs{span} are illustrated below. +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{mypara}{\\it{This is italic}, whereas \\bf{this is bold}, but wait, we can do +\\it{\\bf{bold and italic}}.\\br\\br Moving on, we can \\sup{raise} or we can \\sub{lower} text.} +\\end{textboxpara} +\\setRVVContent{mypara}{mypara} +\\annotpro[type=textbox,width=3.5in]{richtext=mypara} +\end{defineJS} +\begin{quote} +\begin{textboxpara} +\rtpara{mypara}{\it{This is italic}, whereas \bf{this is bold}, but wait, we can do +\it{\bf{bold and italic}}.\br\br Moving on, we can \sup{raise} or we can \sub{lower} text.} +\end{textboxpara} +\setRVVContent{mypara}{mypara} +\annotpro[type=textbox,width=3.5in]{richtext=mypara}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +The verbatim listing for this example is in the sticky note in the margin. + +\paragraph[Some comments on the \texorpdfstring{\protect\cs{span}}{\textbackslash{span}} +command]{Some comments on the \cs{span} command.}\chgCurrLblName{Some comments on the \cs{span} command}\label{para:Span} +the \cs{span} command, defined only locally within the \ameta{rich-text} argument \cs{rtspan} is a general purpose +command to format text. It has two argument: +\begin{quote} +\cs{span\darg{\ameta{KV-pairs}}\darg{\ameta{text}}}. +\end{quote} +The \ameta{KV-pairs} argument can be the keys of +display~\eqref{display:suppKeys} (again excluding the overstrike keys). The \ameta{text} argument is the +text to be made rich; experience shows that \cs{it}, \cs{bf}, \cs{sub} and \cs{sup} may be used within +\ameta{text}. Italic and bold may be accomplished using the \opt{style} key, probably preferred over +using \cs{it} and \cs{bf} within \ameta{text}. +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{para1}{Welcome to my \\span{style={strikeit,bold}}{poor}\\span{style=bold}{rich text world}. +We add a little color shall we try \\span{color=FF0000}{red} or \\span{color=00FF00}{green}?\\br\\br +There are several styles of underlining \\span{ulstyle=ul}{basic underlining}, +\\span{ulstyle=2ul}{double underlining}, \\span{ulstyle=wul}{word underlining}, and +\\span{ulstyle=2wul}{double word underlining}. Cool.} +\\end{textboxpara} +\\setRVVContent{para1}{para1} +\\annotpro[type=textbox,width=4.5in,height=14bp*7]{richtext=para1} +\end{defineJS} +\begin{quote} +\begin{textboxpara} +\rtpara{para1}{Welcome to my \span{style={strikeit,bold}}{poor}\span{style=bold}{rich text world}. +We add a little color shall we try \span{color=FF0000}{red} or \span{color=00FF00}{green}?\br\br +There are several styles of underlining \span{ulstyle=ul}{basic underlining}, +\span{ulstyle=2ul}{double underlining}, \span{ulstyle=wul}{word underlining}, and +\span{ulstyle=2wul}{double word underlining}. Cool.} +\end{textboxpara} +\setRVVContent{para1}{para1} +\annotpro[type=textbox,width=4.5in,height=14bp*7]{richtext=para1}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +The verbatim listing for this example is in the sticky note in the margin. + +\paragraph[Key-values of \texorpdfstring{\protect\cs{setDefaultStyle}}{\textbackslash{setDefaultStyle}}]% +{Key-values of \cs{setDefaultStyle}.}% +\chgCurrLblName{Key-values of \cs{setDefaultStyle}}\label{para:KeysDS} The +keys of display~\eqref{display:suppKeys} -- excluding the overstrike ones -- +may be used in the \ameta{KV-pairs} argument of \cs{setDefaultStyle} of +display~\eqref{display:setDefStyle}; however, only the keys \opt{font}, +\opt{size}, \opt{color}, and \opt{halign} are typically used. For example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()] +\setDefaultStyle{myDS}{font={'Myriad Pro',sans-serif}, + size=12.0,color=0000FF,halign=left} +\end{Verbatim} +The name `\opt{myDS}' may then be used as the value of \opt{defstyle} key in the second argument +of \cs{annotpro}, see display~\eqref{display:textbox}. + +\subsubsection{Key-values for text box annotations} + +\hyperref[s:CommonKeys]{Section~\ref*{s:CommonKeys}} lists keys that are +common to all annotations; we list the ones that make sense for the \uif{Text +Box} annotation, and strikeout these that do not: +\begin{quote}\raggedright +\texttt{type}, \texttt{\st{name}}, \texttt{title}, \texttt{subject}, +\texttt{\st{color}}, \texttt{readonly}, \texttt{opacity}, \texttt{margin}, +\texttt{presets} +\end{quote} +In addition to these keys, there are several keys particular to the text box +annotation. We list these and describe them in detail. +\begin{itemize} + \item \texttt{width=\ameta{length}}: The width of the annotation, the + default is \texttt{144bp} (\texttt{2in}). + \item \texttt{height=\ameta{length}}: The height of the annotation, the + default is \texttt{72bp} (\texttt{1in}). + \item \texttt{bgcolor=\ameta{color}} The color to be used as the background color + of the text box annotation. If \opt{bgcolor} has no value, transparent color is used. + The default is white. + \item \texttt{bcolor=\ameta{color}} The color to be used as the boundary color of the + annotation. The default is black. + \item \texttt{borderstyle=\ameta{choice}}: This keys determines the + style of border to be used. It is a choice key, choices are + \texttt{none}, \texttt{solid}, \texttt{dash1}, \texttt{dash2}, + \texttt{dash3}, \texttt{dash4}, \texttt{dash5}, \texttt{dash6}, + \texttt{cloud1}, and \texttt{cloud2}. The default is \texttt{solid}. + \item \texttt{borderwidth=\ameta{choice}}: The border width of the + annotation, acceptable choices are \texttt{.5}, \texttt{1}, \texttt{2}, + \texttt{3}, \texttt{4}, \texttt{6}, 8, and \texttt{10}. The default is \texttt{1}. +\end{itemize} +\begin{textboxpara} +\rtpara{para1}{\cs{annotpro[type=textbox, width=\cs{linewidth}, height=14bp*2, bgcolor=cornsilk, +bcolor=blue]{richtext=para1}}}\setRVVContent{para1}{para1} +\rtpara{para2}{\cs{annotpro[type=textbox, width=\cs{linewidth}, height=16bp*3, bgcolor, bcolor=red, +borderstyle=dash2, borderwidth=2]{richtext=para2}}}\setRVVContent{para2}{para2} +\rtpara{para3}{\cs{annotpro[type=textbox, width=\cs{linewidth}, height=18bp*3, bcolor=red, +borderstyle=cloud1]{richtext=para3}}}\setRVVContent{para3}{para3} +\end{textboxpara}%\previewtrue +\setDefaultStyle{myDS}{font=Courier,size=12.0,color=000000} +\annotpro[type=textbox, width=\linewidth, height=14bp*2, bgcolor=cornsilk, bcolor=blue]{richtext=para1,defstyle=myDS}\\[6bp] +\annotpro[type=textbox, width=\linewidth, height=16bp*3, bgcolor, bcolor=red, borderstyle=dash2, borderwidth=2]{richtext=para2,defstyle=myDS}\\[6bp] +\annotpro[type=textbox, width=\linewidth, height=18bp*3, bcolor=red, borderstyle=cloud1]{richtext=para3,defstyle=myDS}\\[6bp] +The second text box annotation above has transparent background color. Using your pointing device, move it around to verify +the background is `see through', compare with the other two by moving them around, not `see through'. + +\subsubsection{Accented glyphs and the unicode characters} + +There are several advantages that text box annotation have over rich text +form fields: movability and unicode. An annotation can be moved around the +page by the user quite easily, a form field typically cannot unless the user +is using \app{Acrobat}. Also, when it comes to using unicode, text box +annotations are far superior to rich text form fields. Unicode characters may +be inserted using the convenience commands \cs{uHex} and \cs{uDec}, where the +first take a hex code as its argument and the second takes a non-negative +integer as its argument. Latin1 accented characters can be entered using octal notation +for example, \verb~J\374rgen~ +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{para1}{J\\374rgen is a nice fellow, though I've never met him.\\br\\br +We've communicated, J\\uHex{00FC}rgen and I, via email. J\\uDec{252}rgen where are you?} +\\end{textboxpara} +\\setRVVContent{para1}{para1} +\\annotpro[type=textbox,width=4.5in,height=14bp*7]{richtext=para1} +\end{defineJS} +\begin{textboxpara} +\rtpara{para1}{J\374rgen is a nice fellow, though I've never met him.\br\br +We've communicated, J\uHex{00FC}rgen and I, via email. J\uDec{252}rgen where are you?} +\end{textboxpara} +\begin{quote}%\previewtrue +\setRVVContent{para1}{para1} +\annotpro[type=textbox,width=4in,height=16bp*4]{richtext=para1}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +But wait, we're not done. In theory, we can access any unicode character through the use +of \cs{uHex} or \cs{uDec}. I'll randomly pick off some unicode characters. +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{para1}{% +\\uHex{01A2}, \\uHex{023E}, \\uHex{03A3}, \\uHex{0416}, +\\uHex{0583}, \\uHex{06A6}, \\uHex{263A}, \\uHex{FB21}, +\\uHex{82A0}, \\uHex{4EE4}, \\uHex{F92C}, \\uHex{5475}} +\\end{textboxpara} +\\setRVVContent{para1}{para1} +\\annotpro[type=textbox,width=4in,height=14bp*2]{richtext=para1} +\end{defineJS} +\begin{textboxpara} +\rtpara{para1}{% +\uHex{01A2}, \uHex{023E}, \uHex{03A3}, \uHex{0416}, +\uHex{0583}, \uHex{06A6}, \uHex{263A}, \uHex{FB21}, +\uHex{82A0}, \uHex{4EE4}, \uHex{F92C}, \uHex{5475}} +\end{textboxpara} +\begin{quote}%\previewtrue +\setRVVContent{para1}{para1} +\annotpro[type=textbox,width=4in,height=14bp*2]{richtext=para1}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +Cool! + + +\subsection{Setting Global Options with + \texorpdfstring{\protect\cs{setAnnotOptions}}{\CMD{setAnnotOptions}}} + +Global options are by using the \cs{setAnnotOptions} command. +In the preamble of this document I placed +\begin{Verbatim}[fontsize=\footnotesize] +\setAnnotOptions{subject={AcroTeX Communiqu\'e},title={D.P. Story}} +\end{Verbatim} +That way, I didn't have to constantly type in my personal name for each example. These options can be overwritten +by specifying options locally, if I say, \cs{annotpro[author=Don Story]\darg{Hi there!}}, the author is now my +alter ego, Don Story. + +%\redpoint\textbf{\textcolor{red}{Important:}} Certain key, \texttt{name}, should not be used to set global options, +%\cs{setAnnotOptions} tests for these, and puts them back to their default values that are expected +%by \cs{annotpro}. These keys should only be used for passing options to \cs{annotpro} in its option list. + + +\bigskip +\noindent +That's all for now, I simply must get back to my retirement. \dps\space\annotpro[type=stamp, + customStamp=MyDPSImage,ap=AdobeDon,color=webbrown]{% + Did I say that I had to get back to my retirement?} + +\end{document} |