Bug 405709 - [Feature request] Printing to PDF - remember last used location
Summary: [Feature request] Printing to PDF - remember last used location
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: unspecified
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-21 07:50 UTC by Ovidiu-Florin BOGDAN
Modified: 2023-01-09 22:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ovidiu-Florin BOGDAN 2019-03-21 07:50:20 UTC
SUMMARY
When printing to PDF from an open document multiple times in the same session, on each print I get proposed to same it in the location of the original document.

A great improvement in workflow would be if Okular would remember the last location I printed to.

This Feature request has similarities or is connected with #400103 and #261787 both of which have the same spirit.


STEPS TO REPRODUCE
1. Open a PDF document
2. Print to PDF any page. Change proposed location (the location of the open document) and choose location A
3. Print to PDF any page. Change proposed location (the location of the open document) and choose location A
4. etc.

OBSERVED RESULT
The proposed location is always the location of the original file.

EXPECTED RESULT
Until the Okular session has ended, when printing to PDF Okular should suggest the last used location.

ADDITIONAL INFORMATION
My scenario: I receive passworded PDFs and I need to organize them in separate files without password. Saving As.. does not allow me to achieve this, only printing it to PDF does.
Comment 1 Ovidiu-Florin BOGDAN 2019-03-21 07:57:17 UTC
Also it would be useful to remember the last printer used. It always presents the default printer.
Comment 2 Michael Weghorn 2019-03-22 00:01:08 UTC
(In reply to Ovidiu-Florin BOGDAN from comment #0)
> OBSERVED RESULT
> The proposed location is always the location of the original file.
That's not exactly what I get. The suggested path in my case is the working directory + a filename appended (based on the document that is open), which is not necessarily the same location as that of the currently open file.

At a quick glance, it looks to me like the current handling is implemented in the Qt print dialog, more precisely the 'QUnixPrintWidget::QUnixPrintWidget' constructor, s.
https://code.qt.io/cgit/qt/qtbase.git/tree/src/printsupport/dialogs/qprintdialog_unix.cpp#n1412 .

(In reply to Ovidiu-Florin BOGDAN from comment #1)
> Also it would be useful to remember the last printer used. It always
> presents the default printer.
I'm quite sure this is also what the Qt print dialog does, nothing Okular-specific.


Kate e.g., which also uses the Qt print dialog, behaves the same way in my case.

Calling QPrinter::setOutputFileName should probably make the above code take up the path set this way (though I didn't have any closer look), but I'm unsure whether it makes sense to do this specifically just for Okular (and what else would have to be taken into account).
Comment 3 ikidd3123 2019-12-30 18:31:28 UTC
As above, though I would prefer if it just kept the last save location permanently, but I'd be happy with per-session even.
Comment 4 Nate Graham 2023-01-09 22:51:58 UTC
The dialog belongs to Qt and unfortunately any changes need to be made there. Feel free to report this at https://bugreports.qt.io.