Unable to print a document with evince, works correctly with Adobe Acrobat Reader

Bug #680628 reported by Aymeric on 2010-11-23
102
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Poppler
Fix Released
Medium
cairo (Debian)
New
Unknown
cairo (Ubuntu)
High
Unassigned
poppler (Ubuntu)
High
Unassigned

Bug Description

Binary package hint: evince

When I try to print this pdf with evince the first page take more than one hour for been printed.
And when I use Adobe Acrobat Reader it take less than one minute.

I've try on 2 others computer same behaviors.

This is not the only pdf with this problems.

I'm using Ubuntu 10.04 up to date.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: evince 2.30.3-0ubuntu1.1
ProcVersionSignature: Ubuntu 2.6.32-24.43-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic i686
NonfreeKernelModules: ath_hal
Architecture: i386
Date: Tue Nov 23 20:59:11 2010
KernLog:

ProcEnviron:
 LANGUAGE=fr_FR:fr:en_US:en
 PATH=(custom, user)
 LANG=fr_FR.utf8
 SHELL=/bin/bash
SourcePackage: evince

Aymeric (mulx) wrote :
Id2ndR (id2ndr) on 2010-11-23
affects: evince (Ubuntu) → ghostscript (Ubuntu)
Till Kamppeter (till-kamppeter) wrote :

Please tell us which printer you have used and follow the instructions of the sections "CUPS error_log" and "Capturing print job data" in https://wiki.ubuntu.com/DebuggingPrintingProblems. Thanks.

Aymeric (mulx) wrote :
Aymeric (mulx) wrote :
Aymeric (mulx) wrote :

This bug happen on an HP PSC 1510 and on an HP PSC 1110

Till Kamppeter (till-kamppeter) wrote :

