Last Comment Bug 531606 - Gecko 1.9.x (Firefox 3.x / Seamonkey 2) truncates print job name to only 30 characters
: Gecko 1.9.x (Firefox 3.x / Seamonkey 2) truncates print job name to only 30 c...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Printing: Output (show other bugs)
: unspecified
: x86 Windows XP
: -- normal with 8 votes (vote)
: mozilla2.0b8
Assigned To: Masatoshi Kimura [:emk]
:
Mentors:
: 478080 505010 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-29 03:18 PST by Marcelo Bastos
Modified: 2011-04-17 15:28 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
.13-fixed
.16-fixed


Attachments
patch (677 bytes, patch)
2010-11-13 03:02 PST, Masatoshi Kimura [:emk]
roc: review+
dolske: approval2.0+
Details | Diff | Splinter Review
patch for 1.9.2 branch (693 bytes, patch)
2010-11-14 15:04 PST, Masatoshi Kimura [:emk]
christian: approval1.9.2.13+
Details | Diff | Splinter Review
patch for 1.9.1 branch (768 bytes, patch)
2010-11-14 15:04 PST, Masatoshi Kimura [:emk]
christian: approval1.9.1.16+
Details | Diff | Splinter Review

Description Marcelo Bastos 2009-11-29 03:18:42 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0

As detailed in this page: http://forums.mozillazine.org/viewtopic.php?f=9&t=736835 , newer versions of Mozilla products (Firefox 3 / Firefox 3.5 / Seamonkey 2), on printing, truncate print job names to 30 characters. Previous versions sent longer print job names (64 characters on FF 2).
This affects printing to PDF, where most utilities will use the job title as file name, and advanced printing utilities such as FinePrint, which use the print job name as page header.
This is annoying because frequently the useful part of the page title (excluding site name, etc.) is located beyond the 30-character point. 


Reproducible: Always

Steps to Reproduce:
1.Select a page with a long TITLE name.
2.Print (preferrably to a printer with a long queue, a stopped queue, or a virtual printer such as PDFcreator or FinePrint)
3.Check the print queue or the results from the virtual printer.
Actual Results:  
Job name is truncated, such as:
FF3 Truncating Print Web Pa...

Expected Results:  
Full job name, such as:
FF3 Truncating Print Web Page Job Title / Name • mozillaZine Forums
Comment 1 Johannes Weiser 2010-01-11 00:20:48 PST
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)

Problem persists as described above.
Comment 2 El Loco 2010-01-12 01:15:55 PST
Problem also easily repro'd with PrimoPDF, regardless of Windows OS (XP, Vista, Win7).

This isn't a sporadic bug - it occurs 100% of the time.  Time to change status to CONFIRMED!
Comment 3 Pietro 2010-01-20 01:11:57 PST
This is not exactly a bug, but it should be confirmed if it is the only way to get it solved. 

I have tried all freeware pdf printers around with Google Chrome and Firefox (pdfcreator, cutepdf, primopdf, dopdf etc...). Chrome allows full page title on filename, FF3 only allows some characters. FF2 behaved ok, too. 

