pwmt / zathura

Document viewer
https://pwmt.org/projects/zathura
zlib License
2.12k stars 146 forks source link

More user friendly PDF attachment export #334

Open sebastinas opened 2 years ago

sebastinas commented 2 years ago

On GitLab by @castilma on May 16, 2022, 13:00


(I hope this is the right repo for pdf specific problems.)

I have a pdf with attachment and want to export it. :export and :export filename does not work (wrong number of arguments) Unfortunately, the man page or --help don't give me any instructions how to use the :export command. The web tells me it need to use :export attachment-{name} {file_name}. but what is the right {name}? There is no function to list all attachments.

And :export attachment-foo42 bar tells me it wrote the attachment 'attachment-foo42' to 'bar', even though there is no attachment with the name 'attachment-foo42' in that PDF file, and there is no new file with the name bar.

With firefox I got the name of the attachment, but even with the name, I cannot export it using zathura. You can test this yourself with this file(17MB). The attachment is called coverdisk1.img.

:export coverdisk1.img floppy.img yields Unknown attachment or image 'coverdisk1.img'..

:export attachment-coverdisk1.img floppy.img yields Wrote attachment 'attachment-coverdisk1.img' to '/home/mcd/Desktop/floppy.img'., but /home/mcd/Desktop/floppy.img does not exist.

The documentation needs to be clearer, there should be a way to list attachment names, and export should not say it dumped the attachment, if it didn't do so.

Or am I stupid?


zathura 0.4.9
girara 0.3.7 (runtime: 0.3.7)
(plugin) pdf-mupdf (0.3.8) (/usr/lib/zathura/libpdf-mupdf.so)
(plugin) cb (0.1.9) (/usr/lib/zathura/libcb.so)
(plugin) djvu (0.2.9) (/usr/lib/zathura/libdjvu.so)
(plugin) ps (0.2.7) (/usr/lib/zathura/libps.so)
```_
sebastinas commented 2 years ago

There are two issues here: 1) zathura-pdf-mupdf doesn't support attachments and 2) zathura doesn't tell you that the plugin does not support attachments. Otherwise: :export would offer all possible attachments to export as completion items.

sebastinas commented 2 years ago

On GitLab by @castilma on May 16, 2022, 13:25


Ok. I understand.

IMHO, the user should be told, that with the current plugin, attachments are not supported. Is it possible to add this notice?