The problem is how evince (libcairo) has re-rendered the PDF file. The resulting PDF file which was sent to CUPS (and attached to comment #3 of this bug report) takes ages to render, not only with Ghostscript but also with the Adobe Reader. If you have installed the Adobe Reader with its browser plug-in and click on the link in comment #3, your browser immediately opens the Adobe Reader and the body text of the first page appears. Then it builds up slowly the blue background rectangle for the headline and after some minutes this finishes and the white headline appears.

The error_log also shows in the second logged job that Ghostscript needed 20 minutes to render the whole file. So this file definitely hits a problem of Cairo and so the slowness of Ghostscript described in bug 668800 is not the only cause for this file taking too long to print.

Moving bug to libcairo and lifting duplicate state ...

affects: ghostscript (Ubuntu) → libcairo (Ubuntu)
Changed in libcairo (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Till Kamppeter (till-kamppeter) wrote :

Bug 578380 is a similar problem.

Till Kamppeter (till-kamppeter) wrote :

Everyone with similar problems (PDF does not print or prints very slowly out of evince), do the following:

1. Attach the file which does not print.
2. Follow the instructions of the sections "CUPS error_log" and "Capturing print job data" on https://wiki.ubuntu.com/DebuggingPrintingProblems
3. Convert the captured print data to PostScript with the "pdftops" command.
4. Tell us the size of the original file, the captured print data, and the resulting PostScript file.
5. Attach all files. Do not hesitate to attach big files. Attach the files one by one, do not package them together and do not compress them. Only if the resulting PostScript file is so big that it takes you hours or days to upload, do not upload it.
6. Naturally tell us which printer and driver you are using.

Fixing this required changes to both cairo and poppler. The cairo commit is:

http://cgit.freedesktop.org/cairo/commit/?id=d3accefd3b9a4db5f07fb1f7bb05fb4238bf36c1

The poppler patch is in

https://bugs.freedesktop.org/show_bug.cgi?id=32102

tags: added: patch
Changed in libcairo (Ubuntu):
status: Confirmed → Triaged
Changed in poppler (Ubuntu):
status: New → Triaged
importance: Undecided → High
summary: - Unable to print a document with evince work correctly with Adobe Acrobat
- Reader
+ Unable to print a document with evince, works correctly with Adobe
+ Acrobat Reader

Attaching the Cairo patch, to make this bug listed as a bug with patch.

And this is the patch for Poppler.

Changed in poppler (Ubuntu):
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package poppler - 0.14.3-0ubuntu2

---------------
poppler (0.14.3-0ubuntu2) natty; urgency=low

  * debian/patches/20_fix-slowness-on-evince-output-lp-680628.patch:
    The cairo PDF surface now optimizes the case of cairo_mask() with solid
    source and A1 mask to use a PDF stencil mask. Fixes LP: #680628 where a
    65K PDF printed to PDF using poppler-cairo turns into an 8MB PDF.
 -- Till Kamppeter <email address hidden> Tue, 7 Dec 2010 17:10:23 +0100

Changed in poppler (Ubuntu):
status: In Progress → Fix Released

Note that the Poppler fix alone does not improve the situation with the attached files. The patch for Cairo also needs to be applied.

I have tried the Cairo patch on the Cairo package of current Natty (1.10.0). It does not work there unfortunately. It is too different to Cairo version it was created on. So can someone more knowledgeable about Cairo than me adapt the patch? Or replace the current Cairo by a newer version which contains the patch? Thanks.

Now I succeeded tgo adapt the patch and it actually works. After having installed the fixed Cairo and Poppler packagesand capturing the print output of evince again, the new printout is displayed without any delays by Adobe Reader and converting the captured output to PostScript with "pdftops" (of Poppler) takes less than 2 seconds and not 13 minutes any more.

Anyone with upload rights on Cairo please upload the patched Cairo. Thanks.

Changed in libcairo (Ubuntu):
status: Triaged → In Progress
status: In Progress → Fix Committed

To try out the effects of the patches, here is the captured print output of evince after applying the patches. Click it and the Adobe Reader plugin will display the first page without delay in the head line background.

Thank you very much for the patches!

affects: libcairo (Ubuntu) → cairo (Ubuntu)
Martin Pitt (pitti) wrote :

Sponsored with adding a proper patch header.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cairo - 1.10.0-1ubuntu5

---------------
cairo (1.10.0-1ubuntu5) natty; urgency=low

  * debian/patches/cairo-lp-680628.patch: PDF: Output a stencil mask for
    cairo_mask() with solid source and A1 mask. This is the Cairo part
    to fix blown up output files and slow printing when printing certain PDF
    files with evince (LP: #680628).
 -- Till Kamppeter <email address hidden> Tue, 7 Dec 2010 18:27:23 +0100

Changed in cairo (Ubuntu):
status: Fix Committed → Fix Released
Aymeric (mulx) wrote :

Thanks for fixing it.
I am now waiting to see update for this one in Ubuntu 10.04. :)

Regards,
Aymeric.

bruno (brunob) wrote :

If I understand well, libpoppler5 and libcairo2 will have to be updated on Ubuntu 10.04. Am I right? If not, what are the exact package names for lucid?

Also what is (approx) the time frame for the update (on lucid)?

Thanks...

bruno, this is correct, these two would need to get updated in Lucid.

bruno (brunob) wrote :

Updated packages for lucid haven't been released yet (to my knowledge), so I would like to manually apply the patches. However, I'm not sure of the exact files to use and how to use the patches. Can someone write here the detailed procedure to manually solve this mess in lucid (64-bits). I have downloaded the patches in post #11 and #15 (is it correct) but don't know what to do after.

Thanks...

Note that my fix in poppler 0.14.3-0ubuntu2 got dropped in poppler 0.14.5-0ubuntu1 and 0.14.5-0ubuntu2. I have reintroduced it in poppler 0.14.5-0ubuntu3.

bruno, what you need is to rebuild Cairo and Poppler from Natty on your Lucid system:

Do the following in a terminal window (ignore any errors concerning signatures):

cancel -a
sudo apt-get install build-essential fakeroot
sudo apt-get build-dep poppler cairo
mkdir build
cd build
wget https://launchpad.net/ubuntu/+archive/primary/+files/cairo_1.10.2.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/cairo_1.10.2-1ubuntu1.debian.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/cairo_1.10.2-1ubuntu1.dsc
dpkg-source -x cairo_1.10.2-1ubuntu1.dsc
cd cairo-1.10.2
dpkg-buildpackage -rfakeroot
cd ..
wget https://launchpad.net/ubuntu/+archive/primary/+files/poppler_0.14.5.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/poppler_0.14.5-0ubuntu3.debian.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/poppler_0.14.5-0ubuntu3.dsc
dpkg-source -x poppler_0.14.5-0ubuntu3.dsc
cd poppler-0.14.5
dpkg-buildpackage -rfakeroot
cd ..
sudo dpkg -i *.deb

Now try to print again and the performance problems should be gone.

bruno (brunob) wrote :

Unfortunately, it is not a trivial task (for me). If the goal is to build new .deb packages, is it impossible to simply upload them somewhere (32 and 64 bits if possible)? I followed exactly the steps in #24 but:

1) I added the 3 lucid source repositories to my sources.list for the apt-get build-dep poppler cairo; and this installed more than 100 things... ouch.
2) at the first dpkg-buildpackage I get:
dpkg-buildpackage -rfakeroot
dpkg-buildpackage : définir CFLAGS à la valeur par défaut : -g -O2
dpkg-buildpackage : définir CPPFLAGS à la valeur par défaut :
dpkg-buildpackage : définir LDFLAGS à la valeur par défaut : -Wl,-Bsymbolic-functions
dpkg-buildpackage : définir FFLAGS à la valeur par défaut : -g -O2
dpkg-buildpackage : définir CXXFLAGS à la valeur par défaut : -g -O2
dpkg-buildpackage: paquet source cairo
dpkg-buildpackage: version source 1.10.2-1ubuntu1
dpkg-buildpackage: source changé par Sebastien Bacher <email address hidden>
dpkg-buildpackage: archdpkg-buildpackage -rfakeroot
dpkg-buildpackage : définir CFLAGS à la valeur par défaut : -g -O2
dpkg-buildpackage : définir CPPFLAGS à la valeur par défaut :
dpkg-buildpackage : définir LDFLAGS à la valeur par défaut : -Wl,-Bsymbolic-functions
dpkg-buildpackage : définir FFLAGS à la valeur par défaut : -g -O2
dpkg-buildpackage : définir CXXFLAGS à la valeur par défaut : -g -O2
dpkg-buildpackage: paquet source cairo
dpkg-buildpackage: version source 1.10.2-1ubuntu1
dpkg-buildpackage: source changé par Sebastien Bacher <email address hidden>
dpkg-buildpackage: architecture hôte amd64
dpkg-checkbuilddeps : dépendances de construction non trouvées : dh-autoreconf libxrender-dev (>= 1:0.9.5-2) libx11-dev (>= 2:1.3.3-2) libpixman-1-dev (>= 0.18.4) libxcb-shm0-dev
dpkg-buildpackage: avertissement: Dépendances de construction et conflits non satisfaits ; échec.
dpkg-buildpackage: avertissement: (Utilisez l'option -d pour forcer.)
itecture hôte amd64
dpkg-checkbuilddeps : dépendances de construction non trouvées : dh-autoreconf libxrender-dev (>= 1:0.9.5-2) libx11-dev (>= 2:1.3.3-2) libpixman-1-dev (>= 0.18.4) libxcb-shm0-dev
dpkg-buildpackage: avertissement: Dépendances de construction et conflits non satisfaits ; échec.
dpkg-buildpackage: avertissement: (Utilisez l'option -d pour forcer.)

3) the second dpkg-buildpackage goes further, but finally I get those messages:
CairoOutputDev.cc:2322: error: ‘CAIRO_MIME_TYPE_JPEG’ was not declared in this scope
CairoOutputDev.cc:2322: error: ‘CAIRO_MIME_TYPE_JP2’ was not declared in this scope
CairoOutputDev.cc:2324: error: ‘cairo_surface_set_mime_data’ was not declared in this scope
make[4]: *** [CairoOutputDev.lo] Erreur 1
make[4]: quittant le répertoire « /home/bruno/build/poppler-0.14.5/poppler »
make[3]: *** [all] Erreur 2
make[3]: quittant le répertoire « /home/bruno/build/poppler-0.14.5/poppler »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/bruno/build/poppler-0.14.5 »
make[1]: *** [all] Erreur 2
make[1]: quittant le répertoire « /home/bruno/build/poppler-0.14.5 »
make: *** [debian/stamp-makefile-build] Erreur 2
dpkg-buildpackage: erreur: debian/rules build a produit une erreur de sortie de type 2

Thanks...

> 1) I added the 3 lucid source repositories to my sources.list for the apt-get build-dep poppler cairo; and this installed more than 100 things... ouch.

