Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 519218 - www-client/firefox - printing generates bad PDF output
Summary: www-client/firefox - printing generates bad PDF output
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-06 14:27 UTC by Jason Bucata
Modified: 2017-08-26 18:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Bad PDF output (crashes my printer) (mozilla2.pdf,49.51 KB, application/pdf)
2014-08-07 01:48 UTC, Jason Bucata
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Bucata 2014-08-06 14:27:41 UTC
I'm now no longer able to print PDFs.  I have a Konica-Minolta magicolor 1650EN (foo2zjs).  I've tracked the problem down to poppler; if I convert the PDF to PostScript via GhostScript (pdf2ps) I can get it to print, but if I use the poppler version (pdftops) it causes my printer to hang.  CUPS sends the job but the printer display just shows "Processing..." and never progresses from there, and I have to power-cycle it.

This previously worked until maybe within the past week or two.  I did a sizeable update (at least a few weeks' worth of updates) and somehow that caused the breakage.

CUPS will print a test page OK.  I can also print plain text from Vim.


Reproducible: Always

Steps to Reproduce:
1. Print a PDF (includes printing from Firefox, or lp from command line)
Comment 1 Jason Bucata 2014-08-06 14:28:18 UTC
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.10.49 x86_64)
=================================================================
System uname: Linux-3.10.49-x86_64-AMD_Phenom-tm-_II_X3_705e_Processor-with-gentoo-2.2
KiB Mem:     8167992 total,   2037092 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Wed, 06 Aug 2014 14:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.3.3
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo gentoo_local
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 AdobeFlash-10.3 AdobeFlash-11.x"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=amdfam10 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=amdfam10 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" http://gentoo.gossamerhost.com http://mirror.iawnet.sandia.gov/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/work"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/root/portage_overlay"
USE="3dnow 3dnowext X acl alsa amd64 bash-completion berkdb bzip2 cjk cli cracklib crypt cups cxx dbus dri exif fam flac gdbm gnutls gstreamer iconv jpeg libnotify lvm lzma mmx modules multilib ncurses nls nptl ogg opengl openmp pam pcre png readline session sse sse2 sse3 ssl svg tcpd tiff udev udisks unicode upower usb vim-syntax vorbis xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="lvm" ELIBC="glibc" FOO2ZJS_DEVICES="km2300" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en jp" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="hp3900" USERLAND="GNU" VIDEO_CARDS="r600 radeon vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC, USE_PYTHON
Comment 2 Jason Bucata 2014-08-06 14:53:52 UTC
I just tried printing a PDF I downloaded from my bank, as opposed to something that originated from Firefox.  It seems to work!  So it may be that Firefox is the culprit.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-08-06 19:59:12 UTC
(In reply to Jason Bucata from comment #2)
> I just tried printing a PDF I downloaded from my bank, as opposed to
> something that originated from Firefox.  It seems to work!  So it may be
> that Firefox is the culprit.

Er, so you don't even know where the bug is. Please seek support at our forums, mailing lists or IRC channels. Reopen this bug report when you find a bug.
Comment 4 Jason Bucata 2014-08-07 01:34:12 UTC
I'm not sure how I'm supposed to respond to that.  Firefox is generating bad PDFs.  And, poppler is poorly handling the bad PDFs that Firefox is creating, which may be a separate bug of its own.  There's definitely a bug here, at least in Firefox.

In no event should my printer be caused to hang because of a file I attempt to print.

What other information do you need from me?

I'll note that I was on Firefox 17.0.x until recently, so it's only recently that I switched to a release of Firefox with the built-in PDF viewing capability, in case that happens to be related to the printing code.
Comment 5 Jason Bucata 2014-08-07 01:48:57 UTC
Created attachment 382422 [details]
Bad PDF output (crashes my printer)

This was produced by Firefox 24.7.0.  It crashes my printer when attempting to print it.
Comment 6 Franz Trischberger 2014-08-07 05:25:02 UTC
Is this an issue with poppler in general or only with Qt4/5? Does printing from e.g. evince for without any issue?

Because I also have issues with printing since quite some time (1-2 years), but only using Qt4/5, for me evince works. When this started I did some search and found a bugreport for poppler. AFAIR it had to do with a bug in the PS Output Device. But somehow I completely lost track and don't find this specific report anymore.

Are you able to print e.g. 
http://www.finanzamt.bayern.de/Informationen/Formulare/Steuererklaerung/Einkommensteuer/2013/Anleitung_Anlage_AUS_2013.pdf
(I can't and that caused me quite some trouble...)
Comment 7 Jory A. Pratt gentoo-dev 2014-08-07 11:29:24 UTC
(In reply to Jason Bucata from comment #5)
> Created attachment 382422 [details]
> Bad PDF output (crashes my printer)
> 
> This was produced by Firefox 24.7.0.  It crashes my printer when attempting
> to print it.

This is generated using cairo, has nothing to do with firefox.
Comment 8 Jason Bucata 2014-08-07 13:58:10 UTC
(In reply to Franz Fellner from comment #6)
> Are you able to print e.g. 
> http://www.finanzamt.bayern.de/Informationen/Formulare/Steuererklaerung/
> Einkommensteuer/2013/Anleitung_Anlage_AUS_2013.pdf
> (I can't and that caused me quite some trouble...)

I downloaded it and tried to print it.  I got an error page from my printer complaining about bad PostScript.

So the PDF might be bad, or whatever, but at least it doesn't cause my printer to hang trying to print it.
Comment 9 James Cloos 2014-08-17 18:09:10 UTC
The pdf attached has transparency.

Does the pdf from your bank?

(I use »mupdfclean -d« to see the details of a pdf; run that on the bank’s pdf and grep(1) for Transparency; you mayneed grep’s -a switch.)

What do you get from running pdftops on the ’zilla pdf?

Does it render the whole page to a bitmap?

(Poppler master doesn’t.)
Comment 10 Jason Bucata 2014-08-23 00:09:22 UTC
(In reply to James Cloos from comment #9)
> (I use »mupdfclean -d« to see the details of a pdf; run that on the bank’s
> pdf and grep(1) for Transparency; you mayneed grep’s -a switch.)

I was able to emerge "mupdf" and figure it out how to use mutool (there was no "mupdfclean" installed).  If I'm using it right, it does appear that what I uploaded used transparency, and the credit union statement didn't.

I found another credit card statement that's causing trouble.  It manages to print the first page but for the second page it just hangs.  That PDF doesn't use transparency either.

> What do you get from running pdftops on the ’zilla pdf?
> 
> Does it render the whole page to a bitmap?
> 
> (Poppler master doesn’t.)

How could I tell that?
Comment 11 Jason Bucata 2014-08-23 00:11:42 UTC
It looks like I was wrong before: This printer doesn't use foo2zjs.  It claims to be PostScript-3 compatible and also PCL-6.  My previous Konica-Minolta printer used foo2zjs, and I somehow got the information that this one did as well, but of course now that I try to find that (erroneous) on the Internet again, I can't locate it.

So at some level the problem is generating PostScript (or PCL??) that this printer is choking on.
Comment 12 Jason Bucata 2014-08-23 01:28:56 UTC
I got inspired to start digging around in the CUPS configuration on how to make it send PCL instead of PostScript to the printer.  I was able to edit the PPD to change the CUPS filters to emit PCL instead, and I'm suddenly able to print both from Firefox, and also that credit card statement I separately found to be giving me trouble.

It does seem strange, that something in the Poppler or CUPS pipeline is now creating PostScript files that my printer chokes on, since it all used to work fine.  So I'm willing and happy to keep trying to diagnose this, if somebody else can tell me what things to try.

But if nobody else wants to solve the mystery, for my own needs I'm calling the problem solved.
Comment 13 Jory A. Pratt gentoo-dev 2017-08-26 17:56:59 UTC
If you feel I have closed your bug and it is still a current issue, please reopen and update it completely. We will not work bugs that have no ebuild in tree any longer or can not be reproduced with a current system.

Thank You for your support and understanding
The Mozilla Team