Printing PDFs with images is hideously slow on HP LaserJet 3030 MFP

Bug #1095498 reported by jimav
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Printing anything with graphics from Firefix (such as a Google Maps page), or a PDF file containing graphics, takes a ridiculously long time to print, often several minutes per page. This is with a directly-attached USB postscript printer (an HP 3030 mfp).

The exact same content prints in only 2 seconds when printed from Windows 7 running in a VM, to the same printer via an independent print server (avoiding CUPS in the Ubuntu host).

NOTE: If the page in Firefox is first printed "to file" and PDF is selected, the very long delay happens when printing the resulting PDF using the "lpr" command. If, instead, "print to file" is done from Firefox and Postscript is selected, the resulting .ps file prints much faster (still 10x slower than printing from Windows 7, but much faster than printing the equivalent PDF).

So there must be something bogus in how CUPS handles PDF files containging images.

STEPS TO REPRODUCE:

1. Visit https://maps.google.com/ in Firefox on Ubuntu
2. Search for "San Francisco" and click the print icon (in the left bar near the top).
3. A printable map is displayed; hit ^P to print it to a postscript printer
(1-2 minute delay before the page prints)

Do exactly the same on a Windows 7 system and printing starts in about 2 seconds.

Alternatively, try printing the attached PDF and PS files. The PDF is hideously slow (minutes), but the PS is only slow (about 10 seconds to print on my system). Compared to 2 seconds when printed from Windows. All the same content.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cups 1.5.3-0ubuntu4
ProcVersionSignature: Ubuntu 3.2.0-29.46-generic 3.2.24
Uname: Linux 3.2.0-29-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.0.1-0ubuntu15
Architecture: amd64
Date: Wed Jan 2 17:14:16 2013
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
Lpstat:
 device for hp-LaserJet-3030: hp:/usb/hp_LaserJet_3030?serial=00CNBM066305
 device for hp-LaserJet-3030-Fax: hpfax:/usb/hp_LaserJet_3030?serial=00CNBM066305
 device for PDF: cups-pdf:/
MachineType: System manufacturer System Product Name
MarkForUpload: True
Papersize: letter
PpdFiles:
 hp-LaserJet-3030: HP LaserJet 3020 3030 Postscript (recommended)
 PDF: Generic CUPS-PDF Printer
 hp-LaserJet-3030-Fax: HP Fax hpcups
ProcEnviron:
 LANGUAGE=
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-29-generic root=UUID=8aaca318-f079-4a4f-95c0-735aa54bed2d ro quiet splash vt.handoff=7
SourcePackage: cups
UpgradeStatus: Upgraded to precise on 2012-08-10 (145 days ago)
dmi.bios.date: 09/21/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1408
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: P6T
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1408:bd09/21/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP6T:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
jimav (james-avera) wrote :
Revision history for this message
jimav (james-avera) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cups (Ubuntu):
status: New → Confirmed
Revision history for this message
Tobias Bergemann (jtbergemann) wrote :

I had the same problem with my HP LaserJet 1300. Changing the printer driver from the preselected "Foomatic" one to the "CUPS+Gutenprint" one solved this problem for me. See also http://www.iheartubuntu.com/2011/04/ubuntu-pdf-printing-is-slow.html.

Revision history for this message
jimav (james-avera) wrote :

Setting project to "foomatic-filters", as the problem seems related to foomatic or something it calls.

That might not be the right project; someone please change it if you know how to better target this bug to the people who can fix it.

P.S. I'm suspicious of how foomatic calls ghostscript to interpret pdf & postscript files in software and re-generate new postscript for the printer. It sounds redundant but there must be a reason for it.

Revision history for this message
madbiologist (me-again) wrote :

jimav - This should be fixed in Ubuntu 13.10 "Saucy Salamander" with libcairo2 1.12.16-0ubuntu2. Can you confirm?