I did not ask you for doing that. Please remove any extra entry which you have added to your sources.list. After that run "sudo apt-get update; sudo apt-get dist-upgrade" in your terminal window. "apt-get build-dep poppler cairo" installs only binary packages.

Did you do the "sudo apt-get install ..." commands in the beginning? Did you execute the "wget" commands? Did you change into the new directories and execute "dpkg-buildpackage -rfakeroot" there? Did the "apt-get build-dep poppler cairo" command succeed?

Can you run the following commands in a terminal window:

sudo apt-get install dh-autoreconf libxrender-dev libx11-dev libpixman-1-dev libxcb-shm0-dev

Then go into the appropriate directories and run the "dpkg-buildpackage -rfakeroot" commands again.

bruno (brunob) wrote :

Till,

I want to precise that I use Mint9 which is based on lucid. Yes I followed all the steps in post#24. However, for the third one (sudo apt-get build-dep poppler cairo), nothing was installed and I received a message (must add something in my sources.list...). So I added these dev repos:

deb-src http://ca.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ lucid-updates main restricted

with this, the third step succeed but it installed (as I said) many other dependencies. Then I did the other steps but the dpkg-buildpackage commands gives the messages cited in post #25.

When I try this:
sudo apt-get install dh-autoreconf libxrender-dev libx11-dev libpixman-1-dev libxcb-shm0-dev
I get:
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
E: Impossible de trouver le paquet dh-autoreconf

