From 58348ea17b62f4a62100c2ff09825a2c4ade46fb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 13 Dec 2010 23:45:28 +0000 Subject: pdfcomment (13dec10) git-svn-id: svn://tug.org/texlive/trunk@20724 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/pdfcomment/pdfcomment.sty | 493 +++++++++++++++++++-- 1 file changed, 464 insertions(+), 29 deletions(-) (limited to 'Master/texmf-dist/tex/latex/pdfcomment') diff --git a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty index 73fadc2184d..160ee501ce8 100644 --- a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty +++ b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty @@ -20,7 +20,7 @@ %% This work consists of all files listed in manifest.txt. %% % -\ProvidesPackage{pdfcomment}[2010/11/08 pdfcomment.sty v2.0 - Josef Kleber (C) 2008-2010]% +\ProvidesPackage{pdfcomment}[2010/12/11 pdfcomment.sty v2.1 - Josef Kleber (C) 2008-2010]% % \RequirePackage{xkeyval}% % @@ -58,6 +58,9 @@ \gdef\pc@goptd@captionvoffset{0pt}% \gdef\pc@goptd@linesep{0.5cm}% \gdef\pc@goptd@disable{false}% +\gdef\pc@goptd@id{}% +\gdef\pc@goptd@date{}% +\gdef\pc@goptd@timezone{+00'00'}% \gdef\pc@goptd@dvipdfmx{true}% % % values for global package options @@ -94,6 +97,9 @@ \gdef\pc@gopt@captionvoffset{}% \gdef\pc@gopt@linesep{}% \gdef\pc@gopt@disable{}% +\gdef\pc@gopt@id{}% +\gdef\pc@gopt@date{}% +\gdef\pc@gopt@timezone{}% % % values for local command options \gdef\pc@lopt@subject{}% @@ -130,9 +136,14 @@ \gdef\pc@lopt@linesep{}% \gdef\pc@lopt@mathstyle{}% \gdef\pc@lopt@disable{}% +\gdef\pc@lopt@id{}% +\gdef\pc@lopt@date{}% +\gdef\pc@lopt@replyto{}% +\gdef\pc@lopt@timezone{}% % \gdef\pc@lopt@c{}% \gdef\pc@lopt@ic{}% +\gdef\pc@lopt@cdate{}% \gdef\pc@lopt@l{}% \gdef\pc@lopt@le{}% \gdef\pc@lopt@cap{}% @@ -145,6 +156,7 @@ \newif\ifpc@opt@unskip\pc@opt@unskiptrue% \newif\ifpc@annot@samepage\pc@annot@samepagetrue% \newif\ifpc@annot@secondpage\pc@annot@secondpagefalse% +\newif\ifpc@afterpage\pc@afterpagefalse% % \newcounter{pc@annot@lines}% % @@ -155,6 +167,10 @@ \newlength{\pc@dimc}% \newlength{\pc@dimd}% \newlength{\pc@dime}% +\newlength{\pc@dimf}% +\newlength{\pc@dimg}% +\newlength{\pc@dimh}% +\newlength{\pc@dimi}% % \newlength{\pc@Sposx}% \newlength{\pc@Sposy}% @@ -195,6 +211,7 @@ \newcommand{\pc@y@bottom@text}{}% % \gdef\pc@version{}% +\gdef\pc@collect@PDFOBJID{}% % \newcommand{\pc@raggedleftmarginnote}{\centering}% \newcommand{\pc@raggedrightmarginnote}{\centering}% @@ -242,6 +259,7 @@ \pc@define@key@avatar{pdfcirclecomment}% \pc@define@key@avatar{pdflinecomment}% \pc@define@key@avatar{pdfsidelinecomment}% +\pc@define@key@avatar{pdfreply}% % \define@key{pdfcomment.sty}{style}[]% {% @@ -282,6 +300,7 @@ \pc@define@key@style{pdfcirclecomment}% \pc@define@key@style{pdflinecomment}% \pc@define@key@style{pdfsidelinecomment}% +\pc@define@key@style{pdfreply}% % \define@key{pdfcomment.sty}{subject}[\pc@goptd@subject]% {% @@ -304,6 +323,7 @@ \pc@define@key@subject{pdfcirclecomment}% \pc@define@key@subject{pdflinecomment}% \pc@define@key@subject{pdfsidelinecomment}% +\pc@define@key@subject{pdfreply}% % \define@key{pdfcomment.sty}{color}[\pc@goptd@color]% {% @@ -326,6 +346,7 @@ \pc@define@key@color{pdfcirclecomment}% \pc@define@key@color{pdflinecomment}% \pc@define@key@color{pdfsidelinecomment}% +\pc@define@key@color{pdfreply}% % \define@key{pdfcomment.sty}{author}[\pc@goptd@author]% {% @@ -348,6 +369,7 @@ \pc@define@key@author{pdfcirclecomment}% \pc@define@key@author{pdflinecomment}% \pc@define@key@author{pdfsidelinecomment}% +\pc@define@key@author{pdfreply}% % \define@key{pdfcomment.sty}{deadline}[\pc@goptd@deadline]% {% @@ -370,6 +392,7 @@ \pc@define@key@deadline{pdfcirclecomment}% \pc@define@key@deadline{pdflinecomment}% \pc@define@key@deadline{pdfsidelinecomment}% +\pc@define@key@deadline{pdfreply}% % \define@key{pdfcomment.sty}{icon}[\pc@goptd@icon]% {% @@ -392,6 +415,7 @@ \pc@define@key@icon{pdfcirclecomment}% \pc@define@key@icon{pdflinecomment}% \pc@define@key@icon{pdfsidelinecomment}% +\pc@define@key@icon{pdfreply}% % \define@choicekey*{pdfcomment.sty}{open}[\pc@gopt@open\nr]{true,false}[false]% {% @@ -422,6 +446,7 @@ \pc@define@key@open{pdfcirclecomment}% \pc@define@key@open{pdflinecomment}% \pc@define@key@open{pdfsidelinecomment}% +\pc@define@key@open{pdfreply}% % \define@key{pdfcomment.sty}{hspace}[\pc@goptd@hspace]% {% @@ -444,6 +469,7 @@ \pc@define@key@hspace{pdfcirclecomment}% \pc@define@key@hspace{pdflinecomment}% \pc@define@key@hspace{pdfsidelinecomment}% +\pc@define@key@hspace{pdfreply}% % \define@key{pdfcomment.sty}{voffset}[\pc@goptd@voffset]% {% @@ -466,6 +492,7 @@ \pc@define@key@voffset{pdfcirclecomment}% \pc@define@key@voffset{pdflinecomment}% \pc@define@key@voffset{pdfsidelinecomment}% +\pc@define@key@voffset{pdfreply}% % \define@key{pdfcomment.sty}{hoffset}[\pc@goptd@hoffset]% {% @@ -488,6 +515,7 @@ \pc@define@key@hoffset{pdfcirclecomment}% \pc@define@key@hoffset{pdflinecomment}% \pc@define@key@hoffset{pdfsidelinecomment}% +\pc@define@key@hoffset{pdfreply}% % \define@key{pdfcomment.sty}{width}[\pc@goptd@width]% {% @@ -510,6 +538,7 @@ \pc@define@key@width{pdfcirclecomment}% \pc@define@key@width{pdflinecomment}% \pc@define@key@width{pdfsidelinecomment}% +\pc@define@key@width{pdfreply}% % \define@key{pdfcomment.sty}{height}[\pc@goptd@height]% {% @@ -532,6 +561,7 @@ \pc@define@key@height{pdfcirclecomment}% \pc@define@key@height{pdflinecomment}% \pc@define@key@height{pdfsidelinecomment}% +\pc@define@key@height{pdfreply}% % \define@key{pdfcomment.sty}{depth}[\pc@goptd@depth]% {% @@ -554,6 +584,7 @@ \pc@define@key@depth{pdfcirclecomment}% \pc@define@key@depth{pdflinecomment}% \pc@define@key@depth{pdfsidelinecomment}% +\pc@define@key@depth{pdfreply}% % \define@key{pdfcomment.sty}{opacity}[\pc@goptd@opacity]% {% @@ -576,6 +607,7 @@ \pc@define@key@opacity{pdfcirclecomment}% \pc@define@key@opacity{pdflinecomment}% \pc@define@key@opacity{pdfsidelinecomment}% +\pc@define@key@opacity{pdfreply}% % \define@key{pdfcomment.sty}{markup}[\pc@goptd@markup]% {% @@ -598,6 +630,7 @@ \pc@define@key@markup{pdfcirclecomment}% \pc@define@key@markup{pdflinecomment}% \pc@define@key@markup{pdfsidelinecomment}% +\pc@define@key@markup{pdfreply}% % \define@key{pdfcomment.sty}{font}[\pc@goptd@font]% {% @@ -620,6 +653,7 @@ \pc@define@key@font{pdfcirclecomment}% \pc@define@key@font{pdflinecomment}% \pc@define@key@font{pdfsidelinecomment}% +\pc@define@key@font{pdfreply}% % \define@key{pdfcomment.sty}{fontsize}[\pc@goptd@fontsize]% {% @@ -642,6 +676,7 @@ \pc@define@key@fontsize{pdfcirclecomment}% \pc@define@key@fontsize{pdflinecomment}% \pc@define@key@fontsize{pdfsidelinecomment}% +\pc@define@key@fontsize{pdfreply}% % \define@key{pdfcomment.sty}{fontcolor}[\pc@goptd@fontcolor]% {% @@ -664,6 +699,7 @@ \pc@define@key@fontcolor{pdfcirclecomment}% \pc@define@key@fontcolor{pdflinecomment}% \pc@define@key@fontcolor{pdfsidelinecomment}% +\pc@define@key@fontcolor{pdfreply}% % \define@choicekey*{pdfcomment.sty}{justification}[\pc@gopt@justification\nr]{left,center,right}[left]% {% @@ -698,6 +734,7 @@ \pc@define@key@justification{pdfcirclecomment}% \pc@define@key@justification{pdflinecomment}% \pc@define@key@justification{pdfsidelinecomment}% +\pc@define@key@justification{pdfreply}% % \define@choicekey*{pdfcomment.sty}{borderstyle}[\pc@gopt@borderstyle\nr]{solid,dashed}[solid]% {% @@ -728,6 +765,7 @@ \pc@define@key@borderstyle{pdfcirclecomment}% \pc@define@key@borderstyle{pdflinecomment}% \pc@define@key@borderstyle{pdfsidelinecomment}% +\pc@define@key@borderstyle{pdfreply}% % \define@key{pdfcomment.sty}{dashstyle}[\pc@goptd@dashstyle]% {% @@ -750,6 +788,7 @@ \pc@define@key@dashstyle{pdfcirclecomment}% \pc@define@key@dashstyle{pdflinecomment}% \pc@define@key@dashstyle{pdfsidelinecomment}% +\pc@define@key@dashstyle{pdfreply}% % \define@key{pdfcomment.sty}{linewidth}[\pc@goptd@linewidth]% {% @@ -772,6 +811,7 @@ \pc@define@key@linewidth{pdfcirclecomment}% \pc@define@key@linewidth{pdflinecomment}% \pc@define@key@linewidth{pdfsidelinecomment}% +\pc@define@key@linewidth{pdfreply}% % \define@choicekey*{pdfcomment.sty}{bse}[\pc@gopt@bse\nr]{none,cloudy}[none]% {% @@ -802,6 +842,7 @@ \pc@define@key@bse{pdfcirclecomment}% \pc@define@key@bse{pdflinecomment}% \pc@define@key@bse{pdfsidelinecomment}% +\pc@define@key@bse{pdfreply}% % \define@key{pdfcomment.sty}{bsei}[\pc@goptd@bsei]% {% @@ -824,6 +865,7 @@ \pc@define@key@bsei{pdfcirclecomment}% \pc@define@key@bsei{pdflinecomment}% \pc@define@key@bsei{pdfsidelinecomment}% +\pc@define@key@bsei{pdfreply}% % \define@choicekey*{pdfcomment.sty}{type}[\pc@gopt@type\nr]{freetext,callout,typewriter,line,polyline,polygon}[freetext]% {% @@ -870,6 +912,7 @@ \pc@define@key@type{pdfcirclecomment}% \pc@define@key@type{pdflinecomment}% \pc@define@key@type{pdfsidelinecomment}% +\pc@define@key@type{pdfreply}% % \define@key{pdfcomment.sty}{lineend}[\pc@goptd@lineend]% {% @@ -892,6 +935,7 @@ \pc@define@key@lineend{pdfcirclecomment}% \pc@define@key@lineend{pdflinecomment}% \pc@define@key@lineend{pdfsidelinecomment}% +\pc@define@key@lineend{pdfreply}% % \define@key{pdfcomment.sty}{linebegin}[\pc@goptd@linebegin]% {% @@ -914,6 +958,7 @@ \pc@define@key@linebegin{pdfcirclecomment}% \pc@define@key@linebegin{pdflinecomment}% \pc@define@key@linebegin{pdfsidelinecomment}% +\pc@define@key@linebegin{pdfreply}% % \define@key{pdfcomment.sty}{icolor}[\pc@goptd@icolor]% {% @@ -936,6 +981,7 @@ \pc@define@key@icolor{pdfcirclecomment}% \pc@define@key@icolor{pdflinecomment}% \pc@define@key@icolor{pdfsidelinecomment}% +\pc@define@key@icolor{pdfreply}% % \define@choicekey*{pdfcomment.sty}{caption}[\pc@gopt@caption\nr]{none,inline,top}[inline]% {% @@ -970,6 +1016,7 @@ \pc@define@key@caption{pdfcirclecomment}% \pc@define@key@caption{pdflinecomment}% \pc@define@key@caption{pdfsidelinecomment}% +\pc@define@key@caption{pdfreply}% % \define@key{pdfcomment.sty}{line}[\pc@goptd@line]% {% @@ -992,6 +1039,7 @@ \pc@define@key@line{pdfcirclecomment}% \pc@define@key@line{pdflinecomment}% \pc@define@key@line{pdfsidelinecomment}% +\pc@define@key@line{pdfreply}% % \define@key{pdfcomment.sty}{captionhoffset}[\pc@goptd@captionhoffset]% {% @@ -1014,6 +1062,7 @@ \pc@define@key@captionhoffset{pdfcirclecomment}% \pc@define@key@captionhoffset{pdflinecomment}% \pc@define@key@captionhoffset{pdfsidelinecomment}% +\pc@define@key@captionhoffset{pdfreply}% % \define@key{pdfcomment.sty}{captionvoffset}[\pc@goptd@captionvoffset]% {% @@ -1036,6 +1085,7 @@ \pc@define@key@captionvoffset{pdfcirclecomment}% \pc@define@key@captionvoffset{pdflinecomment}% \pc@define@key@captionvoffset{pdfsidelinecomment}% +\pc@define@key@captionvoffset{pdfreply}% % \define@key{pdfcomment.sty}{linesep}[\pc@goptd@linesep]% {% @@ -1058,6 +1108,7 @@ \pc@define@key@linesep{pdfcirclecomment}% \pc@define@key@linesep{pdflinecomment}% \pc@define@key@linesep{pdfsidelinecomment}% +\pc@define@key@linesep{pdfreply}% % \newcommand\pc@define@key@disable[1]% {% @@ -1079,6 +1130,71 @@ \pc@define@key@disable{pdfcirclecomment}% \pc@define@key@disable{pdflinecomment}% \pc@define@key@disable{pdfsidelinecomment}% +\pc@define@key@disable{pdfreply}% +% +\newcommand\pc@define@key@id[1]% +{% + \define@key{#1}{id}[]% + {% + \gdef\pc@lopt@id{##1}% + }% +}% +% +\pc@define@key@id{pdfcomment}% +\pc@define@key@id{pdfmargincomment}% +\pc@define@key@id{pdffreetextcomment}% +\pc@define@key@id{pdfmarkupcomment}% +\pc@define@key@id{pdfsquarecomment}% +\pc@define@key@id{pdfcirclecomment}% +\pc@define@key@id{pdflinecomment}% +\pc@define@key@id{pdfsidelinecomment}% +\pc@define@key@id{pdfreply}% +% +\define@key{pdfcomment.sty}{date}[\pc@goptd@date]% +{% + \gdef\pc@gopt@date{#1}% +}% +% +\newcommand\pc@define@key@date[1]% +{% + \define@key{#1}{date}[\pc@gopt@date]% + {% + \gdef\pc@lopt@date{##1}% + }% +}% +% +\pc@define@key@date{pdfcomment}% +\pc@define@key@date{pdfmargincomment}% +\pc@define@key@date{pdffreetextcomment}% +\pc@define@key@date{pdfmarkupcomment}% +\pc@define@key@date{pdfsquarecomment}% +\pc@define@key@date{pdfcirclecomment}% +\pc@define@key@date{pdflinecomment}% +\pc@define@key@date{pdfsidelinecomment}% +\pc@define@key@date{pdfreply}% +% +\define@key{pdfcomment.sty}{timezone}[\pc@goptd@timezone]% +{% + \gdef\pc@gopt@timezone{#1}% +}% +% +\newcommand\pc@define@key@timezone[1]% +{% + \define@key{#1}{timezone}[\pc@gopt@timezone]% + {% + \gdef\pc@lopt@timezone{##1}% + }% +}% +% +\pc@define@key@timezone{pdfcomment}% +\pc@define@key@timezone{pdfmargincomment}% +\pc@define@key@timezone{pdffreetextcomment}% +\pc@define@key@timezone{pdfmarkupcomment}% +\pc@define@key@timezone{pdfsquarecomment}% +\pc@define@key@timezone{pdfcirclecomment}% +\pc@define@key@timezone{pdflinecomment}% +\pc@define@key@timezone{pdfsidelinecomment}% +\pc@define@key@timezone{pdfreply}% % \define@key{pdfcomment.sty}{dvipdfmx}[\pc@goptd@dvipdfmx]% {% @@ -1109,6 +1225,11 @@ \gdef\pc@lopt@mathstyle{#1}% }% % +\define@key{pdfreply}{replyto}% +{% + \gdef\pc@lopt@replyto{#1}% +}% +% \define@key{listofpdfcomments}{liststyle}[AuthorSubject]% {% \gdef\pc@lopt@liststyle{#1}% @@ -1119,7 +1240,7 @@ \renewcommand{\lpcname}{#1}% }% % -\ExecuteOptionsX{subject,color,author,deadline,icon,open,hspace,voffset,hoffset,width,height,depth,opacity,markup,font,fontsize,fontcolor,justification,borderstyle,linewidth,dashstyle,bse,bsei,type,lineend,linebegin,icolor,line,caption,captionhoffset,captionvoffset,linesep,version}% +\ExecuteOptionsX{subject,color,author,deadline,icon,open,hspace,voffset,hoffset,width,height,depth,opacity,markup,font,fontsize,fontcolor,justification,borderstyle,linewidth,dashstyle,bse,bsei,type,lineend,linebegin,icolor,line,caption,captionhoffset,captionvoffset,linesep,version,date,timezone}% % \ProcessOptionsX\relax% % @@ -1129,6 +1250,7 @@ \RequirePackage{calc}% \RequirePackage{marginnote}% \RequirePackage{ifpdf}% +\RequirePackage{datetime}% % %hyperref setup \ifpdf% @@ -1202,6 +1324,13 @@ {% \gdef\pc@lopt@c{/C [\pc@hyenc@color]}% }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% \ifpc@gopt@final\else% \ifpc@lopt@disable\else% \hspace*{0pt}% @@ -1222,6 +1351,12 @@ /Subtype /Text% \pc@annot@text% }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}% + \pc@save@PDFOBJID{\pc@lopt@id}% + }% \hss% }% }% @@ -1289,6 +1424,13 @@ {% \gdef\pc@lopt@c{/C [\pc@hyenc@color]}% }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% \ifpc@gopt@final\else% \ifpc@lopt@disable\else% \hspace*{0pt}% @@ -1315,6 +1457,12 @@ /Subtype /Text% \pc@annot@text% } + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}% + \pc@save@PDFOBJID{\pc@lopt@id}% + }% \hss% }% }% @@ -1390,6 +1538,13 @@ \gdef\pc@lopt@c{}% }% {}% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% %create options for \pdfannot \pc@create@pdfannotopt% \ifpc@gopt@final\else% @@ -1412,6 +1567,12 @@ /Subtype /FreeText% \pc@annot@freetext% }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}% + \pc@save@PDFOBJID{\pc@lopt@id}% + }% \hss% }% \vss% @@ -1492,6 +1653,13 @@ {% \gdef\pc@lopt@ic{/IC [\pc@hyenc@icolor]}% }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% %create options for \pdfannot \pc@create@pdfannotopt% \ifpc@gopt@final\else% @@ -1514,6 +1682,12 @@ /Subtype /Square\space% \pc@annot@square% }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}% + \pc@save@PDFOBJID{\pc@lopt@id}% + }% \hss% }% \vss% @@ -1594,6 +1768,13 @@ {% \gdef\pc@lopt@ic{/IC [\pc@hyenc@icolor]}% }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% %create options for \pdfannot \pc@create@pdfannotopt% \ifpc@gopt@final\else% @@ -1617,6 +1798,12 @@ % circle and square annatations differ only in /Subtype, so ... \pc@annot@square% }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}% + \pc@save@PDFOBJID{\pc@lopt@id}% + }% \hss% }% \vss% @@ -1697,6 +1884,13 @@ {% \gdef\pc@lopt@ic{/IC [\pc@hyenc@icolor]}% }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% \gdef\pc@lopt@le{/LE [\pc@lopt@linebegin\space\pc@lopt@lineend]}% \ifthenelse{\equal{\pc@lopt@type}{Line}}% {% @@ -1738,6 +1932,12 @@ /Subtype /\pc@lopt@type\space% \pc@annot@line% }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}% + \pc@save@PDFOBJID{\pc@lopt@id}% + }% \hss% }% \vss% @@ -1793,6 +1993,13 @@ \pc@copy@gopt@lopt% % Change local options if specified \setkeys{pdfmarkupcomment}{#1}% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% \zsavepos{pdfcomment:\thezref@unique}% \zref@refused{pdfcomment:\thezref@unique}% \setlength{\pc@Sposx}{\zposx{pdfcomment:\thezref@unique}sp}% @@ -1827,6 +2034,9 @@ \fi% \fi% }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% \wd\pc@mathannot@box\z@% \ht\pc@mathannot@box\z@% \dp\pc@mathannot@box\z@% @@ -1865,8 +2075,8 @@ {% \addtolength\pc@dimc{-\the\baselineskip}% }% - % one too much - \addtolength\pc@dimc{\the\baselineskip}% + % one too much + \addtolength\pc@dimc{\the\baselineskip}% \renewcommand{\pc@anna@y@four}{\pc@pttobp{\pc@dimc}}% \renewcommand{\pc@anna@y@two}{\pc@pttobp{\pc@dimc + \pc@box@depth + \pc@box@height +2pt}}% \pc@annot@secondpagefalse% @@ -1893,6 +2103,11 @@ \pc@create@annot% \else% % 2nd part of annotation on 2nd page + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,A}% + }% \pc@annot@calc@pos% \pc@copy@xy@to@anna% \renewcommand{\pc@anna@x@one}{\pc@x@left@text}% @@ -1915,6 +2130,10 @@ \fi% %only local! \gdef\pc@lopt@mathstyle{}% + % + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\pc@save@PDFOBJID{\pc@lopt@id}}% }% % \newenvironment{pdfsidelinecomment}[2][]% @@ -1942,6 +2161,13 @@ {% \gdef\pc@lopt@ic{/IC [\pc@hyenc@icolor]}% }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% \gdef\pc@lopt@le{/LE [\pc@lopt@linebegin\space\pc@lopt@lineend]}% \ifthenelse{\equal{\pc@lopt@type}{Line}}% {% @@ -1978,6 +2204,7 @@ \ifpc@annot@samepage\else% \ifpc@gopt@final\else% \ifpc@lopt@disable\else% + \pc@annot@secondpagefalse% \pc@calc@sidelinepos% \renewcommand{\pc@y@two}{\pc@y@bottom@text} \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}% @@ -2006,6 +2233,7 @@ \gdef\pc@lopt@le{/LE [\pc@lopt@lineend\space\pc@lopt@linebegin]}% \marginnote{\pc@create@annot@sideline}% \else% + \pc@annot@secondpagetrue% \pc@calc@sidelinepos% \renewcommand{\pc@y@one}{\pc@y@top@text} \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}% @@ -2017,6 +2245,103 @@ \fi% \fi% \fi% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\pc@save@PDFOBJID{\pc@lopt@id}}% +}% +% +\newcommand{\pdfreply}[2][]% +{% + \ifpc@opt@unskip\unskip\fi% + % Copy all global options to local options + \pc@copy@gopt@lopt% + % Change local options if specified + \setkeys{pdfreply}{#1}% + % Encode Contents, Author and Subject to pdf encodings (PD or PU) with hyperref's \pdfstringdef + % and transform color input to pdf color + \pc@encode@PDF{#2}% + \ifthenelse{\equal{\pc@lopt@color}{}}% + {% + \gdef\pc@lopt@c{}% + }% + {% + \gdef\pc@lopt@c{/C [\pc@hyenc@color]}% + }% + \ifthenelse{\equal{\pc@lopt@date}{}}% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@pdfdate@auto)\space/M (\pc@pdfdate@auto)}% + }% + {% + \gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}% + }% + \ifpc@gopt@final\else% + \ifpc@lopt@disable\else% + \hspace*{0pt}% + %\pc@create@lpc% + % typeset text annotation (see: PDF Reference) + \xdef\pc@zref@PDFOBJID{\pc@get@PDFOBJID{\pc@lopt@replyto}}% + \pc@afterpagefalse% + \ifpdf% + \@for\pc@for@PDFOBJID:={\pc@zref@PDFOBJID}\do% + {% + \ifthenelse{\equal{\pc@for@PDFOBJID}{A}}% + {% + \pc@afterpagetrue% + \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,A}% + }% + {% + \ifthenelse{\equal{\pc@for@PDFOBJID}{S}}% + {}% + {% + %\ifpc@afterpage% + \edef\pc@irt{/IRT \pc@for@PDFOBJID\space 0 R\space}% + \vbox% + {% + \hsize=0pt% + \noindent% + \vspace{\pc@lopt@voffset}% + \hbox to 0pt% + {% + \vsize=0pt% + \hskip\pc@lopt@hoffset% + \pdfannot width 0pt height \normalbaselineskip depth 0pt% + {% + /Subtype /Text% + \pc@lopt@c\space% + \pc@lopt@cdate\space% + /T (\pc@pdfenc@author)\space% + /Subj (\pc@pdfenc@subject)\space% + /Contents (\pc@pdfenc@contents)\space% + \pc@irt%% + /F 4\space% + }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot} + }% + \hss% + }% + }% + %\fi% + }% + }% + }% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\pc@save@PDFOBJID{\pc@lopt@id}}% + \else% + \ifpc@gopt@dvipdfmx% + \PackageError{pdfcomment}{% + \string\pdfreply\space is only supported by pdfTeX!\MessageBreak% + Please use pdf(la)tex instead}% + \else% + \PackageError{pdfcomment}{% + \string\pdfreply\space is only supported by pdfTeX!\MessageBreak% + Please use pdf(la)tex instead}% + \fi% + \fi% + \fi% + \fi% }% % % reset global options @@ -2105,6 +2430,19 @@ \fi% }% % +\zref@newlist{pdfcomment}% +\zref@newprop{PCPDFOBJID}{\pc@collect@PDFOBJID}% +\zref@addprop{pdfcomment}{PCPDFOBJID}% +% +\newcommand*{\pc@save@PDFOBJID}[1]% +{% + \zref@labelbylist{#1}{pdfcomment}% +}% +\newcommand*{\pc@get@PDFOBJID}[1] +{% + \zref@extract{#1}{PCPDFOBJID}% +}% +% \newcommand{\pc@create@lpc}% {% \phantomsection% @@ -2145,6 +2483,10 @@ \gdef\pc@lopt@captionhoffset{\pc@gopt@captionhoffset}% \gdef\pc@lopt@captionvoffset{\pc@gopt@captionvoffset}% \gdef\pc@lopt@linesep{\pc@gopt@linesep}% + \gdef\pc@lopt@date{\pc@gopt@date}% + \gdef\pc@lopt@timezone{\pc@gopt@timezone}% + \gdef\pc@lopt@id{}% + \gdef\pc@collect@PDFOBJID{S}% \pc@lopt@disablefalse% }% % @@ -2186,6 +2528,7 @@ \newcommand{\pc@annot@text}% {% \pc@lopt@c\space% + \pc@lopt@cdate\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% /Subj (\pc@pdfenc@subject)\space% @@ -2198,6 +2541,7 @@ \newcommand{\pc@annot@freetext}% {% \pc@lopt@c\space% + \pc@lopt@cdate\space% /DA (/\pc@lopt@font\space \pc@lopt@fontsize\space Tf\space \pc@hyenc@fontcolor\space rg)\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% @@ -2225,6 +2569,7 @@ {% \pc@lopt@c\space% \pc@lopt@ic\space% + \pc@lopt@cdate\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% /Subj (\pc@pdfenc@subject)\space% @@ -2247,6 +2592,7 @@ {% \pc@lopt@c\space% \pc@lopt@ic\space% + \pc@lopt@cdate\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% /Subj (\pc@pdfenc@subject)\space% @@ -2276,6 +2622,7 @@ {% /Subtype /\pc@lopt@markup\space% /C [\pc@hyenc@color]\space% + \pc@lopt@cdate\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% /Subj (\pc@pdfenc@subject)\space% @@ -2292,6 +2639,7 @@ <<\space% /Subtype /\pc@lopt@markup\space% /C [\pc@hyenc@color]\space% + \pc@lopt@cdate\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% /Subj (\pc@pdfenc@subject)\space% @@ -2311,6 +2659,7 @@ Subtype=/\pc@lopt@markup,% Raw={ /C [\pc@hyenc@color]\space% + \pc@lopt@cdate\space% /CA \pc@lopt@opacity\space% /T (\pc@pdfenc@author)\space% /Subj (\pc@pdfenc@subject)\space% @@ -2345,6 +2694,18 @@ \strip@pt\dimexpr .996264\dimexpr #1\relax\relax% }% % +% thanks to Heiko Oberdiek (Msg-ID: ) +\begingroup\expandafter\expandafter\expandafter\endgroup\expandafter\ifx\csname pdfcreationdate\endcsname\relax% + \edef\pc@pdfdate@edef{D:\pdfdate\pc@lopt@timezone}% +\else% + \edef\pc@pdfdate@edef{\pdfcreationdate}% +\fi% +% +\newcommand*{\pc@pdfdate@auto}% +{% + \pc@pdfdate@edef% +}% +% \newcommand{\pc@copy@xy@to@anna}% {% \renewcommand{\pc@anna@x@one}{\pc@x@one}% @@ -2371,16 +2732,16 @@ % \newcommand{\pc@annot@calc@pos}% {% - \renewcommand{\pc@x@one}{\pc@pttobp{\pc@Sposx}}% - \renewcommand{\pc@x@two}{\pc@pttobp{\pc@Eposx}}% - \renewcommand{\pc@x@three}{\pc@pttobp{\pc@Sposx}}% - \renewcommand{\pc@x@four}{\pc@pttobp{\pc@Eposx}}% - \renewcommand{\pc@y@one}{\pc@pttobp{\dimexpr \pc@Sposy + \pc@box@height + 1pt\relax}}% - \renewcommand{\pc@y@two}{\pc@pttobp{\dimexpr \pc@Eposy + \pc@box@height + 1pt\relax}}% - \renewcommand{\pc@y@three}{\pc@pttobp{\dimexpr \pc@Sposy - \pc@box@depth - 1pt\relax}}% - \renewcommand{\pc@y@four}{\pc@pttobp{\dimexpr \pc@Eposy - \pc@box@depth - 1pt\relax}}% - \setlength{\pc@dima}{\dimexpr \pc@Sposy - \pc@box@depth - 1pt\relax}% - \setlength{\pc@dimb}{\dimexpr \pc@Eposy - \pc@box@depth - 1pt\relax}% + \renewcommand{\pc@x@one}{\pc@pttobp{\pc@Sposx}}% + \renewcommand{\pc@x@two}{\pc@pttobp{\pc@Eposx}}% + \renewcommand{\pc@x@three}{\pc@pttobp{\pc@Sposx}}% + \renewcommand{\pc@x@four}{\pc@pttobp{\pc@Eposx}}% + \renewcommand{\pc@y@one}{\pc@pttobp{\dimexpr \pc@Sposy + \pc@box@height + 1pt\relax}}% + \renewcommand{\pc@y@two}{\pc@pttobp{\dimexpr \pc@Eposy + \pc@box@height + 1pt\relax}}% + \renewcommand{\pc@y@three}{\pc@pttobp{\dimexpr \pc@Sposy - \pc@box@depth - 1pt\relax}}% + \renewcommand{\pc@y@four}{\pc@pttobp{\dimexpr \pc@Eposy - \pc@box@depth - 1pt\relax}}% + \setlength{\pc@dima}{\dimexpr \pc@Sposy - \pc@box@depth - 1pt\relax}% + \setlength{\pc@dimb}{\dimexpr \pc@Eposy - \pc@box@depth - 1pt\relax}% }% % \newcommand{\pc@annot@calc@pos@math}% @@ -2416,10 +2777,22 @@ /Subtype /Line\space% \pc@annot@line% }% - \hss% + \hss% }% - \vss% + \vss% }% + \ifpc@annot@samepage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \ifpc@annot@secondpage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \fi% + \fi% \else% \ifpc@gopt@dvipdfmx% \vbox to 0pt% @@ -2471,6 +2844,9 @@ \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@two\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@four}% \ifpdf% \pc@annot@markup@pdf% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% \else% \ifpc@gopt@dvipdfmx% \pc@annot@markup@dvipdfmx% @@ -2484,8 +2860,21 @@ %first line \pc@calc@textblockpos% \pc@copy@anna@to@annb% - \renewcommand{\pc@annb@x@two}{\pc@x@right@text}% - \renewcommand{\pc@annb@x@four}{\pc@x@right@text}% + \setlength{\pc@dimf}{\dimexpr \pc@annb@y@one bp\relax}% + \setlength{\pc@dimg}{\dimexpr \pc@y@top@text bp\relax}% + \setlength{\pc@dimh}{\pc@dimg-\pc@dimf}% + \setlength{\pc@dimi}{\pc@dimb-\pc@dimg+\the\baselineskip+\the\baselineskip}% + % set new right border only if more than 1 line on second page + \ifdim\pc@dimi<0pt% + \ifdim\pc@dimh<\the\baselineskip% + \renewcommand{\pc@annb@x@two}{\pc@x@right@text}% + \renewcommand{\pc@annb@x@four}{\pc@x@right@text}% + \fi% + \fi% + \ifpc@annot@samepage% + \renewcommand{\pc@annb@x@two}{\pc@x@right@text}% + \renewcommand{\pc@annb@x@four}{\pc@x@right@text}% + \fi% \renewcommand{\pc@annb@y@two}{\pc@anna@y@one}% \renewcommand{\pc@annb@y@four}{\pc@anna@y@three}% \ifthenelse{\equal{\pc@lopt@markup}{StrikeOut}}% @@ -2495,8 +2884,20 @@ }% {}% \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@two\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@four}% - \ifpdf% + \ifpdf% \pc@annot@markup@pdf% + \ifpc@annot@samepage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \ifpc@annot@secondpage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \fi% + \fi% \else% \ifpc@gopt@dvipdfmx% \pc@annot@markup@dvipdfmx% @@ -2515,22 +2916,44 @@ \edef\pc@annb@y@four{\pc@pttobp{\dimexpr \pc@annb@y@four bp + 1.5pt\relax}}% \edef\pc@annb@y@three{\pc@pttobp{\dimexpr \pc@annb@y@three bp + 1.5pt \relax}}% }% - {}% + {}% \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@two\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@four}% - \ifpdf% - \pc@annot@markup@pdf% - \else% - \ifpc@gopt@dvipdfmx% - \pc@annot@markup@dvipdfmx% + \setlength{\pc@dimg}{\dimexpr \pc@annb@y@one bp\relax}% + \setlength{\pc@dimh}{\pc@dimg-\pc@dimf+3pt}% + % only 1 line on first page? => no annotation for last line + \ifdim\pc@dimh<0pt% + \ifpdf% + \pc@annot@markup@pdf% + \ifpc@annot@samepage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \ifpc@annot@secondpage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \fi% + \fi% \else% - \pc@annot@markup@dvips% + \ifpc@gopt@dvipdfmx% + \pc@annot@markup@dvipdfmx% + \else% + \pc@annot@markup@dvips% + \fi% \fi% - \fi% + \fi% %middle lines \pc@copy@anna@to@annb% \setlength{\pc@dimc}{\dimexpr \pc@annb@y@one bp + 0.1pt\relax}% - \setlength{\pc@dimd}{\dimexpr \pc@annb@y@two bp\relax}% - \setcounter{pc@annot@lines}{0}% + \ifpc@annot@samepage% + \setlength{\pc@dimd}{\dimexpr \pc@annb@y@two bp\relax}% + \fi% + \ifpc@annot@secondpage% + \setlength{\pc@dimd}{\dimexpr \pc@annb@y@two bp\relax}% + \fi% + \setcounter{pc@annot@lines}{0}% \setlength{\pc@dime}{\pc@dimc}% \addtolength{\pc@dime}{-\pc@dimd}% % count lines @@ -2564,6 +2987,18 @@ \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@one\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@three}% \ifpdf% \pc@annot@markup@pdf% + \ifpc@annot@samepage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \ifpc@annot@secondpage% + \ifthenelse{\equal{\pc@lopt@id}{}}% + {}% + {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}% + \else% + \fi% + \fi% \else% \ifpc@gopt@dvipdfmx% \pc@annot@markup@dvipdfmx% -- cgit v1.2.3