Changed in cups (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
jimav (james-avera) wrote :

DIS-confirmed.

Using the foomatic/Postscript driver, text files and the CUPS test page printed correctly, but when I tried to print a Google Maps map of San Francisco (per the original bug description), a job was sent to the printer which never printed. The activity light flashed for about 10 seconds while the printer displayed "Printing document" (as is normal), then the printer returned to idle state without printing anything.

The exact same map prints correctly using either the "CUPS+Gutenprint V5.29" driver or the "HP LaserJet 3030 pcl3 hpcups 3.13.3" driver.

The job-which-prints-nothing is odd. It is as if the driver sent corrupted Postscript, e.g. with no "showpage" at the end, or else encoded the image in a way which silently exceeded the memory on my older printer (an HP LaserJet 3030 mfp). Normally the printer displays an error message on its panel if memory is exhausted, and you have to press a button to continue.

Revision history for this message
jimav (james-avera) wrote :

Forgot to add: I upgraded from 13.04 to 13.10, and I think I have the fix mentioned in comment #6

+ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy
+ uname -a
Linux lxjima 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
+ dpkg-query -W *libcairo2*
libcairo2:amd64 1.12.16-0ubuntu2
libcairo2:i386 1.12.16-0ubuntu2

Revision history for this message
jimav (james-avera) wrote :

I'm attaching a pdf which displays the symptoms described in comment #7 when using the "lpr" command.

lpr -P <queue using foomatic/postscript> googlemap.pdf # printer light flashes busy, then nothing happens
lpr -P <queue using gutenprint> googlemap.pdf # works. fast.
lpr -P <queue using HP pcl3 driver> googlemap.pdf # works. fast.

madbiologist (me-again)
Changed in cups (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

jimav, please follow the instructions of the section "PostScript (PDF) printer chokes on the PostScript (PDF) coming from Ubuntu" on https://wiki.ubuntu.com/DebuggingPrintingProblems.

Changed in cups (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
jimav (james-avera) wrote :

The CUPS error_log file was empty.

I captured data sent to the printer (file attached). If I submit this postscript file as an original print job, the same symptoms occur -- the printer light flashes for a while and then the printer returns to idle without printing anything.

The captured postscript file begins with "%!PS-Adobe-3.0", but my printer (an HP 3030) does not support postscript level 3!
Why is level 3 being generated? There must be something wrong with the foomatic config files describing the hp 3030 printer. I don't know where those original files are, but somebody who does should be able to check whether they say the printer is level 2 only or not.

The file /etc/cups/ppd/<queuename>.ppd on my systemdoes contain *LanguageLevel: "3"

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you try the following:

1. Edit your /etc/cups/ppd/<queuename>.ppd replacing '*LanguageLevel: "3"' by '*LanguageLevel: "2"', then restart CUPS running the command

sudo restart cups

in a terminal window. Try to print again. Does printing work for you now?

2. Follow the instructions of step (11) in the section "PostScript (PDF) printer chokes on the PostScript (PDF) coming from Ubuntu" on https://wiki.ubuntu.com/DebuggingPrintingProblems. Does printing work for you now? Do not undo this change now.

3. Undo step (1), setting the language level in the PPD file back to "3". Do not forget to restart CUPS. Does printing work for you now?

Revision history for this message
jimav (james-avera) wrote :

Yes, setting LanguageLevel: "2" fixed the problem! And the image printed very quickly. Thank you so much for fixing the original speed problem.

I'm guessing the PS level 3 mis-config was there all along, but can't easily confirm that. Shall I file a separate bugrep on the Postscript level problem?

Revision history for this message
jimav (james-avera) wrote :

I'm really sorry, my previous post comment #13) was a mistake. The problem is not fixed after all, and with the .ppd file changed to have LanguageLevel: "2" the driver still generates a PS Level 3 data for the printer (I think I used the wrong queue name before and unintentionally used a pcl driver instead of foomatic/Postscript).

I used the technique described in https://wiki.ubuntu.com/DebuggingPrintingProblems to capture the data sent to the printer, and it is still PS level 3. Here's what I did:

1. Set "FileDevice yes" in /etc/cups/cups-files.conf
2. lpadmin -p test2 -E -v file:/tmp/printout -P /etc/cups/ppd/HP3030_Postscript.ppd
      # HP3030_Postscript is the name of my foomatic/Postscript queue
3. Edited /etc/cups/ppd/test2.ppd to say *LanguageLevel: "2"
4. restart cups
5. rm -f /tmp/printout
6. lpr -P test2 googlemap.pdf
7. vim /tmp/printout

The resulting file still begins with %!PS-Adobe-3.0

Doing lpadmin -p test2 -o pdftops-renderer-default=pdftops; restart cups
makes no difference, I still get %!PS-Adobe-3.0

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Even that after

lpadmin -p test2 -o pdftops-renderer-default=pdftops

your files still give "%!PS-Adobe-3.0" please try to print these files (you must do the "lpadmin -p ... -o pdftops-renderer-default=pdftops" on a print queue which actually prints on your printer). The files are then generated by an alternative program and work perhaps better on HP's printers.

Revision history for this message
jimav (james-avera) wrote :

Now printing the googlemap.pdf test file causes an "out of memory" error on the printer after 20-30 seconds. That's an improvement over just silently doing nothing at all, I guess.

This is after doing:
  lpadmin -p HP3030_Postscript -o pdftops-renderer-default=pdftops # the real printer queue
  restart cups

I also tried
   pdf2ps -dLanguageLevel=2 googlemap.pdf test.ps
The resulting file begins with %!PS-Adobe-3.0 despite the -dLanguageLevel=2 option

I then tried
   lpr -oraw test.ps

and the the printer stalled for a looooooong time (at least 3 minutes) with the light blinking, then printed a completely blank page.

Again, this same googlemap.pdf prints in 2-3 seconds using gutenprint or pcl3 drivers.

Revision history for this message
jimav (james-avera) wrote :

The %!PS-Adobe-3.0 is probably correct. It refers to the *Document Structuring Convention* version, not the Postscript languageLevel assumed by the script within.

DSC 3.0 was introduced in Sept. 1992, whereas Postscript language level 3 appeared in 1997.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Probably your printer has not enough memory to be used as an allround PostScript printer (like the HP LaserJet 1200/1300). The windows drivers most probably send PCL 5e data to the printer, like Gutenprint, HPLIP/HPIJS/hpcups, ... do. So I recommend you to set up this printer in PCL mode, best with an hpcups driver.

Moving to system-config-printer, fddor adding a new quirk rule to select a PCL driver for this printer.

affects: cups (Ubuntu) → system-config-printer (Ubuntu)
summary: - Printing PDFs with images is hideously slow
+ Printing PDFs with images is hideously slow on HP LaserJet 3030 MFP
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please replace your /etc/cupshelpers/preferreddrivers.xml file by the attached one and try to set up your printer with system-config-printer again. Now it should get set up with a PCL driver and so it should get much faster. Please tell whether this works for you.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for system-config-printer (Ubuntu) because there has been no activity for 60 days.]

Changed in system-config-printer (Ubuntu):
status: Incomplete → Expired
Revision history for this message
caspar_wrede (caspar-wrede) wrote :

This bug still exists. I have a LaserJer P2015dn and am printing over the network. Please reopen.

Revision history for this message
jimav (james-avera) wrote : Re: [Bug 1095498] Re: Printing PDFs with images is hideously slow on HP LaserJet 3030 MFP

On 08/06/2014 01:46 PM, caspar_wrede wrote:
> This bug still exists. I have a LaserJer P2015dn and am printing over
> the network. Please reopen.
>
I gave up waiting (or trying to track) a fix for this, and eventually
installed the PCL driver instead of the Postscript one. It seems to work
okay. The CUPS config uses "Gutenprint" instead of "Foomatic", which
might actually be why it works now.

Best of luck!

-Jim

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

jimav,

Can you confirm that your printer is set up automatically with the hpcups driver and is working using the preferreddrivers.xml file from comment #19:

<!-- Use hpcups instead of PostScript with HP LaserJet 302x/303x
  as they do not come with enough memory for
  PostScript (Ubuntu bug #1095498). -->
<printer>
  <make-and-model match="(Hewlett-Packard|HP) LaserJet 30[23]\d.*"/>
  <drivers>
    <drivertype>hpcups</drivertype>
  </drivers>
  <avoid>
    <drivertype>*-postscript</drivertype>
    <drivertype>manufacturer*</drivertype>
  </avoid>
</printer>

If so we can include this fix so your printer gets set up with the hpcups driver in future Ubuntu releases.

Thanks,
Pascal

Revision history for this message
Renne (renne) wrote :

I have the same slow printing problem with a Dell 3115cn on 14.04 LTS Desktop 64-bit. A 180-pages printjob with some coloured screenshots (Samsung TV manual) needs 2-3 hours on Ubuntu but only 15 minutes on Windows7 (WSD). The same problem occurs when I convert the PDF to PS with "pdftops" and copy it into the printers ramdisk via FTP. pdftops bloats the 6 MByte PDF to 100 MByte (PS Level 2) or 200 MByte (PS Level 3).

So the problem is definitely the broken Postscript conversion and not CUPS/drivers.

Revision history for this message
Renne (renne) wrote :

By the way, the Dell 3115cn has 1152 MByte RAM. So it's definitely not a memory problem.

Revision history for this message
Renne (renne) wrote :

I've just installed Acrobat Reader 9 (Arrrgh!).
When I open the PDF documents with Acrobat Reader 9 the 3115cn runs like hell and the quality is even better.
It seems i have to use the Big Bug to print my PDFs.

Obviously the PDF-to-PS conversion used by CUPS on Ubuntu (pdftops) is a mess.

Revision history for this message
Renne (renne) wrote :

After replacing /usr/lib/cups/filter/pdftops with the shell-script

--------------------------------------------------------------------------------------------------------
#!/bin/sh

/usr/bin/acroread -toPostScript -optimizeForSpeed -level3 -expand -size a4
--------------------------------------------------------------------------------------------------------

I've lost duplex printing but it's very fast and high-quality!

Renne (renne)
Changed in system-config-printer (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Renne (renne) wrote :

I ran some tests:

/usr/bin/acroread -toPostScript -level2 -pairs [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_acroread-9.5.5_level2.ps
/usr/bin/acroread -toPostScript -level3 -pairs [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_acroread-9.5.5_level3.ps
/usr/bin/pdf2ps -dLanguageLevel=1 [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdf2ps-9.10____level1.ps
/usr/bin/pdf2ps -dLanguageLevel=2 [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdf2ps-9.10____level2.ps
/usr/bin/pdf2ps -dLanguageLevel=3 [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdf2ps-9.10____level3.ps
/usr/bin/pdftops -level1 [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level1.ps
/usr/bin/pdftops -level1sep [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level1sep.ps
/usr/bin/pdftops -level2 [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level2.ps
/usr/bin/pdftops -level2sep [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level2sep.ps
/usr/bin/pdftops -level3 [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level3.ps
/usr/bin/pdftops -level3sep [DEU]X14DVBEUH-1.113-0626.pdf [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level3sep.ps

The results of pdftops and pdf2ps (Ghostscript) are far away from any usability:

5,9M [DEU]X14DVBEUH-1.113-0626.pdf
52M [DEU]X14DVBEUH-1.113-0626.pdf_acroread-9.5.5_level2.ps
32M [DEU]X14DVBEUH-1.113-0626.pdf_acroread-9.5.5_level3.ps
265M [DEU]X14DVBEUH-1.113-0626.pdf_pdf2ps-9.10____level1.ps
265M [DEU]X14DVBEUH-1.113-0626.pdf_pdf2ps-9.10____level2.ps
265M [DEU]X14DVBEUH-1.113-0626.pdf_pdf2ps-9.10____level3.ps
1,4G [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level1.ps
5,6G [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level1sep.ps
344M [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level2.ps
344M [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level2sep.ps
344M [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level3.ps
344M [DEU]X14DVBEUH-1.113-0626.pdf_pdftops-0.24.5_level3sep.ps

Revision history for this message
Renne (renne) wrote :

Samsung SmartTV user manual for testing the PDF->PS conversion

Revision history for this message
bruno (brunob) wrote :

See Bug #1476705 for a similar issue.

It is possible to replace pstopdf with pstocairo (and return to the default) with these commands:

$ lpadmin -p <printer> -o pdftops-renderer-default=pdftocairo
to switch over and
$ lpadmin -p <printer> -R pdftops-renderer-default=pstopdf
to switch back.

In my case (HP Color Laserjet 2605), it is much better.

Revision history for this message
bruno (brunob) wrote :

oops, I mean:
$ lpadmin -p <printer> -o pdftops-renderer-default=pdftops
to switch back...

Revision history for this message
Wolf (drechsel) wrote :

Have the same sort of problem with a Samsung ML-4600.
Printing text works well, but images take an awful lot of time.

Changing to "generic PCL" driver solved the problem partially - but it does not handle the margins properly.

Revision history for this message
Thomas Mayer (thomas303) wrote :

https://www.dab-bank.de/media/B2C/Allgemeine-Downloads/Service/Formulare/103921_eroeffnung_girokonto_nk.pdf

When I print this pdf in the PDF.js viewer of Firefox, then processing takes a while and I can see a print job with ~30 megabytes in size. Printing takes more than one hour with an old Kyocera FS-1020d (~10 minutes per page, so it massively slows down the printer itself, not only the processing).

When I print the same file in evince, the print job is 279 kilobytes in size and it only takes seconds to print with the FS-1020d.

Please note that I am using up-to-date ubuntu 16.04, Firefox 47.0. And my printer has a 128MB memory upgrade built-in.

Revision history for this message
Thomas (t-hartwig) wrote :

Switching to CUPS-Gutenprint fixed it for me. There must be a major issue with default driver still, it looks like the print is bloated as hell, network traffic is high all the time. Ubuntu 16.04 LTS here.

Revision history for this message
crs (visoftg) wrote :

Hi! Ubuntu 14.04 LTS, HP Laserjet P2055DN.
I installed HP drivers, recommended settings.
Images are getting printed very slow (minutes pass since the print command is sent until the actual printing starts).

I opened system-config-printer and manually changed the "Make and Model" to "HP LaserJet p2055dn pcl3, hpcups 3.16.3" instead of PostScript one.

Now, it prints the images fast (seconds).

Hope it helps.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.