thanks...

Changed in poppler:
status: Unknown → Fix Released
Changed in poppler:
importance: Unknown → Medium
Savvas Radevic (medigeek) wrote :

This also happens on ubuntu 10.10 - a long pause between each page printing and 100% cpu by gs.

the 'fix' on #24 works for Maverick

tags: added: maverick
bruno (brunob) wrote :

I confirm that this bug still happens on Maverick, even if updated. With the PDF file in post#1, I get 100% CPU usage for pdftops (that must be killed by hand even if the print job is cancelled). No problem to print this pdf (just tried the first page) to a postscript file and print this PS file with evince.

In fact, I have the exact same behavior with another pdf file I had to print recently. I join it to this post for test purposes. But no problem to print many pdf or jpeg photos.

I have a HP 2605dn with the 2605 Postscript PPD (not the foomatic one).

bruno (brunob) wrote :

I forgot to mention that I tried to apply to fix on post #24 but the second command:

sudo apt-get build-dep poppler cairo

tells me that sources (if remember well) can't be found for poppler (or cairo). Yes I did the first command before.

Anyway, if a fix for this bug exists, may I suggest to create a PPA to have the good version of libcairo2 and libpoppler7?

bruno, can you do

sudo apt-get update before all the commands from comment #24?

bruno, can you open the update-manager/package manager/software center/gnome-control-center and check whether under the "Software Sources" under "Ubuntu software" "Source code" is activated?

Can you also run "sudo apt-get update", and then try the commands of comment #24 again?

By the way, on Oneiric all attached files work correctly.

Changed in cairo (Debian):
status: Unknown → New
bruno (brunob) wrote :

Till, sorry for the long delay... "Source code" is activated in synaptics (for Linux Mint Software). I still get the same error (just after "sudo apt-get update"):

sudo apt-get build-dep poppler cairo
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
E: Impossible de trouver une source de paquet pour poppler

N.B. I got a similar message if I ask only for cairo.

Maybe, I have this building trouble because I'm on linux mint 10 (ubuntu maverick base). This is why I asked for a PPA...

Eric Seigne (eric-seigne) wrote :

i've got the same bug here, epdfview could print without any problem, it works with "lp command line" too but evince and f-spot (and others ?) takes a loooooong time to print.

Éric

Eric Seigne (eric-seigne) wrote :

Hi all, here is a ppa :

https://launchpad.net/~eric-seigne/+archive/lucid-poppler-cairo

The "solution" is:
* backport pixman 0.20 from natty
* backport cairo from natty + changes on debian/control to break depends on specific versions of packages not available in lucid
* backport poppler from natty + changes on debian/control to break depends on specific versions of packages not available in lucid

Upload is in progress ... please test theses packages !

Éric

bruno (brunob) wrote :

Eric, is this PPA for lucid only? All the computers here are on maverick...

Bruno

Eric Seigne (eric-seigne) wrote :

Hello,
this ppa is created, so could you please try it ?

sudo apt-add-repository ppa:eric-seigne/lucid-poppler-cairo

then try to print and .... ?

Aymeric (mulx) wrote :

Hello,
Glad to hear news from this bug :)
I could try on Lucid with your ppa but after the 26 February (I haven't the computer with me).

Eric Seigne (eric-seigne) wrote :

Hello Bruno,

i only works on LTS versions ... but i'll put packages for maverick on ppa, upload in progress, so keep in touch.

Éric

bruno (brunob) wrote :

Hi Eric,

Sorry for the delay. Unfortunately, the updated packages with the PPA (libpixman, libcairo and poppler-utils) don't solve this bug (at least on Maverick before and after a fresh update). I tried with the PDFs in post#1 and #30. I have exactly the same behaviour as before (see #30).

Eric Seigne (eric-seigne) wrote :

Okay, i've got the same result here, so i think #24 is a dream ;-)

So what could be the solution now ?

Aymeric (mulx) wrote :

Hi all,

I suppose there is no hope to see this bug fixed on Ubuntu 10.04 LTS since the new LTS has been released..

It's a pity.. but regardless, I'll upgrade to precise to fix this bug ... and find new ones..

Regards,
Aymeric.

Eric Seigne (eric-seigne) wrote :

Yes, what a pity !

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

Other bug subscribers

Remote bug watches

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