Bug 326617 - Okular fails to print document with a long title
Summary: Okular fails to print document with a long title
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.16.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-25 09:28 UTC by Olivier Diotte
Modified: 2013-12-15 22:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.5


Attachments
Videotron generic contract file (136.15 KB, application/pdf)
2013-10-25 17:39 UTC, Olivier Diotte
Details
the said file (498.23 KB, application/pdf)
2013-10-25 19:19 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Diotte 2013-10-25 09:28:36 UTC
As noted in the downstream bug report (here: https://bugs.gentoo.org/show_bug.cgi?id=485538 )
Both okular-4.10.5 and okular-4.11.1 fail to print the attached PDF. The following error appears in the terminal okular is launched from: "lpr: Bad job-name value: Name too long."

See the PDF attached there.

P.S.: 4.10.5 is the ebuild version for Okular 0.16.5. I will upgrade to 4.11.1 again tonight and report on what version that is.

Reproducible: Always

Steps to Reproduce:
1. Open PDF linked in other bug report
2. Try to print
Actual Results:  
The document doesn't print and an error is printed to the terminal that launched okular

Expected Results:  
The document prints
Comment 1 Olivier Diotte 2013-10-25 17:39:58 UTC
Created attachment 83115 [details]
Videotron generic contract file

Testing if uploaded files get f'ed up here too.
Comment 2 Olivier Diotte 2013-10-25 17:41:32 UTC
Alright, please download the PDF file from here, I do not know why, but Gentoo's bugtracker messes the file when I upload it.
Comment 3 Olivier Diotte 2013-10-25 17:55:35 UTC
Tested again with 4.11.2 (Okular 0.17.2), I still get the same error.
Comment 4 Albert Astals Cid 2013-10-25 19:19:20 UTC
Ok, i'm going to need your help here, please get the file i will be attaching and edit it with a editor that doesn't destroy it (kwrite/kate won't work) (vi, nano seem to work) and change the line that says

/Title (Les modalités et conditions de la présente Annexe s<90>applique à chaque contrat de service de télécommunications conclu par le Client, soit les contrats de services de télédistribution, Internet, de téléphonie par câble et de téléphonie sans fil)

to make it shorter by one character each time until you stop getting the error.

Can you do that for us?
Comment 5 Albert Astals Cid 2013-10-25 19:19:46 UTC
Created attachment 83116 [details]
the said file
Comment 6 Olivier Diotte 2013-10-25 20:42:30 UTC
Albert,

I do not know if it was because you were puzzled that the title was only one character too long, but that's what it is (I thought I would save time by cutting the title dichotomically, boy was I wrong). Removing a single letter (shortening 'fil' to 'fi') doesn't give the error. Appending a letter to that file makes okular give the error again.

TL;DR: One character less makes it work
Comment 7 Olivier Diotte 2013-10-25 20:43:23 UTC
s/Appending a letter to that file/Appending a letter to the title of that file/
Comment 8 Albert Astals Cid 2013-10-26 10:57:52 UTC
So, just to be sure, can you confirm that deleting one letter from the title makes it work? If so i'll try to make sure that when we create the job name it's not longer than that amount of characters.
Comment 9 Olivier Diotte 2013-10-26 14:07:48 UTC
Yes, deleting one letter from the title makes it work.
Comment 10 Albert Astals Cid 2013-10-27 10:02:18 UTC
Info provided, back to unconfirmed pending i go back to somewhere i have a printer and can try to reproduce myself.
Comment 11 Albert Astals Cid 2013-12-15 22:46:56 UTC
Git commit 5dfffec650c03a13684089d9e6c0a223adf16ce0 by Albert Astals Cid.
Committed on 15/12/2013 at 22:44.
Pushed by aacid into branch 'KDE/4.11'.

Make sure string passed to -J is no more than 255 bytes

lpr refuses to print referencing http://tools.ietf.org/search/rfc2911#section-4.1.2
Unfortunately cutting at 255 bytes may mess up the end of the name, but oh well
FIXED-IN: 4.11.5

M  +2    -1    core/fileprinter.cpp

http://commits.kde.org/okular/5dfffec650c03a13684089d9e6c0a223adf16ce0