Suggestion; pdf saved in Downloads folder

Asked by Imad Ahmed

Hello,

I read a lot of articles and I like to set my Firefox to open PDF files in qpdfview directly. That is working very well. However, It happen more frequently that I leave some PDF opened in qpdfview without saving them and of course they get lost when I clear Firefox history. I wish to suggest a new feature that qpdfview saves files under (maybe in ~/Downloads/qtemp) so that whenever Firefox exists and empty its cache and history one's does not lose the opened files in qpdfview. Currently all pdf files opened from Firefox directly into qpdfview are saved under /tmp folder. You cannot change this behavior in Firefox and I would think it is against security rules in Firefox. So I thought it might be a job that could be automated in qpdfview.

Best, Imad

Question information

Language:
English Edit question
Status:
Answered
For:
qpdfview Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Adam Reichold (adamreichold) said :
#1

Hello Imad,

thank you for your suggestion, however I am not comfortable with hard-coding such work-flow-specific behaviour into qpdfview as an application itself. However, I also do have to suggestions how to achieve such behaviour using more lightweight measures:

* Instead of qpdfview, select a shell script as the PDF file handler in Firefox that copies files from /tmp to the destination of your of choice before passing them on to qpdfivew. Of course, this will save all documents that you opened directly in qpdfview, not just the ones you leave open when closing it.

* So a more aggressive approach would be to use the first script to copy files to e.g. "~/Download/tmp/" and wrap qpdfview into a second script that scans its database for open tabs after closing the application and removes all files from said folder that were not open in qpdfview at the time of closing it. (The database is usually localted at "~/.local/share/data/qpdfview/qpdfview/database" and is a simple SQLite database that can be queried via a variety of command-line tools. Look for table "tabs_v2" column "filePath".)

Best regards, Adam.

Can you help with this problem?

Provide an answer of your own, or ask Imad Ahmed for more information if necessary.

To post a message you must log in.