From e16b8e85c829a4c86c8b24241b3d05ca3499535a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 19 Feb 2009 23:44:10 +0000 Subject: pdfcomment update (19feb09) git-svn-id: svn://tug.org/texlive/trunk@12191 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/pdfcomment/pdfcomment.sty | 632 ++++++++++++++++++--- 1 file changed, 565 insertions(+), 67 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty index b06f7885301..ec605e03752 100644 --- a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty +++ b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2008 by: +%% Copyright (C) 2008-2009 by: %% Josef Kleber %% %% @@ -20,7 +20,7 @@ %% This work consists of all files listed in manifest.txt. %% % -\ProvidesPackage{pdfcomment}[2008/12/12 pdfcomment.sty v1.1 - Josef Kleber (C) 2008]% +\ProvidesPackage{pdfcomment}[2009/02/19 pdfcomment.sty v1.2 - Josef Kleber (C) 2008-2009]% % dvips, dvipdfmx, XeLaTeX drivers by Alexander Grahn % \RequirePackage{xkeyval}% @@ -31,7 +31,13 @@ \gdef\pc@goptd@author{}% \gdef\pc@goptd@icon{Comment}% \gdef\pc@goptd@open{false}% -\gdef\pc@goptd@hspace{15pt}% +\gdef\pc@goptd@hspace{0pt}% +\gdef\pc@goptd@voffset{0pt}% +\gdef\pc@goptd@hoffset{0pt}% +\gdef\pc@goptd@width{0pt}% +\gdef\pc@goptd@height{0pt}% +\gdef\pc@goptd@depth{0pt}% +\gdef\pc@goptd@opacity{1.0}% \gdef\pc@goptd@dvipdfmx{true}% % % values for global package options @@ -41,6 +47,12 @@ \gdef\pc@gopt@icon{}% \gdef\pc@gopt@open{}% \gdef\pc@gopt@hspace{}% +\gdef\pc@gopt@voffset{}% +\gdef\pc@gopt@hoffset{}% +\gdef\pc@gopt@width{}% +\gdef\pc@gopt@height{}% +\gdef\pc@gopt@depth{}% +\gdef\pc@gopt@opacity{}% \newif\ifpc@gopt@dvipdfmx\pc@gopt@dvipdfmxfalse% \newif\ifpc@gopt@final\pc@gopt@finalfalse% % @@ -51,6 +63,26 @@ \gdef\pc@lopt@icon{}% \gdef\pc@lopt@open{}% \gdef\pc@lopt@hspace{}% +\gdef\pc@lopt@voffset{}% +\gdef\pc@lopt@hoffset{}% +\gdef\pc@lopt@width{}% +\gdef\pc@lopt@height{}% +\gdef\pc@lopt@depth{}% +\gdef\pc@lopt@opacity{}% +% +% define global style option avatar for setting a predefined set of options (Avatar) +\define@key{pdfcomment.sty}{avatar}[]% +{% thanks to Ulrike Fischer Msg-Id: + \edef\pc@gopt@loadavatar{\noexpand\setkeys{pdfcomment.sty}{\csname pc@avatar@#1\endcsname}}% + \pc@gopt@loadavatar% +}% +% +% define global style option style for setting a predefined set of options (Style) +\define@key{pdfcomment.sty}{style}[]% +{% + \edef\pc@gopt@loadstyle{\noexpand\setkeys{pdfcomment.sty}{\csname pc@style@#1\endcsname}}% + \pc@gopt@loadstyle% +}% % % define global style option subject for setting the subject of pdf annotations \define@key{pdfcomment.sty}{subject}[\pc@goptd@subject]% @@ -88,6 +120,42 @@ \gdef\pc@gopt@hspace{#1}% }% % +% define global style option voffset for setting the vertical offset of the pdf annotations +\define@key{pdfcomment.sty}{voffset}[\pc@goptd@voffset]% +{% + \gdef\pc@gopt@voffset{#1}% +}% +% +% define global style option hoffset for setting the horizontal offset of the pdf annotations +\define@key{pdfcomment.sty}{hoffset}[\pc@goptd@hoffset]% +{% + \gdef\pc@gopt@hoffset{#1}% +}% +% +% define global style option width for setting the width of the pdf annotations +\define@key{pdfcomment.sty}{width}[\pc@goptd@width]% +{% + \gdef\pc@gopt@width{#1}% +}% +% +% define global style option height for setting the height of the pdf annotations +\define@key{pdfcomment.sty}{height}[\pc@goptd@height]% +{% + \gdef\pc@gopt@height{#1}% +}% +% +% define global style option depth for setting the depth of the pdf annotations +\define@key{pdfcomment.sty}{depth}[\pc@goptd@depth]% +{% + \gdef\pc@gopt@depth{#1}% +}% +% +% define global style option opacity for setting the opacity of the pdf annotations +\define@key{pdfcomment.sty}{opacity}[\pc@goptd@opacity]% +{% + \gdef\pc@gopt@opacity{#1}% +}% +% % define global style option dvipdfmx for setting the output driver in DVI mode \define@key{pdfcomment.sty}{dvipdfmx}[\pc@goptd@dvipdfmx]% {% @@ -106,6 +174,20 @@ \pc@gopt@finalfalse% }% % +% define local style option avatar for setting a predefined set of options (Avatar) +\define@key{pdfcomment}{avatar}[]% +{% + \edef\pc@lopt@loadavatar{\noexpand\setkeys{pdfcomment}{\csname pc@avatar@#1\endcsname}}% + \pc@lopt@loadavatar% +}% +% +% define local style option style for setting a predefined set of options (Style) +\define@key{pdfcomment}{style}[]% +{% + \edef\pc@lopt@loadstyle{\noexpand\setkeys{pdfcomment.sty}{\csname pc@style@#1\endcsname}}% + \pc@lopt@loadstyle% +}% +% % define local command option subject for setting the subject of pdf annotations \define@key{pdfcomment}{subject}[\pc@gopt@subject]% {% @@ -142,6 +224,56 @@ \gdef\pc@lopt@hspace{#1}% }% % +% define local style option voffset for setting the vertical offset of the pdf annotations +\define@key{pdfcomment}{voffset}[\pc@gopt@voffset]% +{% + \gdef\pc@lopt@voffset{#1}% +}% +% +% define local style option hoffset for setting the horizontal offset of the pdf annotations +\define@key{pdfcomment}{hoffset}[\pc@gopt@hoffset]% +{% + \gdef\pc@lopt@hoffset{#1}% +}% +% +% define local style option width for setting the width of the pdf annotations +\define@key{pdfcomment}{width}[\pc@gopt@width]% +{% + \gdef\pc@lopt@width{#1}% +}% +% +% define local style option height for setting the height of the pdf annotations +\define@key{pdfcomment}{height}[\pc@gopt@height]% +{% + \gdef\pc@lopt@height{#1}% +}% +% +% define local style option depth for setting the depth of the pdf annotations +\define@key{pdfcomment}{depth}[\pc@gopt@depth]% +{% + \gdef\pc@lopt@depth{#1}% +}% +% +% define local style option opacity for setting the opacity of the pdf annotations +\define@key{pdfcomment}{opacity}[\pc@gopt@opacity]% +{% + \gdef\pc@lopt@opacity{#1}% +}% +% +% define local style option avatar for setting a predefined set of options (Avatar) +\define@key{pdfmargincomment}{avatar}[]% +{% + \edef\pc@lopt@loadavatar{\noexpand\setkeys{pdfcomment}{\csname pc@avatar@#1\endcsname}}% + \pc@lopt@loadavatar% +}% +% +% define local style option style for setting a predefined set of options (Style) +\define@key{pdfmargincomment}{style}[]% +{% + \edef\pc@lopt@loadstyle{\noexpand\setkeys{pdfcomment.sty}{\csname pc@style@#1\endcsname}}% + \pc@lopt@loadstyle% +}% +% % define local command option subject for setting the subject of pdf annotations \define@key{pdfmargincomment}{subject}[\pc@gopt@subject]% {% @@ -178,7 +310,129 @@ \gdef\pc@lopt@hspace{#1}% }% % -\ExecuteOptionsX{subject,color,author,icon,open,hspace}% +% define local style option voffset for setting the vertical offset of the pdf annotations +\define@key{pdfmargincomment}{voffset}[\pc@gopt@voffset]% +{% + \gdef\pc@lopt@voffset{#1}% +}% +% +% define local style option hoffset for setting the horizontal offset of the pdf annotations +\define@key{pdfmargincomment}{hoffset}[\pc@gopt@hoffset]% +{% + \gdef\pc@lopt@hoffset{#1}% +}% +% +% define local style option width for setting the width of the pdf annotations +\define@key{pdfmargincomment}{width}[\pc@gopt@width]% +{% + \gdef\pc@lopt@width{#1}% +}% +% +% define local style option height for setting the height of the pdf annotations +\define@key{pdfmargincomment}{height}[\pc@gopt@height]% +{% + \gdef\pc@lopt@height{#1}% +}% +% +% define local style option depth for setting the depth of the pdf annotations +\define@key{pdfmargincomment}{depth}[\pc@gopt@depth]% +{% + \gdef\pc@lopt@depth{#1}% +}% +% +% define local style option opacity for setting the opacity of the pdf annotations +\define@key{pdfmargincomment}{opacity}[\pc@gopt@opacity]% +{% + \gdef\pc@lopt@opacity{#1}% +}% +% +% define local style option avatar for setting a predefined set of options (Avatar) +\define@key{pdffreetextcomment}{avatar}[]% +{% + \edef\pc@lopt@loadavatar{\noexpand\setkeys{pdfcomment}{\csname pc@avatar@#1\endcsname}}% + \pc@lopt@loadavatar% +}% +% +% define local style option style for setting a predefined set of options (Style) +\define@key{pdffreetextcomment}{style}[]% +{% + \edef\pc@lopt@loadstyle{\noexpand\setkeys{pdfcomment.sty}{\csname pc@style@#1\endcsname}}% + \pc@lopt@loadstyle% +}% +% +% define local command option subject for setting the subject of pdf annotations +\define@key{pdffreetextcomment}{subject}[\pc@gopt@subject]% +{% + \gdef\pc@lopt@subject{#1}% +}% +% +% define local command option color for setting the color of pdf annotations +\define@key{pdffreetextcomment}{color}[\pc@gopt@color]% +{% + \gdef\pc@lopt@color{#1}% +}% +% +% define local command option author for setting the author of pdf annotations +\define@key{pdffreetextcomment}{author}[\pc@gopt@author]% +{% + \gdef\pc@lopt@author{#1}% +}% +% +% define local command option icon for setting the icon of pdf annotations +\define@key{pdffreetextcomment}{icon}[\pc@gopt@icon]% +{% + \gdef\pc@lopt@icon{#1}% +}% +% +% define local command option open for setting the open status (true,false) of pdf annotations +\define@key{pdffreetextcomment}{open}[\pc@gopt@open]% +{% + \gdef\pc@lopt@open{#1}% +}% +% +% define local command option hspace for setting the space after the pdf annotations +\define@key{pdffreetextcomment}{hspace}[\pc@gopt@hspace]% +{% + \gdef\pc@lopt@hspace{#1}% +}% +% +% define local style option voffset for setting the vertical offset of the pdf annotations +\define@key{pdffreetextcomment}{voffset}[\pc@gopt@voffset]% +{% + \gdef\pc@lopt@voffset{#1}% +}% +% +% define local style option hoffset for setting the horizontal offset of the pdf annotations +\define@key{pdffreetextcomment}{hoffset}[\pc@gopt@hoffset]% +{% + \gdef\pc@lopt@hoffset{#1}% +}% +% +% define local style option width for setting the width of the pdf annotations +\define@key{pdffreetextcomment}{width}[\pc@gopt@width]% +{% + \gdef\pc@lopt@width{#1}% +}% +% +% define local style option height for setting the height of the pdf annotations +\define@key{pdffreetextcomment}{height}[\pc@gopt@height]% +{% + \gdef\pc@lopt@height{#1}% +}% +% +% define local style option depth for setting the depth of the pdf annotations +\define@key{pdffreetextcomment}{depth}[\pc@gopt@depth]% +{% + \gdef\pc@lopt@depth{#1}% +}% +% +% define local style option opacity for setting the opacity of the pdf annotations +\define@key{pdffreetextcomment}{opacity}[\pc@gopt@opacity]% +{% + \gdef\pc@lopt@opacity{#1}% +}% +% +\ExecuteOptionsX{subject,color,author,icon,open,hspace,voffset,hoffset,width,height,depth,opacity}% % \ProcessOptionsX\relax% % @@ -191,17 +445,17 @@ \expandafter\ifx\csname XeTeXrevision\endcsname\relax% \ifpc@gopt@dvipdfmx% \@ifpackageloaded{hyperref}% - {% + {% \hypersetup{dvipdfmx}% }% - {% + {% \PassOptionsToPackage{dvipdfmx}{hyperref}% }% \fi% \else% \global\pc@gopt@dvipdfmxtrue% \@ifpackageloaded{hyperref}{}% - {% + {% \PassOptionsToPackage{xetex}{hyperref}% }% \fi% @@ -220,7 +474,7 @@ \disable@keys{pdfcomment.sty}{final}% \disable@keys{pdfcomment.sty}{dvipdfmx}% }% -\newcommand{\pdfcomment}[2][subject={\pc@gopt@subject},color={\pc@gopt@color},author={\pc@gopt@author},icon={\pc@gopt@icon},open={\pc@gopt@open},hspace={\pc@gopt@hspace}]% +\newcommand{\pdfcomment}[2][subject={\pc@gopt@subject},color={\pc@gopt@color},author={\pc@gopt@author},icon={\pc@gopt@icon},open={\pc@gopt@open},hspace={\pc@gopt@hspace},voffset={\pc@gopt@voffset},hoffset={\pc@gopt@hoffset},width={\pc@gopt@width},height={\pc@gopt@height},depth={\pc@gopt@depth},opacity={\pc@gopt@opacity}]% {% % Copy all global options to local options \gdef\pc@lopt@subject{\pc@gopt@subject}% @@ -229,6 +483,12 @@ \gdef\pc@lopt@icon{\pc@gopt@icon}% \gdef\pc@lopt@open{\pc@gopt@open}% \gdef\pc@lopt@hspace{\pc@gopt@hspace}% + \gdef\pc@lopt@voffset{\pc@gopt@voffset}% + \gdef\pc@lopt@hoffset{\pc@gopt@hoffset}% + \gdef\pc@lopt@width{\pc@gopt@width}% + \gdef\pc@lopt@height{\pc@gopt@height}% + \gdef\pc@lopt@depth{\pc@gopt@depth}% + \gdef\pc@lopt@opacity{\pc@gopt@opacity}% % Change local options if specified \setkeys{pdfcomment}{#1}% % Encode Contents, Author and Subject to pdf encodings (PD or PU) with hyperref's \pdfstringdef @@ -243,42 +503,88 @@ \ifpc@gopt@final\else% % typeset text annotation (see: PDF Reference) \ifpdf% - \pdfannot width 0pt height \baselineskip depth 0pt% + \vbox to 0pt% {% - /Subtype /Text% - /C [\pc@hyenc@color]% - /T (\pc@pdfenc@author)% - /Subj (\pc@pdfenc@subject)% - /Name /\pc@lopt@icon% - /Contents (\pc@pdfenc@contents)% - /Open \pc@lopt@open% - } + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \pdfannot width 0pt height \baselineskip depth 0pt% + {% + /Subtype /Text% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Name /\pc@lopt@icon% + /Contents (\pc@pdfenc@contents)% + /Open \pc@lopt@open% + /F 4% + }% + \hss% + }% + \vss% + }% \else% \ifpc@gopt@dvipdfmx% - \special{pdf: ann width 0pt height \the\baselineskip% - <<% - /Subtype /Text% - /C [\pc@hyenc@color]% - /T (\pc@pdfenc@author)% - /Subj (\pc@pdfenc@subject)% - /Name /\pc@lopt@icon% - /Contents (\pc@pdfenc@contents)% - /Open \pc@lopt@open% - >>% - }% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \special{pdf: ann width 0pt\space height \the\baselineskip\space depth 0pt% + <<% + /Subtype /Text% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Name /\pc@lopt@icon% + /Contents (\pc@pdfenc@contents)% + /Open \pc@lopt@open% + /F 4% + >>% + }% + \hss% + }% + \vss% + }% \else% - \pdfmark[\rule{0pt}{\baselineskip}]% - {% - pdfmark=/ANN,% - Subtype=/Text,% - Raw={% - /C [\pc@hyenc@color]% - /T (\pc@pdfenc@author)% - /Subj (\pc@pdfenc@subject)% - /Name /\pc@lopt@icon% - /Contents (\pc@pdfenc@contents)% - /Open \pc@lopt@open% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \vskip-\baselineskip% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \pdfmark[\rule{0pt}{\pc@lopt@height}]% + {% + pdfmark=/ANN,% + Subtype=/Text,% + Raw={% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Name /\pc@lopt@icon% + /Contents (\pc@pdfenc@contents)% + /Open \pc@lopt@open% + /F 4% + }% + }% + \hss% }% + \vss% }% \fi% \fi% @@ -286,7 +592,7 @@ \fi% }% % -\newcommand{\pdfmargincomment}[2][subject={\pc@gopt@subject},color={\pc@gopt@color},author={\pc@gopt@author},icon={\pc@gopt@icon},open={\pc@gopt@open},hspace={\pc@gopt@hspace}]% +\newcommand{\pdfmargincomment}[2][subject={\pc@gopt@subject},color={\pc@gopt@color},author={\pc@gopt@author},icon={\pc@gopt@icon},open={\pc@gopt@open},hspace={\pc@gopt@hspace},voffset={\pc@gopt@voffset},hoffset={\pc@gopt@hoffset},width={\pc@gopt@width},height={\pc@gopt@height},depth={\pc@gopt@depth},opacity={\pc@gopt@opacity}]% {% % Copy all global options to local options \gdef\pc@lopt@subject{\pc@gopt@subject}% @@ -295,6 +601,12 @@ \gdef\pc@lopt@icon{\pc@gopt@icon}% \gdef\pc@lopt@open{\pc@gopt@open}% \gdef\pc@lopt@hspace{\pc@gopt@hspace}% + \gdef\pc@lopt@voffset{\pc@gopt@voffset}% + \gdef\pc@lopt@hoffset{\pc@gopt@hoffset}% + \gdef\pc@lopt@width{\pc@gopt@width}% + \gdef\pc@lopt@height{\pc@gopt@height}% + \gdef\pc@lopt@depth{\pc@gopt@depth}% + \gdef\pc@lopt@opacity{\pc@gopt@opacity}% % Change local options if specified \setkeys{pdfmargincomment}{#1}% % Encode Contents, Author and Subject to pdf encodings (PD or PU) with hyperref's \pdfstringdef @@ -315,42 +627,88 @@ \marginnote% {% \ifpdf% - \pdfannot width 0pt height \baselineskip depth 0pt% + \vbox to 0pt% {% - /Subtype /Text% - /C [\pc@hyenc@color]% - /T (\pc@pdfenc@author)% - /Subj (\pc@pdfenc@subject)% - /Name /\pc@lopt@icon% - /Contents (\pc@pdfenc@contents)% - /Open \pc@lopt@open% - } - \else% - \ifpc@gopt@dvipdfmx% - \special{pdf: ann width 0pt height \the\baselineskip% - <<% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \pdfannot width 0pt height \baselineskip depth 0pt% + {% /Subtype /Text% /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% /T (\pc@pdfenc@author)% /Subj (\pc@pdfenc@subject)% /Name /\pc@lopt@icon% /Contents (\pc@pdfenc@contents)% /Open \pc@lopt@open% - >>% - }% + /F 4% + } + \hss% + }% + \vss% + }% + \else% + \ifpc@gopt@dvipdfmx% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \special{pdf: ann width 0pt\space height \the\baselineskip\space depth 0pt% + <<% + /Subtype /Text% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Name /\pc@lopt@icon% + /Contents (\pc@pdfenc@contents)% + /Open \pc@lopt@open% + /F 4% + >>% + }% + \hss% + }% + \vss% + }% \else% - \pdfmark[\rule{0pt}{\baselineskip}] - {% - pdfmark=/ANN,% - Subtype=/Text,% - Raw={% - /C [\pc@hyenc@color]% - /T (\pc@pdfenc@author)% - /Subj (\pc@pdfenc@subject)% - /Name /\pc@lopt@icon% - /Contents (\pc@pdfenc@contents)% - /Open \pc@lopt@open% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \vskip-\baselineskip% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \pdfmark[\rule{0pt}{\pc@lopt@height}]% + {% + pdfmark=/ANN,% + Subtype=/Text,% + Raw={% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Name /\pc@lopt@icon% + /Contents (\pc@pdfenc@contents)% + /Open \pc@lopt@open% + /F 4% + }% + }% + \hss% }% + \vss% }% \fi% \fi% @@ -360,12 +718,152 @@ \fi }% % +\newcommand{\pdffreetextcomment}[2][subject={\pc@gopt@subject},color={\pc@gopt@color},author={\pc@gopt@author},icon={\pc@gopt@icon},open={\pc@gopt@open},hspace={\pc@gopt@hspace},voffset={\pc@gopt@voffset},hoffset={\pc@gopt@hoffset},width={\pc@gopt@width},height={\pc@gopt@height},depth={\pc@gopt@depth},opacity={\pc@gopt@opacity}]% +{% + % Copy all global options to local options + \gdef\pc@lopt@subject{\pc@gopt@subject}% + \gdef\pc@lopt@color{\pc@gopt@color}% + \gdef\pc@lopt@author{\pc@gopt@author}% + \gdef\pc@lopt@icon{\pc@gopt@icon}% + \gdef\pc@lopt@open{\pc@gopt@open}% + \gdef\pc@lopt@hspace{\pc@gopt@hspace}% + \gdef\pc@lopt@voffset{\pc@gopt@voffset}% + \gdef\pc@lopt@hoffset{\pc@gopt@hoffset}% + \gdef\pc@lopt@width{\pc@gopt@width}% + \gdef\pc@lopt@height{\pc@gopt@height}% + \gdef\pc@lopt@depth{\pc@gopt@depth}% + \gdef\pc@lopt@opacity{\pc@gopt@opacity}% + % Change local options if specified + \setkeys{pdffreetextcomment}{#1}% + % Encode Contents, Author and Subject to pdf encodings (PD or PU) with hyperref's \pdfstringdef + \def\pc@pdfenc@contents{}% + \pdfstringdef\pc@pdfenc@contents{#2}% + \def\pc@pdfenc@author{}% + \pdfstringdef\pc@pdfenc@author{\pc@lopt@author}% + \def\pc@pdfenc@subject{}% + \pdfstringdef\pc@pdfenc@subject{\pc@lopt@subject}% + % transform color input to pdf color + \HyColor@XZeroOneThreeFour{\pc@lopt@color}{\pc@hyenc@color}{pdfcomment}{color}% + %define options for \pdfannot + \def\pc@pdfannotopt{}% + \ifx\pc@lopt@width\@empty% + \else% + \expandafter\def\expandafter\pc@pdfannotopt\expandafter{\pc@pdfannotopt width \pc@lopt@width\space}% + \fi% + \ifx\pc@lopt@height\@empty% + \else% + \expandafter\def\expandafter\pc@pdfannotopt\expandafter{\pc@pdfannotopt height \pc@lopt@height\space}% + \fi% + \ifx\pc@lopt@depth\@empty% + \else% + \expandafter\def\expandafter\pc@pdfannotopt\expandafter{\pc@pdfannotopt depth \pc@lopt@depth\space}% + \fi% + \ifpc@gopt@final\else% + % typeset text annotation (see: PDF Reference) + \ifpdf% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \expandafter\pdfannot \pc@pdfannotopt% + {% + /Subtype /FreeText% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Contents (\pc@pdfenc@contents)% + /F 4% + }% + \hss% + }% + \vss% + }% + \else% + \ifpc@gopt@dvipdfmx% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \special{pdf: ann \pc@pdfannotopt% + <<% + /Subtype /FreeText% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Contents (\pc@pdfenc@contents)% + /F 4% + >>% + }% + \hss% + }% + \vss% + }% + \else% + \vbox to 0pt% + {% + \hsize=0pt% + \noindent% + \vskip-\pc@lopt@voffset% + % add extra \vskip box height because of different reference point + \vskip-\pc@lopt@height% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + %create dimensions of annoation + \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]% + {% + pdfmark=/ANN,% + Subtype=/FreeText,% + Raw={% + /C [\pc@hyenc@color]% + /CA \pc@lopt@opacity% + /T (\pc@pdfenc@author)% + /Subj (\pc@pdfenc@subject)% + /Contents (\pc@pdfenc@contents)% + /F 4% + }% + }% + \hss% + }% + \vss% + }% + \fi% + \fi% + \hspace{\pc@lopt@hspace}% + \fi% +}% +% +% reset global options \newcommand{\pdfcommentsetup}[1]% {% % Change global options if specified \setkeys{pdfcomment.sty}{#1}% }% % +% define predefined set of options (Avatar) +\newcommand{\defineavatar}[2]% +{% + \expandafter\gdef\csname pc@avatar@#1\endcsname{#2}% +}% +% +% define predefined set of options (Style) +\newcommand{\definestyle}[2]% +{% + \expandafter\gdef\csname pc@style@#1\endcsname{#2}% +}% % % -\endinput% +\endinput% \ No newline at end of file -- cgit v1.2.3