I have this code to attach files via dvipdfmx, and it works well:
\def\attach#1{%
\special{pdf:fstream @file (#1)}%
\special{pdf:ann bbox 0 0 10 10
<</Type /Annot /Subtype /FileAttachment
/FS <</Type /Filespec /F (#1.txt)
/EF <</F @file>> >> /Name /PushPin>>}}
\attach{\jobname.tex}
\bye
If I use navigator
package, I don't see the button to open the file:
\pdfoutput=1
\pdfcompresslevel=0
\input navigator
\embeddedfile{sourcecode}{test.tex}
A
\bye
This topic is relevant, but I could not make these examples to work in LuaTeX: Attaching files using plain TeX (pdfTeX)
How should the above dvipdfmx code be changed to work with luatex in pdf mode?
attachfile
,attachfile2
,embedfile
. – Heiko Oberdiek Dec 25 '15 at 7:06embedfile
also works with plain TeX. Also these packages contain the low level code for driver pdfTeX, which also can be used for LuaTeX. – Heiko Oberdiek Dec 25 '15 at 8:21embedfile-example-plain.tex
fromtexlive-latex-base-doc
package. It requires to use miniltx. This is not what is needed. Can it work without miniltx? Also, I did not see the button to open the attachment, whereas in my dvipdfmx example such button appears in the document. – Igor Liferenko Dec 25 '15 at 8:27(#1.txt)
by(\pdfescapestring{#1.txt})
. – Heiko Oberdiek Dec 28 '15 at 17:40