After upgrading from Firefox/Thunderbird 1.0.8 to 1.5.0.4, both programs try to print on Letter, though A4 is configured in CUPS, Firefox and Thunderbird. Printing from Adobe Reader or Epiphany (Gnome webbrowser) works without problems. The upstream bug seems to be this one: https://bugzilla.mozilla.org/show_bug.cgi?id=324635 . It was fixed here: http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsPostScriptObj.cpp&branch=&root=/cvsroot&subdir=mozilla/gfx/src/ps&command=DIFF_FRAMESET&rev1=1.127&rev2=1.128 That change also removes my printing problem. Though the patch is from 2006-04-29, it isn't included in the upstream source code of Firefox 1.5.0.4 and Thunderbird 1.5.0.4 which were released only a few days ago. The ebuilds for Firefox 1.0.8 and Thunderbird 1.0.8 are _not_ affected by this bug. It would be nice if Gentoo could add a patch to the Firefox/Thunderbird 1.5.x ebuilds until the bug is actually fixed in the upstream releases. Note that other Mozilla products may also be affected by this bug but I only tested with Firefox and Thunderbird. ---------- Probably it doesn't matter for this report, but here's the emerge --info output: Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-3.3.6, glibc-2.3.6-r3, 2.6.16-gentoo-r7 i686) ================================================================= System uname: 2.6.16-gentoo-r7 i686 AMD Athlon(tm) 64 Processor 3500+ Gentoo Base System version 1.6.14 ccache version 2.3 [disabled] dev-lang/python: 2.3.5-r2, 2.4.2 dev-python/pycrypto: [Not Present] dev-util/ccache: 2.3 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/ghostscript/*/lib /usr/share/ghostscript/7.07/lib /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig buildpkg distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentooftp:// ftp.tu-clausthal.de/pub/linux/gentoo/" LINGUAS="en de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage_overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X a52 aalib acl acpi alsa apache2 apm arts audiofile avi berkdb bitmap-fonts bonobo bzip2 cdr cli crypt cscope cups curl dbm dri dts dvd dvdr eds emboss encode esd evo exif expat fam ffmpeg flac foomaticdb fortran gd gdbm gif glut gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hbci idn imagemagick imap imlib innodb ipv6 isdnlog java jpeg kde lcms ldap libcaca libg++ libwww mad maildir mailwrapper mcal mikmod mime mmap mmx mng motif mozilla mp3 mpeg mysql ncurses nls nptl ofx ogg opengl oss pam pcre pda pdflib perl png ppds pppd python qt quicktime readline recode reflection sasl scanner sdl session sharedmem slang spell spl sqlite sse sse2 ssl svg svga sysvipc tcltk tcpd tetex tidy tiff truetype truetype-fonts type1-fonts udev unicode usb vhosts vorbis win32codecs xine xinerama xml xml2 xmms xorg xpm xv xvid zlib video_cards_radeon linguas_en linguas_de userland_GNU kernel_linux elibc_glibc" Unset: CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
Stefan, how have you applied the patch? Didn't work for me, when editing nsPostScriptObj.cpp manually.
Hello Erol, what means "didn't work for me"? What have you done in which order? :-) Indeed, getting Firefox emerged with the patch was somewhat of a hassle because I didn't get emerge to apply the patch (as usual from a diff) together with the other patches; my patch wasn't used at all. Eventually, I used the ebuild(1) command to unpack and patch the Firefox sources, patched manually and then continued to merge Firefox with the ebuild command. For some reason I don't know, the same approach didn't work with Thunderbird. ebuild always unpacked the source anew after I had applied my patch. :-/ - I finally "persuaded" Thunderbird by copying /usr/lib/mozilla-firefox/components/libgfxps.so over /usr/lib/mozilla-thunderbird/components/libgfxps.so . That's probably not the cleanest way to do it, but so far it has worked. ;-) If you are brave, you may instead edit the libgfxps.so file installed by "emerge thunderbird" with an "hex editor". That could work, because the fixed PostScript code is shorter than the former code. Just fill up with spaces until the buggy code is overwritten. (However, I don't know if there's a checksum or something like that will stop you from "patching" in this way.) You see, all this funny stuff lets me looking forward to see this bug being fixed. :-)
Erol, another, maybe easier way, may be to build Firefox from source with ./configure and make (_not_ make install) and copying the resulting libgfxps.so into the library directory I noted in my previous comment. Ditto for Thunderbird.
This is what I did: unpack source, edit nsPostScriptObj.cpp, packed again, rebuild digest and emerged again. But I haven't wrote the line "%%%%BeginFeature: *PageSize %s\n" I recompile now. Btw. the patch doesn't work because it is for another file, I think.
All didn't help. This is not my problem. Also found on another machine with a similar setup a 1.5.0.3 installation, with same problems but this source: // Tell the printer what size paper it should use fprintf(f, "/setpagedevice where\n" // Test for the feature "{ pop 1 dict\n" // Set up a dictionary " dup /PageSize [ %s %s ] put\n" // Paper dimensions " setpagedevice\n" // Install settings "} if\n", fpCString(NSTwipsToFloatPoints(paper_width)).get(), fpCString(NSTwipsToFloatPoints(paper_height)).get()); I think this is your solution and unfortunately not mine.
(In reply to comment #5) > All didn't help. This is not my problem. Also found on another machine with a > similar setup a 1.5.0.3 installation, with same problems but this source: > > // Tell the printer what size paper it should use > fprintf(f, > "/setpagedevice where\n" // Test for the feature > "{ pop 1 dict\n" // Set up a dictionary > " dup /PageSize [ %s %s ] put\n" // Paper dimensions > " setpagedevice\n" // Install settings > "} if\n", > fpCString(NSTwipsToFloatPoints(paper_width)).get(), > fpCString(NSTwipsToFloatPoints(paper_height)).get()); > > I think this is your solution and unfortunately not mine. I don't know if I understand you correctly. Are you sure that the actually running Firefox actually uses the source code you have listed? You can use strings(1) to peek into the library file /usr/lib/mozilla-firefox/components/libgfxps.so and see which PostScript header is used there. Anyway, I'll attach the _already patched_ file nsPostScriptObj.cpp which was indeed the fixed file upstream (see http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsPostScriptObj.cpp&branch=&root=/cvsroot&subdir=mozilla/gfx/src/ps&command=DIFF_FRAMESET&rev1=1.127&rev2=1.128 ).
Created attachment 89411 [details] Patched file (fixed PostScript header)
Yes, it does. Patched recompiled and so and so forth. The A4 problem disappeared, but not my problem. Nevertheless, I've fixed my problem too. If you're interested, I've had a section in my $HOME/.fonts.conf, rejecting scalable fonts, causing a ghostscript exception. Thanks.
I can meanwhile confirm, that on at least three machines the patch from firefox upstream has fixed the Letter vs A4 problem. Forget about my /didn't work/ comments as I've run into another unrelated problem there.
Is this still a problem with 1.5.0.9?
The bug is still present for www-client/mozilla-firefox/mozilla-firefox-1.5.0.9-r1.ebuild . The fix I mentioned/attached seems to work.
Could you please reopen if it's still an issue with 2.0.0.1?
Yes, the bug is still in Firefox 2.0.0.1.
(In reply to comment #13) > Yes, the bug is still in Firefox 2.0.0.1. > Please report this upstream.
Six years later I still suffer from these bug. Is there any chance that this bug will be solved?
BTW. I am using now firefox-20.0.
(In reply to comment #16) > BTW. I am using now firefox-20.0. If you are still having issues with this, you need to open a bug for cairo, we use system cairo so that is where the bug will lie.