Windows long filenames allow up to 255 characters, so this limitation in FF3 doesn´t make sense.
Comment 4 El Loco 2010-04-08 13:43:13 PDT
Bump?? Confirm?
Comment 5 RNicoletto 2010-04-14 07:56:39 PDT
Confirmed.
Comment 6 Kyle Rickey 2010-08-17 07:28:37 PDT
Still occurs in 4.0 Beta 3.....
Comment 7 Trevor Evans 2010-08-17 15:04:36 PDT
I can also confirm this occurs.
Comment 8 Pietro 2010-08-18 09:51:57 PDT
yep. so firefox 4 beta 3 made me sad. :-(
Comment 9 Sebastian 2010-08-27 02:51:48 PDT
yep. so firefox 4 beta _4_ made me also sad. :-(
The truncation is especially worse, when printing to pdf-driver, cause you have to manually edit the filename, even though the pagetitle is (in its full length) complete.
Comment 10 Pietro 2010-09-02 19:14:25 PDT
firefox 4 beta 5 too (WHY ARE YOU IGNORING THIS?) >:-/
Comment 11 Daniel Holbert [:dholbert] 2010-09-02 22:45:14 PDT
Please don't "bump" bugs or spam with biweekly "yup this affects another beta" comments.  This is a bug tracker, not a forum.  If someone takes the time to work on this issue, you'll see them post updates/patches here -- if you don't see that, then it shouldn't be any surprise that this issue remains.

Keep in mind that Mozilla is a free, open-source project, with limited resources.  Our bug tracker has plenty of issues like this that we'd love to address if/when we get the time, but we need to focus on the highest-priority bugs & features.  If this bug is important to you, you're free to work on it yourself (or find someone to work on it) -- that's the beauty of open-source -- and if you end up with a nice patch, it'll most likely be accepted and checked in.

Please also read https://bugzilla.mozilla.org/page.cgi?id=etiquette.html - in particular, points #1 and #2
Comment 12 Pietro 2010-09-17 07:17:30 PDT
Firefox Beta 6 seems to behave very well. Can someone confirm this?
Comment 13 RNicoletto 2010-09-20 08:43:55 PDT
(In reply to comment #12)
> Firefox Beta 6 seems to behave very well. Can someone confirm this?
Confirmed on today's build. 

P.S. As per comment 11 please don't bump this bug anymore.
Comment 14 Masatoshi Kimura [:emk] 2010-09-20 10:01:40 PDT
The maximum print job title length was 64 characters in legacy gfx.
http://mxr.mozilla.org/mozilla1.8/source/gfx/src/windows/nsDeviceContextWin.cpp#749
http://mxr.mozilla.org/mozilla1.8/ident?i=DOC_TITLE_LENGTH
Why Thebes changed the limit to 30 characters?
http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxWindowsSurface.cpp#200
Comment 15 Daniel Holbert [:dholbert] 2010-09-20 10:06:37 PDT
Looks like the 30-char change dates back to 2006, in this checkin:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/gfx/thebes/src/gfxWindowsSurface.cpp&rev=1.11#141

There's no bug number included with the checkin comment, though ("adding Thebes printing APIs"), so I'm not sure if/where this change was discussed.
Comment 16 Masatoshi Kimura [:emk] 2010-09-20 10:31:18 PDT
The maximum length of print job title is MAX_PATH (260) per MSKB.
http://support.microsoft.com/kb/281128
Comment 17 Pietro 2010-11-12 23:55:27 PST
|Looks like the 30-char change dates back to 2006, in this checkin:
|http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/gfx/thebes/src/gfxWindowsSurface.cpp&rev=1.11#141

So, I´m not a software professional, but isn´t that as simple as changing the value on line 141?

#define DOC_TITLE_LENGTH 260
Comment 18 Masatoshi Kimura [:emk] 2010-11-13 03:02:15 PST
Created attachment 490355 [details] [diff] [review]
patch

Other browsers can print document titles whose length is longer than 30 (and even 64) characters without truncation. So I believe this restirction is unreasonable.
I changed the value of DOC_TITLE_LENGTH to (MAX_PATH-1) because MSKB says:
> The StartDoc function validates its parameters by checking that the length
> of the lpszDocName and the lpszOutput members of the DOCINFO structure are
> *less than* MAX_PATH.
Comment 19 Masatoshi Kimura [:emk] 2010-11-14 14:47:41 PST
Comment on attachment 490355 [details] [diff] [review]
patch

This is safe enough for branches and fix the regression since Fx 3.0.
Comment 20 Masatoshi Kimura [:emk] 2010-11-14 15:04:08 PST
Created attachment 490487 [details] [diff] [review]
patch for 1.9.2 branch

Ah, trunk patch couldn't apply to the 1.9.2 branch because the file path had been changed.
Comment 21 Masatoshi Kimura [:emk] 2010-11-14 15:04:37 PST
Created attachment 490488 [details] [diff] [review]
patch for 1.9.1 branch
Comment 22 Pietro 2010-11-14 23:11:54 PST
keep up the good work, Mr. Kimura
Comment 24 Masatoshi Kimura [:emk] 2010-11-19 06:27:30 PST
Sorry, mid-air collided
Comment 25 Marcelo Bastos 2010-12-05 05:52:52 PST
Bug 47080 and Bug 505010 are duplicates of this and should therefore be closed too.
Comment 26 Marcelo Bastos 2010-12-05 05:55:02 PST
Sorry, I meant " Bug 478080 " in the comment above.
Comment 27 Masatoshi Kimura [:emk] 2010-12-05 06:58:40 PST
*** Bug 478080 has been marked as a duplicate of this bug. ***
Comment 28 Masatoshi Kimura [:emk] 2010-12-05 06:58:56 PST
*** Bug 505010 has been marked as a duplicate of this bug. ***
Comment 29 El Loco 2011-04-17 15:28:51 PDT
I just wanted to say, thank you thank you thank you!!  MAN that was a pain.  I had even gone so far as to download & TRY to compile the Mozilla source code (fail).  That saved me about 100+ hours & as I'm recovering from cubital tunnel surgery, wouldn't have been a good idea.

Again, thanks!!

Note You need to log in before you can comment on or make changes to this bug.