-
Hi everyone, I'm using Tectonic and attachfile2 to embed files into a PDF. While PNG files attach and extract correctly, other formats like .html, .txt, or .tex appear broken after extraction. The issue occurs even with very small files (e.g., a simple "Hello World" HTML file). What Happens:
What I Tried:
Does anyone know what could be causing this or how to work around it? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the description and diagnosis. I have seen this problem before: #935 (comment), but never dug deeper to find the problem. I think I have now managed to track the problem down and have an idea for a fix: #1261. @Albschu just for next time, it's often very useful to provide MWE with a bug report. In this case I believe compilation of your MWE would also show something like:
which points to the underlying problem. Also please, feel free to start issues directly, no need for discussion if you see what appears to be a problem, and also especially if it works with XeLaTeX and not with Tectonic. For future reference, this is the MWE I used: \documentclass{article}
\usepackage{attachfile2}
\usepackage{filecontents}
\begin{filecontents*}{example.txt}
Example
\end{filecontents*}
\begin{document}
Attached file: \attachfile{example.txt}
\end{document} Without patch in #1261 it shows the warning and the embedded file contents is empty, with the patch it correctly has the file contents. I tested with:
And inspected the PDF file for the attached file: mutool clean -dif test-1260.pdf test-1260.pdf
grep -a -B 2 -A 12 Embedded test-1260.pdf Before patch: After patch:
After patch:
|
Beta Was this translation helpful? Give feedback.
Thanks for the description and diagnosis. I have seen this problem before: #935 (comment), but never dug deeper to find the problem.
I think I have now managed to track the problem down and have an idea for a fix: #1261.
@Albschu just for next time, it's often very useful to provide MWE with a bug report. In this case I believe compilation of your MWE would also show something like:
which points to the underlying problem.
Also please, feel free to start issues directly, no need for discussion if you see what appears to be a problem, and also especially if it works with XeLaTeX and not with Tectonic.
For future referenc…