[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: hmmm (7d7d5f6)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Apr 30 00:43:33 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : renamedict77
Link       : https://github.com/latex3/pdfresources/commit/7d7d5f616afbe46aa4487cee2e2d819ee40aa86e

>---------------------------------------------------------------

commit 7d7d5f616afbe46aa4487cee2e2d819ee40aa86e
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Apr 30 00:43:33 2020 +0200

    hmmm


>---------------------------------------------------------------

7d7d5f616afbe46aa4487cee2e2d819ee40aa86e
 experiments/new-attachfile.tex |  24 +-
 newpackages/atfi-generic.def   |  90 ------
 newpackages/new-attachfile.sty | 641 ++++++++++++++++++++++-------------------
 3 files changed, 346 insertions(+), 409 deletions(-)

diff --git a/experiments/new-attachfile.tex b/experiments/new-attachfile.tex
index ef2822c..fc26790 100644
--- a/experiments/new-attachfile.tex
+++ b/experiments/new-attachfile.tex
@@ -10,6 +10,12 @@
 %t0\attachfilesetup{color=attachfilecolor}
 \begin{document}
 abc
+\makeatletter
+\atfi at acroPaperclip
+\atfi at acroTag
+\atfi at acroGraph
+\atfi at acroPushPin
+\end{document}
 \ExplSyntaxOn
 \__pdf_backend_xform_if_exist:nTF { atfi at appearancebox }{true}{false}
 \par
@@ -40,26 +46,14 @@ abc
 \atfi at acroTag
 \ExplSyntaxOn
 
-\prop_const_from_keyval:Nn \__pdf_annot_flag_prop:
- {
-   Invisible = 0,
-   Hidden    = 1,
-   Print     = 2,
-   NoZoom    = 3,
-   NoRotate  = 4,
-   NoView    = 5,
-   ReadOnly  = 6,
-   Locked    = 7,
-   ToggleNoView = 8,
-   LockedContents = 9
- }
+
 \bitsetReset {annotFlag}
 
-\bitsetSet{annotFlag}{\prop_item:Nn\__pdf_annot_flag_prop:{Print}}
+\bitsetSet{annotFlag}{\prop_item:Nn\c__pdf_annot_flag_prop:{Print}}
 
 \bitsetGetDec {annotFlag}\par
 
-\bitsetSet{annotFlag}{\prop_item:Nn\__pdf_annot_flag_prop:{NoZoom}}
+\bitsetSet{annotFlag}{\prop_item:Nn\c__pdf_annot_flag_prop:{NoZoom}}
 
 \bitsetGetDec {annotFlag}
 \ExplSyntaxOff
diff --git a/newpackages/atfi-generic.def b/newpackages/atfi-generic.def
index ec87098..40a929c 100644
--- a/newpackages/atfi-generic.def
+++ b/newpackages/atfi-generic.def
@@ -42,97 +42,7 @@
 \ProvidesFile{atfi-generic.def}%
   [2020/04/13 v1.0 generic attachfile2 (UF)]%
 
-\define at key{AtFi at file}{Size}{%
-  \edef\atfi at params{\atfi at params/Size #1}%
-}
-\ExplSyntaxOn
-\def\atfi at embedfile#1
-  {%
-  \pdfobject_if_exist:nF { atfi at fileobj@#1 }
-   {
-     %keys for dict entries ...
-     \pdffile_embed:nn { atfi at fileobj@#1 }{ #1 }
-   }
-  }
 
-% we probably need an xform by icon ...
-
-\def\atfi at xform{%
-  \pdf_xform_if_exist:nF { atfi at appearancebox }
-    {
-      \pdf_xform_new:nnn
-        { atfi at appearancebox }
-        { }
-        { \usebox\atfi at appearancebox }
-    }
-  %\immediate\pdfxform\atfi at appearancebox
-  %\edef\atfi at appearanceobj{\the\pdflastxform}%
-}
-
-
-%\let\atfi at xform@icon\atfi at xform
-%\def\atfi at refxform#1{%
-%  %\pdf_xform_ref:n { #1 }
-%  \pdf_xform_use:n { atfi at appearancebox }
-%  %\pdfrefxform#1\relax
-%}
-
-\def\atfi at insert@file at annot#1{%
-  \rule{0pt}{0pt}%
-  \ifatfi at appearance
-    \edef\atfi at appearance@dict{%
-      /AP<<%
-        /N~ \pdf_xform_ref:n { atfi at appearancebox }%
-        /R~ \pdf_xform_ref:n { atfi at appearancebox }%
-        /D~ \pdf_xform_ref:n { atfi at appearancebox }%
-      >>%
-    }%
-  \else
-    \let\atfi at appearance@dict\ltx at empty
-  \fi
-%  \ltx at IfUndefined{atfi at fsobj@#1}{%
-%    \begingroup
-%      \hypersetup{unicode=false}%
-%      \atfi at pdfstringdef\atfi at file{#1}%
-%      \pdf_object_now:nx{dict}{%
-%          /Type/Filespec%
-%          /F(\atfi at file)%
-%          \ifx\atfi at ucfilespec\ltx at empty
-%          \else
-%            /UF(\atfi at ucfilespec)%
-%          \fi
-%          /EF<<%
-%            /F~ \@nameuse{atfi at fileobj@#1}%
-%          >>%
-%      }%
-%      \expandafter\xdef\csname atfi at fsobj@#1\endcsname{%
-%        \pdf_object_last:
-%      }%
-%    \endgroup
-%  }{%
-%  }%
-  \pdfannot_box:nnnn
-     {\atfi at scale\atfi at appearancewidth}
-     {\atfi at scale\atfi at appearanceheight}
-     {\atfi at scale\atfi at appearancedepth}
-     {
-      /Subtype/FileAttachment%
-      \atfi at icon
-      \atfi at color@annot
-      \atfi at author
-      \atfi at date
-      \atfi at annotname
-      \atfi at description
-      \atfi at subject
-      \atfi at appearance@dict
-      /F~ \theatfi at flags
-      /FS~ \pdf_object_ref:n{atfi at fileobj@#1}%
-     }%
-  %\rule{0pt}{\atfi at appearanceheight}%
-%  \rule[-\atfi at appearancedepth]{0pt}{\atfi at appearancedepth}%
-%  \rule{\atfi at appearancewidth}{0pt}%
-}
-\ExplSyntaxOff
 \endinput
 %%
 %% End of file `atfi-pdftex.def'.
diff --git a/newpackages/new-attachfile.sty b/newpackages/new-attachfile.sty
index e4b966e..0ddac65 100644
--- a/newpackages/new-attachfile.sty
+++ b/newpackages/new-attachfile.sty
@@ -37,85 +37,10 @@
 \RequirePackage{pdfescape}[2007/11/11]
 \RequirePackage{hyperref}
 \RequirePackage{hycolor}[2008/07/29]
-\RequirePackage{l3color,l3draw,l3pdffile}
+\RequirePackage{l3color,l3draw,l3pdffile,bitset,xparse}
 
 
-\ltx at IfUndefined{pdfmatch}{%
-  \def\atfi at Match#1#2#3#4#5{}%
-}{%
-  \def\atfi at Match#1#2#3{%
-    \begingroup
-    \edef\^{\ltx at backslashchar\string^}%
-    \edef\.{\ltx at backslashchar.}%
-    \let\#\ltx at hashchar
-    \edef\[{\ltx at backslashchar[}% ]]
-    \edef\${\ltx at backslashchar$}%
-    \let\%\ltx at percentchar
-    \edef\&{\string&}%
-    \edef\({\ltx at backslashchar(}%
-    \edef\){\ltx at backslashchar)}%
-    \edef\|{\ltx at backslashchar|}%
-    \edef\*{\ltx at backslashchar*}%
-    \edef\+{\ltx at backslashchar+}%
-    \edef\?{\ltx at backslashchar?}%
-    \edef\{{\ltx at backslashchar\ltx at leftbracechar}%
-    \edef\}{\ltx at rightbracechar}%
-    \edef\\{\ltx at backslashchar\ltx at backslashchar}%
-    \edef\~{\string~}%
-    \ifcase\pdfmatch#3{#2}{#1} %
-      \endgroup
-      \expandafter\ltx at secondoftwo
-    \or
-      \endgroup
-      \expandafter\ltx at firstoftwo
-    \else
-%      \atfi at Warning{%
-%        Internal error: Wrong pattern!\MessageBreak
-%        --> #2 <--\MessageBreak
-%        Pattern check ignored%
-%      }%
-      \endgroup
-      \expandafter\ltx at firstoftwo
-    \fi
-  }%
-  \def\atfi at PatToken{%
-    [%
-      -% first character
-      !%
-      \#$\%\&'%
-      \*\+\.%
-      0-9%
-      A-Z%
-      \^_`%
-      a-z%
-      \{\}\|\~%
-    ]+%
-  }%
-  \begingroup
-    \lccode64=13 % @
-  \lowercase{\endgroup
-    \def\atfi at CR{@}%
-  }%
-  \def\atfi at PatQuotedString{%
-    "%
-    ([^"\\\atfi at CR]|\\.)*%
-    "%
-  }%
-  \ltx at ifpackagelater{ltxcmds}{2010/09/11}{}{%
-    \begingroup
-      \lccode`0=`\{\relax
-    \lowercase{\endgroup
-      \def\ltx at leftbracechar{0}%
-    }%
-    \begingroup
-      \lccode`0=`\}\relax
-    \lowercase{\endgroup
-      \def\ltx at rightbracechar{0}%
-    }%
-  }%
-}
-
-%\def\atfi at Warning{\PackageWarning{new-attachfile}}
+%pattern matching removed. Perhaps later with regex ...
 
 
 \SetupKeyvalOptions{%
@@ -123,14 +48,26 @@
   prefix=atfi@%
 }
 
-\def\atfi at setup{\setkeys{AtFi}}
+\ExplSyntaxOn
+\cs_new_protected:Npn \atfi at setup #1
+  {
+    \keys_set:nn {AtFi} { #1 }
+  }
+\ExplSyntaxOff
 \DeclareBoolOption{draft}
 \DeclareComplementaryOption{final}{draft}
 
 \ExplSyntaxOn
 \keys_define:nn { atfi }
   {
-    %mimetype -> embed step
+    %mimetype   -> embed step
+    ,mimetype  .tl_set:N = \l__atfi_mimetype_tl %escape with \pdftool_name:V later or now?
+
+
+    %ucfilespec -> embed step
+    %checksum   -> bool to suppress the checksum
+    %creationdate ->additional /CreationDate in FileSpec-dict
+    %moddate    -> boolean to suppress /ModDate in FileSpec
 
     %icon     -> attach step / setup
     %         choice? PushPin, Data, Graph,
@@ -153,19 +90,29 @@
     % description /Contents
 
     % subject    /Subj
+
+    % appearance: decides if the appearance dict is insert. drop?
+
+    % print: sets /F flag, also boolean used in the no-XXX command
+
+    % scale :scales the icon/annot
+
+    %   timezone,: ignored (we take \file_timestamp)
   }
+
+\bitsetReset {__atfi_annotFlags}
 \ExplSyntaxOff
-\def\atfi at mimetype{}
-\define at key{AtFi}{mimetype}{%
-  \edef\atfi at mimetype{#1}%
-  % pattern matching remove as it fails with allowed types
-  %
-  \ifx\atfi at mimetype\ltx at empty
-  \else
-    \EdefEscapeName\atfi at mimetype{\atfi at mimetype}%
-    \edef\atfi at mimetype{/Subtype/\atfi at mimetype}%
-  \fi
-}
+%\def\atfi at mimetype{}
+%\define at key{AtFi}{mimetype}{%
+%  \edef\atfi at mimetype{#1}%
+%  % pattern matching remove as it fails with allowed types
+%  %
+%  \ifx\atfi at mimetype\ltx at empty
+%  \else
+%    \EdefEscapeName\atfi at mimetype{\atfi at mimetype}%
+%    \edef\atfi at mimetype{/Subtype/\atfi at mimetype}%
+%  \fi
+%}
 \define at key{AtFi}{icon}{%
   \def\atfi at icon{/Name/#1}%
   \def\atfi at icon@icon{#1}%
@@ -233,8 +180,12 @@
 \define at key{AtFi}{subject}[\NoValue]{%
   \atfi at DefNoValueName\atfi at subject{Subj}{#1}%
 }
-\DeclareBoolOption[true]{print}
-\DeclareBoolOption[true]{zoom}
+\DeclareBoolOption[true]{print} % should set boolean and
+%\bitsetSet{__atfi_annotFlags}{\prop_item:Nn\c__pdf_annot_flag_prop:{Print}}
+
+\DeclareBoolOption[true]{zoom} %should set boolean and
+%\bitsetSet{__atfi_annotFlags}{\prop_item:Nn\c__pdf_annot_flag_prop:{Zoom}}
+
 \DeclareBoolOption[true]{appearance}
 \DeclareStringOption[1]{scale}
 \def\atfi at ucfilespec{}
@@ -245,8 +196,6 @@
     \atfi at pdfstringdef\atfi at ucfilespec{#1}%
   \fi
 }
-\DeclareBoolOption{nofiles}
-
 
 \DeclareRobustCommand{\attachfilesetup}[1]{\setkeys{AtFi}{#1}}
 \DeclareLocalOptions{%
@@ -258,11 +207,9 @@
   description,%
   icon,%
   mimetype,%
-  nofiles,%
   print,%
   scale,%
   subject,%
-  timezone,%
   ucfilespec,%
   zoom,%
 }
@@ -304,7 +251,299 @@
   }%
    \expandafter\endinput
 \fi
-\input{atfi-generic.def}
+%\input{atfi-generic.def}
+\define at key{AtFi at file}{Size}{%
+  \edef\atfi at params{\atfi at params/Size #1}%
+}
+\ExplSyntaxOn
+\def\atfi at embedfile#1
+  {%
+  \pdfobject_if_exist:nF { atfi at fileobj@#1 }
+   {
+     %keys for dict entries ...
+     \pdffile_embed:nn { atfi at fileobj@#1 }{ #1 }
+   }
+  }
+
+% we probably need an xform by icon ...
+
+\def\atfi at xform{%
+  \pdf_xform_if_exist:nF { atfi at appearancebox }
+    {
+      \pdf_xform_new:nnn
+        { atfi at appearancebox }
+        { }
+        { \usebox\atfi at appearancebox }
+    }
+  %\immediate\pdfxform\atfi at appearancebox
+  %\edef\atfi at appearanceobj{\the\pdflastxform}%
+}
+
+
+\let\atfi at xform@icon\atfi at xform
+%\def\atfi at refxform#1{%
+%  %\pdf_xform_ref:n { #1 }
+%  \pdf_xform_use:n { atfi at appearancebox }
+%  %\pdfrefxform#1\relax
+%}
+
+\def\atfi at insert@file at annot#1{%
+  \rule{0pt}{0pt}%
+  \ifatfi at appearance
+    \edef\atfi at appearance@dict{%
+      /AP<<%
+        /N~ \pdf_xform_ref:n { atfi at appearancebox }%
+        /R~ \pdf_xform_ref:n { atfi at appearancebox }%
+        /D~ \pdf_xform_ref:n { atfi at appearancebox }%
+      >>%
+    }%
+  \else
+    \let\atfi at appearance@dict\ltx at empty
+  \fi
+%  \ltx at IfUndefined{atfi at fsobj@#1}{%
+%    \begingroup
+%      \hypersetup{unicode=false}%
+%      \atfi at pdfstringdef\atfi at file{#1}%
+%      \pdf_object_now:nx{dict}{%
+%          /Type/Filespec%
+%          /F(\atfi at file)%
+%          \ifx\atfi at ucfilespec\ltx at empty
+%          \else
+%            /UF(\atfi at ucfilespec)%
+%          \fi
+%          /EF<<%
+%            /F~ \@nameuse{atfi at fileobj@#1}%
+%          >>%
+%      }%
+%      \expandafter\xdef\csname atfi at fsobj@#1\endcsname{%
+%        \pdf_object_last:
+%      }%
+%    \endgroup
+%  }{%
+%  }%
+  \pdfannot_box:nnnn
+     {\atfi at scale\atfi at appearancewidth}
+     {\atfi at scale\atfi at appearanceheight}
+     {\atfi at scale\atfi at appearancedepth}
+     {
+      /Subtype/FileAttachment%
+      \atfi at icon
+      \atfi at color@annot
+      \atfi at author
+      \atfi at date
+      \atfi at annotname
+      \atfi at description
+      \atfi at subject
+      \atfi at appearance@dict
+      /F~ \bitsetGetDec {__atfi_annotFlags}
+      /FS~ \pdf_object_ref:n{atfi at fileobj@#1}%
+     }%
+  %\rule{0pt}{\atfi at appearanceheight}%
+%  \rule[-\atfi at appearancedepth]{0pt}{\atfi at appearancedepth}%
+%  \rule{\atfi at appearancewidth}{0pt}%
+}
+\ExplSyntaxOff
+
+%\def\attachfile at timezone#1{%
+%  \ifx\\#1\\%
+%    % no timezone information given
+%  \else
+%    \def\atfi at timezone{#1}%
+%  \fi
+%}
+
+\newcommand*{\attachfile at file}[2][]{%
+  \EdefUnescapeHex\atfi at filename{#2}%
+  \ifx\atfi at filename\ltx at empty
+    \PackageError{attachfile2}{Empty file name}\@ehc
+  \else
+    \@namedef{atfi at file@\atfi at filename}{#1}%
+  \fi
+}
+
+%\newif\ifatfi at checksum
+%\define at key{AtFi at file}{CheckSum}{%
+%  \atfi at checksumtrue
+%  \edef\atfi at params{\atfi at params/CheckSum<#1>}%
+%}
+%\newif\ifatfi at creationdate
+%\define at key{AtFi at file}{CreationDateTZ}{%
+%  \ifatfi at creationdate
+%  \else
+%    \atfi at creationdatetrue
+%    \edef\atfi at params{%
+%      \atfi at params
+%      /CreationDate(#1)%
+%    }%
+%  \fi
+%}
+%\define at key{AtFi at file}{CreationDate}{%
+%  \ifatfi at creationdate
+%  \else
+%    \atfi at creationdatetrue
+%    \edef\atfi at params{%
+%      \atfi at params
+%      /CreationDate(#1\atfi at timezone)%
+%    }%
+%  \fi
+%}
+\newif\ifatfi at moddate
+\define at key{AtFi at file}{ModDateTZ}{%
+  \ifatfi at moddate
+  \else
+    \atfi at moddatetrue
+    \edef\atfi at params{%
+      \atfi at params
+      /ModDate(#1)%
+    }%
+  \fi
+}
+\define at key{AtFi at file}{ModDate}{%
+  \ifatfi at moddate
+  \else
+    \atfi at moddatetrue
+    \edef\atfi at params{%
+      \atfi at params
+      /ModDate(D:#1\atfi at timezone)%
+    }%
+  \fi
+}
+%\let\atfi at temp\ltx at one
+%\ltx at IfUndefined{pdf at filesize}{%
+%  \let\atfi at temp\ltx at zero
+%}{}
+%\ltx at IfUndefined{pdf at filemoddate}{%
+%  \let\atfi at temp\ltx at zero
+%}{}
+%\ltx at IfUndefined{pdf at filemdfivesum}{%
+%  \let\atfi at temp\ltx at zero
+%}{}
+%\ifcase\atfi at temp
+%  \let\atfi at pdftexdata\ltx at gobble
+%\or
+%  \def\atfi at pdftexdata#1{%
+%    \edef\atfi at temp{\pdf at filesize{#1}}%
+%    \ifx\atfi at temp\ltx at empty
+%    \else
+%      \setkeys{AtFi at file}{Size=\atfi at temp}%
+%      \edef\atfi at temp{\pdf at filemoddate{#1}}%
+%      \ifx\atfi at temp\ltx at empty
+%      \else
+%        \setkeys{AtFi at file}{ModDateTZ=\atfi at temp}%
+%      \fi
+%      \edef\atfi at temp{\pdf at filemdfivesum{#1}}%
+%      \ifx\atfi at temp\ltx at empty
+%      \else
+%        \setkeys{AtFi at file}{CheckSum=\atfi at temp}%
+%      \fi
+%    \fi
+%  }%
+%\fi
+%atfi file unneeded
+%\atfi at DisableOption{nofiles}
+\def\atfi at attachfile#1#2{%
+  \atfi at setup{#1}%
+  \atfi at embedfile{#2}%
+  \atfi at set@appearance at icon
+  %\atfi at flags@to at int %flags are set in setup
+  \atfi at insert@file at annot{#2}%
+  \endgroup
+}
+\newlength{\atfi at appearancewidth}
+\newlength{\atfi at appearanceheight}
+\newlength{\atfi at appearancedepth}
+\newsavebox{\atfi at appearancebox}
+\def\atfi at set@appearance at icon{%
+  \ltx at IfUndefined{atfi at appobj@\atfi at icon@icon}{%
+    \savebox{\atfi at appearancebox}{%
+      \@nameuse{atfi at acro\atfi at icon@icon}%
+    }%
+    \expandafter
+    \xdef\csname atfi at appwidth@\atfi at icon@icon\endcsname{%
+      \the\wd\atfi at appearancebox
+    }%
+    \expandafter
+    \xdef\csname atfi at appheight@\atfi at icon@icon\endcsname{%
+      \the\ht\atfi at appearancebox
+    }%
+    \expandafter
+    \xdef\csname atfi at appdepth@\atfi at icon@icon\endcsname{%
+      \the\dp\atfi at appearancebox
+    }%
+    \atfi at xform@icon
+    \global\expandafter\let
+        \csname atfi at appobj@\atfi at icon@icon\endcsname
+        \atfi at appearanceobj
+  }{%
+  }%
+  % optimization: \setlength dropped
+  \atfi at appearancewidth=%
+      \@nameuse{atfi at appwidth@\atfi at icon@icon}\relax
+  \atfi at appearanceheight=%
+      \@nameuse{atfi at appheight@\atfi at icon@icon}\relax
+  \atfi at appearancedepth=%
+      \@nameuse{atfi at appdepth@\atfi at icon@icon}\relax
+  \expandafter\let\expandafter\atfi at appearanceobj
+      \csname atfi at appobj@\atfi at icon@icon\endcsname
+}
+\def\atfi at set@appearance#1{%
+  \savebox{\atfi at appearancebox}{#1}%
+  \atfi at appearancewidth=\wd\atfi at appearancebox
+  \atfi at appearanceheight=\ht\atfi at appearancebox
+  \atfi at appearancedepth=\dp\atfi at appearancebox
+  \atfi at xform
+}
+
+\def\atfi at textattachfile#1#2{%
+    \endgroup
+    \atfi at textattachfile@i{#1}{#2}%
+}
+\def\atfi at textattachfile@i#1#2#3{%
+    \atfi at setup{#1}%
+    \atfi at embedfile{#2}%
+    \atfi at set@appearance{%
+      \leavevmode
+      \begingroup
+        \HyColor at UseColor\atfi at color@tex
+        #3\strut
+      \endgroup
+    }%
+    %\atfi at flags@to at int
+    \atfi at insert@file at annot{#2}%
+  \endgroup
+}
+\DeclareRobustCommand{\attachfile}[1][]{%
+  \begingroup
+    \let\do\@makeother
+    \dospecials
+    \catcode`\{=1\relax
+    \catcode`\}=2\relax
+    \atfi at attachfile{#1}%
+}
+\DeclareRobustCommand{\textattachfile}[1][]{%
+  \begingroup
+    \begingroup
+      \let\do\@makeother
+      \dospecials
+      \catcode`\{=1\relax
+      \catcode`\}=2\relax
+      \atfi at textattachfile{#1}%
+}
+\DeclareRobustCommand{\noattachfile}[1][]{%
+  \begingroup
+    \atfi at setup{#1}%
+    \atfi at set@appearance at icon
+    \ifatfi at print
+      \expandafter
+      %\atfi at refxform\csname atfi at appobj@\atfi at icon@icon\endcsname %???
+      \pdf_xform_use:n { atfi at appearancebox } %icon, is use meant here??
+    \else
+      \makebox[\atfi at appearancewidth]{}%
+    \fi
+  \endgroup
+}
+
+%data for the icons
 \ExplSyntaxOn
 
 \cs_new_protected:Npn \__atfi_color_to_rgb_seq:nN #1 #2 % #1 name #2 seq
@@ -566,213 +805,7 @@
    }
 
 \ExplSyntaxOff
-\def\attachfile at timezone#1{%
-  \ifx\\#1\\%
-    % no timezone information given
-  \else
-    \def\atfi at timezone{#1}%
-  \fi
-}
-\newcommand*{\attachfile at file}[2][]{%
-  \EdefUnescapeHex\atfi at filename{#2}%
-  \ifx\atfi at filename\ltx at empty
-    \PackageError{attachfile2}{Empty file name}\@ehc
-  \else
-    \@namedef{atfi at file@\atfi at filename}{#1}%
-  \fi
-}
 
-\newif\ifatfi at checksum
-\define at key{AtFi at file}{CheckSum}{%
-  \atfi at checksumtrue
-  \edef\atfi at params{\atfi at params/CheckSum<#1>}%
-}
-\newif\ifatfi at creationdate
-\define at key{AtFi at file}{CreationDateTZ}{%
-  \ifatfi at creationdate
-  \else
-    \atfi at creationdatetrue
-    \edef\atfi at params{%
-      \atfi at params
-      /CreationDate(#1)%
-    }%
-  \fi
-}
-\define at key{AtFi at file}{CreationDate}{%
-  \ifatfi at creationdate
-  \else
-    \atfi at creationdatetrue
-    \edef\atfi at params{%
-      \atfi at params
-      /CreationDate(#1\atfi at timezone)%
-    }%
-  \fi
-}
-\newif\ifatfi at moddate
-\define at key{AtFi at file}{ModDateTZ}{%
-  \ifatfi at moddate
-  \else
-    \atfi at moddatetrue
-    \edef\atfi at params{%
-      \atfi at params
-      /ModDate(#1)%
-    }%
-  \fi
-}
-\define at key{AtFi at file}{ModDate}{%
-  \ifatfi at moddate
-  \else
-    \atfi at moddatetrue
-    \edef\atfi at params{%
-      \atfi at params
-      /ModDate(D:#1\atfi at timezone)%
-    }%
-  \fi
-}
-\let\atfi at temp\ltx at one
-\ltx at IfUndefined{pdf at filesize}{%
-  \let\atfi at temp\ltx at zero
-}{}
-\ltx at IfUndefined{pdf at filemoddate}{%
-  \let\atfi at temp\ltx at zero
-}{}
-\ltx at IfUndefined{pdf at filemdfivesum}{%
-  \let\atfi at temp\ltx at zero
-}{}
-\ifcase\atfi at temp
-  \let\atfi at pdftexdata\ltx at gobble
-\or
-  \def\atfi at pdftexdata#1{%
-    \edef\atfi at temp{\pdf at filesize{#1}}%
-    \ifx\atfi at temp\ltx at empty
-    \else
-      \setkeys{AtFi at file}{Size=\atfi at temp}%
-      \edef\atfi at temp{\pdf at filemoddate{#1}}%
-      \ifx\atfi at temp\ltx at empty
-      \else
-        \setkeys{AtFi at file}{ModDateTZ=\atfi at temp}%
-      \fi
-      \edef\atfi at temp{\pdf at filemdfivesum{#1}}%
-      \ifx\atfi at temp\ltx at empty
-      \else
-        \setkeys{AtFi at file}{CheckSum=\atfi at temp}%
-      \fi
-    \fi
-  }%
-\fi
-%atfi file unneeded
-%\atfi at DisableOption{nofiles}
-\def\atfi at attachfile#1#2{%
-  \atfi at setup{#1}%
-  \atfi at embedfile{#2}%
-  \atfi at set@appearance at icon
-  \atfi at flags@to at int
-  \atfi at insert@file at annot{#2}%
-  \endgroup
-}
-\newlength{\atfi at appearancewidth}
-\newlength{\atfi at appearanceheight}
-\newlength{\atfi at appearancedepth}
-\newsavebox{\atfi at appearancebox}
-\def\atfi at set@appearance at icon{%
-  \ltx at IfUndefined{atfi at appobj@\atfi at icon@icon}{%
-    \savebox{\atfi at appearancebox}{%
-      \@nameuse{atfi at acro\atfi at icon@icon}%
-    }%
-    \expandafter
-    \xdef\csname atfi at appwidth@\atfi at icon@icon\endcsname{%
-      \the\wd\atfi at appearancebox
-    }%
-    \expandafter
-    \xdef\csname atfi at appheight@\atfi at icon@icon\endcsname{%
-      \the\ht\atfi at appearancebox
-    }%
-    \expandafter
-    \xdef\csname atfi at appdepth@\atfi at icon@icon\endcsname{%
-      \the\dp\atfi at appearancebox
-    }%
-    \atfi at xform@icon
-    \global\expandafter\let
-        \csname atfi at appobj@\atfi at icon@icon\endcsname
-        \atfi at appearanceobj
-  }{%
-  }%
-  % optimization: \setlength dropped
-  \atfi at appearancewidth=%
-      \@nameuse{atfi at appwidth@\atfi at icon@icon}\relax
-  \atfi at appearanceheight=%
-      \@nameuse{atfi at appheight@\atfi at icon@icon}\relax
-  \atfi at appearancedepth=%
-      \@nameuse{atfi at appdepth@\atfi at icon@icon}\relax
-  \expandafter\let\expandafter\atfi at appearanceobj
-      \csname atfi at appobj@\atfi at icon@icon\endcsname
-}
-\def\atfi at set@appearance#1{%
-  \savebox{\atfi at appearancebox}{#1}%
-  \atfi at appearancewidth=\wd\atfi at appearancebox
-  \atfi at appearanceheight=\ht\atfi at appearancebox
-  \atfi at appearancedepth=\dp\atfi at appearancebox
-  \atfi at xform
-}
-\newcounter{atfi at flags}
-\DeclareRobustCommand{\atfi at flags@to at int}{%
-  \setcounter{atfi at flags}{0}%
-  \ifatfi at print
-    \addtocounter{atfi at flags}{4}%
-  \fi%
-  \ifatfi at zoom
-  \else
-    \addtocounter{atfi at flags}{8}%
-  \fi%
-}
-\def\atfi at textattachfile#1#2{%
-    \endgroup
-    \atfi at textattachfile@i{#1}{#2}%
-}
-\def\atfi at textattachfile@i#1#2#3{%
-    \atfi at setup{#1}%
-    \atfi at embedfile{#2}%
-    \atfi at set@appearance{%
-      \leavevmode
-      \begingroup
-        \HyColor at UseColor\atfi at color@tex
-        #3\strut
-      \endgroup
-    }%
-    \atfi at flags@to at int
-    \atfi at insert@file at annot{#2}%
-  \endgroup
-}
-\DeclareRobustCommand{\attachfile}[1][]{%
-  \begingroup
-    \let\do\@makeother
-    \dospecials
-    \catcode`\{=1\relax
-    \catcode`\}=2\relax
-    \atfi at attachfile{#1}%
-}
-\DeclareRobustCommand{\textattachfile}[1][]{%
-  \begingroup
-    \begingroup
-      \let\do\@makeother
-      \dospecials
-      \catcode`\{=1\relax
-      \catcode`\}=2\relax
-      \atfi at textattachfile{#1}%
-}
-\DeclareRobustCommand{\noattachfile}[1][]{%
-  \begingroup
-    \atfi at setup{#1}%
-    \atfi at set@appearance at icon
-    \ifatfi at print
-      \expandafter
-      %\atfi at refxform\csname atfi at appobj@\atfi at icon@icon\endcsname %???
-      \pdf_xform_use:n { atfi at appearancebox } %icon, is use meant here??
-    \else
-      \makebox[\atfi at appearancewidth]{}%
-    \fi
-  \endgroup
-}
 \endinput
 %%
-%% End of file `attachfile2.sty'.
+%% End of file `new-attachfile.sty'.





More information about the latex3-commits mailing list.