Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe restore ability to save embedded files #1336

Closed
kjk opened this issue Dec 17, 2019 · 11 comments
Closed

Maybe restore ability to save embedded files #1336

kjk opened this issue Dec 17, 2019 · 11 comments

Comments

@kjk
Copy link
Member

kjk commented Dec 17, 2019

The implementation was convoluted so was removed for 3.2. Maybe re-implement later in a better way.

Removal commit for reference: fbb11d4

Reference: http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=6c30ec5c5da94052053197bfbe92ea6f2a1a86ee

@GitHubRulesOK
Copy link
Collaborator

I prefered having the option to extract swf audio etc as I could run them if totally trusted,
However as embeded actions such as media and portfolio objects are a risk Its perhaps best that I open any essential ones with acrobat anyway.

@SumatraPeter
Copy link

SumatraPeter commented Dec 18, 2019

I still use this feature (saving SWFs embedded in PDFs) on occasion, although not as much as I did back when I requested zeniko to add it (knowing very well that simple extraction ought to be far less risky than playing). Would really appreciate seeing it reimplemented better than ever.

@kjk
Copy link
Member Author

kjk commented Feb 10, 2020

dev note: this is LinkHandler::GotoLink, kindDestinationLaunchEmbedded. For pdf attachments, GetValue() is "file://" url.

Example of saving: http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=6c30ec5c5da94052053197bfbe92ea6f2a1a86ee

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Feb 10, 2020

@kjk
testing recent builds there is still a problem (or two) with "pdf embedded in pdf" (portfolios)
attached is sample attached to the forum post ,mentioned in #1361
acro9_10.08.01.pdf
its companion is in first post of "Portfolios.pdf no longer work in pre-release #1359 "
in both cases the first entry from bookmarks does not appear to open whilst others do

a secondary related issue ( which is part of #1361 )
in this case of portfolios where a pdf is opened without warning of extraction, the filename becomes appended with the page suffix it then does not behave like a normal opened pdf, that is external commands do not accept it as .pdf this could have an impact on internal file links between object files, highlighting and other annotations / bookmark links / vbkm handling etc.

My personal view is that ANY embedded object should simply be offered to be saved as a conventional file and not run (even if it is a pdf)

@ousia
Copy link

ousia commented Feb 10, 2020

@kjk & @GitHubRulesOK, although MuPDF implemented portfoliios (commercial name for collections), they stopped that approach, since it was more complex than they implemented.

According to PDF reference version 1.7, the definition reads:

(Optional; PDF 1.7) A collection dictionary that a conforming reader shall use to enhance the presentation of file attachments stored in the PDF document. (see 12.3.5, "Collections").

I think that implementing /FileAttachment annotations (double--clicking should open them) and /EmbeddedFiles (showing the name tree entries [and being able to double-click on them]) would be way better (and far easier) than trying to implement collections as such.

My personal view is that ANY embedded object should simply be offered to be saved as a conventional file and not run (even if it is a pdf).

I generate documents with attachments as a standard work routine. I need to check (since it is automated from data provided by users) what is being attached and sent in the document.

If I have to save all attached PDF documents (the only file format we attach) before opening them, I would have to go back to Acrobat Reader.

Sorry, since SumatraPDF is mainly a PDF document reader, double-clicking on any kind of link to a PDF document (such as an attachment annotation or an item in the list of embedded files) should open it.

Many thanks for your help.

@GitHubRulesOK
Copy link
Collaborator

@ousia
I fully understand the desire to automatically run nested pdf (that was my complaint #1359 that portfolios do not and cannot work correctly at present)

In my Adobe Acrobat there is by default enforced security NOT to run such files and there are supposed to be settings for me to over-ride such security measures, but they are troublesome. I guess that's why some users would want SumatraPDF to more easily Auto run those embedded files

I would suggest the simplest option is a save or run exactly the same as in a web browser.
If you need/desire a means to drop security to auto run then that could become a user setting

@ousia
Copy link

ousia commented Feb 10, 2020

If you need/desire a means to drop security to auto run then that could become a user setting.

@GitHubRulesOK,

I think it should be a configuration option what to do with embedded files:

  1. Open them.
  2. Save them.
  3. Block them.
  4. Prompt the user for action (any of the previous three).

Many thanks for your help.

@SumatraPeter
Copy link

We can have a sane default and add this as a setting to sumatrapdfrestrict.ini in case users really want to tweak the behavior.

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Mar 19, 2020

@kjk
Here is a sample from Forum post https://forum.sumatrapdfreader.org/t/sumatra-pdf-3-2-does-not-open-embedded-pdf/2770

main.pdf

Note that in Acrobat clicking the icon allows reading the embedded PDF and using the bookmarks it Scrolls & Zooms to the correct details location. Currently opening the extracted file it does not zoom and scroll corectly and for that matter as far as I can tell 3.1.2 did scroll but NOT zoom

@kjk
Copy link
Member Author

kjk commented May 31, 2020

Fixed in 38b702d

The rest is #1602

@kjk kjk closed this as completed May 31, 2020
@SumatraPeter
Copy link

Thanks, but all the PDFs with animations that I have contain SWFs/MP4s without any ToC entries, so this closure unfortunately doesn't help; still gotta wait for #1602 to be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants