[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: working on attachfile (0c75538)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Apr 28 19:40:10 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : renamedict77
Link       : https://github.com/latex3/pdfresources/commit/0c75538c8fb66abb93e9cd172529c14767685641

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

commit 0c75538c8fb66abb93e9cd172529c14767685641
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Apr 28 19:40:10 2020 +0200

    working on attachfile


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

0c75538c8fb66abb93e9cd172529c14767685641
 experiments/new-attachfile.tex |  7 +++++--
 newpackages/atfi-generic.def   | 46 +++++++++++++++++++++---------------------
 newpackages/new-attachfile.sty | 10 ---------
 3 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/experiments/new-attachfile.tex b/experiments/new-attachfile.tex
index c724621..1038b23 100644
--- a/experiments/new-attachfile.tex
+++ b/experiments/new-attachfile.tex
@@ -3,13 +3,16 @@
 \usepackage{xcolor}
 \usepackage[customdriver=hgeneric-experimental]{hyperref}
 \usepackage{new-attachfile,l3draw,l3color}
+\ExplSyntaxOn
+\pdf_uncompress:
+\ExplSyntaxOff
 %\definecolor{attachfilecolor}{cmyk}{.1,.2,.3,.4}
 %t0\attachfilesetup{color=attachfilecolor}
 \begin{document}
 abc
-\attachfile[icon=Graph,mimetype=application/x-hdf]{catalogue.tex} some text
+\attachfile[icon=Graph,mimetype=text/plain]{catalogue.tex} some text
 
-%\attachfile[icon=Paperclip,mimetype=application/x-hdf]{catalogue.tex} some text
+\attachfile[icon=Paperclip,mimetype=application/x-hdf]{catalogue.tex} some text
 
 %\attachfile[icon=Tag,mimetype=application/x-hdf]{catalogue.tex} some text
 %
diff --git a/newpackages/atfi-generic.def b/newpackages/atfi-generic.def
index f0450f4..41268ce 100644
--- a/newpackages/atfi-generic.def
+++ b/newpackages/atfi-generic.def
@@ -51,7 +51,7 @@
   \pdfobject_if_exist:nF { atfi at fileobj@#1 }
    {
      %keys for dict entries ...
-     \pdffile_embed:nn {atfi at fileobj@#1 }{ #1 }
+     \pdffile_embed:nn { atfi at fileobj@#1 }{ #1 }
    }
   }
 
@@ -85,27 +85,27 @@
   \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
-  }{%
-  }%
+%  \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}
@@ -121,7 +121,7 @@
       \atfi at subject
       \atfi at appearance@dict
       /F~ \theatfi at flags
-      /FS~ \@nameuse{atfi at fsobj@#1}%
+      /FS~ \pdf_object_ref:n{atfi at fileobj@#1}%
      }%
   %\rule{0pt}{\atfi at appearanceheight}%
 %  \rule[-\atfi at appearancedepth]{0pt}{\atfi at appearancedepth}%
diff --git a/newpackages/new-attachfile.sty b/newpackages/new-attachfile.sty
index fda35cb..fd1eaca 100644
--- a/newpackages/new-attachfile.sty
+++ b/newpackages/new-attachfile.sty
@@ -662,11 +662,6 @@
 %atfi file unneeded
 %\atfi at DisableOption{nofiles}
 \def\atfi at attachfile#1#2{%
-  \ltx at IfUndefined{atfi at fileobj@#2}{%
-    \atfi at writefile{#2}%
-  }{%
-    % don't need duplicates
-  }%
   \atfi at setup{#1}%
   \atfi at embedfile{#2}%
   \atfi at set@appearance at icon
@@ -734,11 +729,6 @@
     \atfi at textattachfile@i{#1}{#2}%
 }
 \def\atfi at textattachfile@i#1#2#3{%
-    \ltx at IfUndefined{atfi at fileobj@#2}{%
-      \atfi at writefile{#2}%
-    }{%
-      % don't need duplicates
-    }%
     \atfi at setup{#1}%
     \atfi at embedfile{#2}%
     \atfi at set@appearance{%





More information about the latex3-commits mailing list.