Bug 116269

Summary: JJ: Output name for PDF/PS file printer should default to filname.{pdf,ps} [make use of function KPrinter::setDocFileName() like KWord]
Product: [Unmaintained] kdeprint Reporter: Philipp Sternberg <philipp.sternberg>
Component: generalAssignee: KDEPrint Devel Mailinglist <kde-print-devel>
Status: CLOSED UNMAINTAINED    
Severity: wishlist CC: jlayt, kde-bugs
Priority: NOR    
Version: 0.0.1   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch to add proper filename and directory to kghostview

Description Philipp Sternberg 2005-11-13 22:23:12 UTC
Version:           0.0.1 (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Hi guys,

i'm just sitting here trying to convert some postscripts into pdfs by printing them out of kGhostView. When I want to print a certain file as a pdf i have to ajust the path and filename in the "Output file"-field everytime. Unfortunatly kprinter just remebers what name i printed the last file with. It would be nice if the "Output file"-field would default to the filname of the document to be printed, adding .ps or .pdf tags.
Let me give you an example: I open the file
/home/philipp/studies/business forecasting/time-series.html and i want to convert it to a pdf.
Therefore i click on file -> print. Now kprinter shows up.
When i choose "Print to File (PDF)" it would be great if the "Output file"-field would show /home/philipp/studies/business forecasting/time-series.html.pdf or
/home/philipp/studies/business forecasting/time-series.pdf automaticly.

Thanks for the great work kde-developers did so far....

regards

Philipp
Comment 1 Michael Goffioul 2005-11-14 13:44:26 UTC
This is something to be done from the application side by making use of the function KPrinter::setDocFileName(). For example, KWord uses it. I'd suggest to redirect the bug to KGhostView.

Michael.
Comment 2 Kurt Pfeifle 2007-01-13 01:52:51 UTC
I agree to that wish. We should have a configuration option "Use uniq names for special printers printing to files (PostScript and PDF", for cases where applications do *not* yet make use of the setDocFileName() function.

Something like "print-$(date +%Y-%M-%d-%H-%M-%S).ps"...
Comment 3 Kurt Pfeifle 2007-01-13 01:55:52 UTC
(changed $summary, made it a JJ:, previous $summary was "Output file for pdfs or postscript files should default to filname.pdf / filename.ps")
Comment 4 Maciej Pilichowski 2007-01-15 12:03:15 UTC
> We should have a configuration option "Use uniq names for special printers
> printing to files (PostScript and PDF", for cases where applications do
> *not* yet make use of the setDocFileName() function. 

a) redundant work
b) they ought to have it -- all in all we are talking about KDE-apps
c) Something like "print-$(date +%Y-%M-%d-%H-%M-%S).ps"... and when such thing would be implemented, several months later, it would be removed because all apps would use setDocFilename?

I assume Micheal is right (it is possible from app to set the corresponding name) so this would make this report invalid.
Comment 5 Kurt Pfeifle 2007-01-15 15:09:43 UTC
Yes, we are *mostly* talking about KDE apps.

But we also support printing from non-KDE apps. And we do support printing *any* files that are printable, simply by loading them into KPrinter. And trust me, there are a lot of non-DSC compliant PostScript files out there, which nevertheless print fine. It is just that they may have the "%%Title:" line missing in their PostScript header, and then KPrinter uses "(KDE Print System)" as the job title.

But it doesn't stop there: KDEPrint *has* to use a "title" parameter for every job it submits to CUPS. So if you have a central CUPS server in an office, a department or a university, you'll see hundreds of jobs all named the same: "(KDE Print System)". In-distinguishable...

Setting a uniq job name (if none is provided) is therefor good for more than one reason. We do already set a name (if none is provided) -- but it is not uniq.

"print-$(date +%Y-%M-%d-%H-%M-%S).ps" would of course not be used for all apps that know how to hand over the name (setDocName() function in KDE).

BTW, kpdf has already fixed that, see bug 122147. And KOffice fixed it, bug 139905.

We should submit bug reports to any KDE app that does not use setDocName for their printing via kprinter.
Comment 6 Kurt Pfeifle 2007-05-31 11:52:41 UTC
*** Bug 145872 has been marked as a duplicate of this bug. ***
Comment 7 arne anka 2007-05-31 12:07:43 UTC
well, i can atm not really see were 145872 duplicates this bug.

assume i would print several ps-files into one pdf:
kprinter a.ps b.ps c.ps
kprinter opens up with a filename "$HOME/print.pdf" and does so everytime i repeat those steps.
i would like kprinter to remember the last folder and ideally the alst filename, too, probabyl extended by a unique string (like ksnapshot or kooka do with the images created, which get a number).

so, where does that fit in this bug-report and how should that be implemented?

judging from the name, "setDocFilename" seems not appropriate to me (or ist setDocFilename able to provide an unique new name, based on the last one or a configurable default setting?).
Comment 8 Abdulla F Bubshait 2007-11-26 20:03:51 UTC
Created attachment 22207 [details]
Patch to add proper filename and directory to kghostview

I have patched kghostview to now add the feature of selecting the current
filename as the default name and directory to print to (will be appeneded with
PDF or PS)
Comment 9 John Layt 2009-01-03 01:20:38 UTC
KDEPrint in KDE3 is unmaintained and will have no more new features
implemented.  This request will never be implemented in KDEPrint as a result.  

In KDE4 the print dialog is provided by Qt and any issues will need to be raised directly with them.

The filename in Qt defaults to <docname>.<format>

Closing.