hwhw/kindlepdfviewer — pull request #488 by tigran123 (2012-10-24 10:34:41+00:00)
Title: Extract attachments from PDF file via Alt-S

This PR contains the following commits:

1. Makes file info function more resilient, i.e. we shouldn't crash the whole KPV application just because we cannot discover the correct unpacked size of a zip file. This commit is unrelated to the main theme of this PR, so I sin against my own advocated rule, but commit is trivial enough to be forgiven this time :)

2. The Space command in FileChooser should actually re-read the directory and not just redraw the current (possibly stale) data. This is especially useful in two situations: a) You have extracted some attachments in the current directory b) You wish to see the current state of the Last Documents list.

3. Adds Alt-S command to PDFReader which invokes the external utility "extr" passing it the full pathname of the open PDF file and the current page number. The utility extracts all attachments on this page (if there are any) and saves them in the same directory as the PDF file. The file names given to attachments are decoded from within the PDF file itself, i.e. they are the same as the original file names of the files embedded in the PDF.

While you are reviewing this PR I'll write a little shell script which generates a PDF file with the given files embedded into it as attachments, as promised.