Bug 277801

Summary: append ".pdf" to filename when printing to file as pdf
Product: [Applications] okular Reporter: fred <fdruec1>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 0.12.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description fred 2011-07-14 22:10:14 UTC
Version:           0.12.5 (using Devel) 
OS:                Linux

If you print to file with the pdf printer, you only succeed when your filename has a suffix of "pdf", certainly this is true if your pdf is an image file with no accompanying text (this what you get when a scanner generates pdf files for you).  For example, let's say:

You print to the file named "page_one" using the pdf printer.  It fails

You print to the file named "page_two" using the pdf printer.  It succeeds

I'm on version 4.6.5, it's not available as a tracker choice yet.

Similar thing happens for "ps".

If you do this in kwrite, it's no problem.  Tell it to print to file, "foo" and you'll get an output file "foo", and you can open it in a document view, such as okular itself, and it'll look like it should.

Reproducible: Always

Steps to Reproduce:
1) open pdf

2) print to file using the pdf printer, omit the ".pdf" file extension

Actual Results:  
Error dialogue box appears, no file is produced.

Expected Results:  
I'd expect either to get a either a pdf file with no name extension, like kwrite produces, or get the .pdf automatically appended.  The former behavior is "more unix", but I consider appending .pdf acceptable behavior as well, simply failing is, though, is bad.

I'm on version 4.6.5, it's not available as a tracker choice yet.

Arguably, this is a feature request, but since the failure is so damned un-informative as to it's nature (I naturally assumed this was a CUPS problem, spent way too long tracking down the actual cause), I think it *is* a bug, and honestly, it's probably almost as easy to auto-append the ".pdf" or ".ps" to the files as it is to t write an error message that informs the user what's really going on.
Comment 1 fred 2011-07-14 22:12:02 UTC
sorry, failure in my typing:

You print to the file named "page_one" using the pdf printer.  It fails

You print to the file named "page_two" using the pdf printer.  It succeeds

should read:

You print to the file named "page_one" using the pdf printer.  It fails

You print to the file named "page_one.pdf" using the pdf printer.  It succeeds
Comment 2 Albert Astals Cid 2011-08-11 15:17:29 UTC
Git commit d3ebf089c47ccdd3a8afc83d2a7578fb9ec0f52b by Albert Astals Cid.
Committed on 11/08/2011 at 17:17.
Pushed by aacid into branch 'master'.

Do not rely on extension but on output format for conversion

BUGS: 277801

M  +2    -2    core/fileprinter.cpp

http://commits.kde.org/okular/d3ebf089c47ccdd3a8afc83d2a7578fb9ec0f52b
Comment 3 Albert Astals Cid 2011-08-11 15:17:55 UTC
Git commit e7bb1e381822fb4c021bdf49832d3331ddc14d84 by Albert Astals Cid.
Committed on 11/08/2011 at 17:17.
Pushed by aacid into branch '4.7'.

Do not rely on extension but on output format for conversion

BUGS: 277801
(cherry picked from commit d3ebf089c47ccdd3a8afc83d2a7578fb9ec0f52b)

M  +2    -2    core/fileprinter.cpp

http://commits.kde.org/okular/e7bb1e381822fb4c021bdf49832d3331ddc14d84