Bug 354538

Summary: Make attached files able to be directly open
Product: [Applications] okular Reporter: Denis Bitouzé <dbitouze>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: wishlist CC: aacid
Priority: NOR    
Version First Reported In: 0.20.3   
Target Milestone: ---   
Platform: Mageia RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Here is an example of a PDF file, `bar.pdf`, to which the `foo.tex` file is attached.
Attachment that illustrates comment #6

Description Denis Bitouzé 2015-10-29 08:11:11 UTC
When a third file (e.g. a `.tex` file) is attached to a PDF file, with a link supposed to point to this third file, okular only offers to save it (see https://bugs.kde.org/show_bug.cgi?id=354268).

It could be nice to make the user able to directly open this third file after clicking on the link (possibly with a warning about security), as already provided by Adobe Reader or Evince.

Reproducible: Always
Comment 1 Denis Bitouzé 2015-10-29 08:12:54 UTC
Created attachment 95199 [details]
Here is an example of a PDF file, `bar.pdf`, to which the `foo.tex` file is attached.
Comment 2 Christoph Feck 2015-10-30 00:07:25 UTC
Duplicate of bug 295567?
Comment 3 Denis Bitouzé 2015-10-30 09:10:43 UTC
Indeed, more or less duplicate of this bug if my comment on this page is taken
in account. Moreover, because the example files provided by the OP are not
available anymore, not easy to confirm it is really the exactly the same bug.

From a LaTeX point of view, there are differences between "embedded" and
"attached" files, the latter provided by `attach2` package that has the feature
the document's author can create an hyperlink pointing to the attached file. In
such a case, the person who's reading the document can reasonably expect to be
able to directly open the file, as when surfing on Internet with its browser and
clicking on hyperlinks pointing to files: depending on the browser's
configuration, the file will be only downloaded or directly open.
Comment 4 Albert Astals Cid 2015-11-02 21:50:35 UTC
Christoph, no they are two different if albeit similar things, should be fixed or not fixed together.
Comment 5 Christoph Feck 2015-11-04 20:58:05 UTC
I updated the link from bug 295567, but Albert already confirmed the issues are different.
Comment 6 Denis Bitouzé 2016-06-15 15:01:57 UTC
>From a LaTeX point of view, there are differences between "embedded" and "attached" files

Concerning this difference, note that Evince is able to deal with both of them, whereas Okular can deal only with embedded files, as pointed out by the following file (to be compiled with PDFLaTeX: I'll post the resulting PDF later):

\begin{filecontents}{attached-file.txt}
Hi! I'm attached.
\end{filecontents}
%
\begin{filecontents}{embedded-file.txt}
Hi! I'm embedded.
\end{filecontents}
%
\documentclass{article}
\usepackage{attachfile2}
\usepackage{embedfile}
\begin{document}
\textattachfile[color= 0 0 0]{attached-file.txt}{Clic here to open the attached file \texttt{attached-file.txt}}
\embedfile{embedded-file.txt}
\end{document}
Comment 7 Denis Bitouzé 2016-06-15 15:04:29 UTC
Created attachment 99519 [details]
Attachment that illustrates comment #6