Printing from evince (and perhaps other GTK apps) to PostScript printers is broken ("0a" bytes inserted into PostScript output)

Bug #419143 reported by Janne Hyötylä
420
This bug affects 78 people
Affects Status Importance Assigned to Milestone
cairo (Ubuntu)
Invalid
High
Ubuntu Desktop Bugs
Karmic
Won't Fix
High
Unassigned
cups (Ubuntu)
Invalid
High
Unassigned
Karmic
Invalid
High
Unassigned
firefox (Ubuntu)
Invalid
Undecided
Unassigned
Karmic
Invalid
Undecided
Unassigned
poppler (Ubuntu)
Invalid
Undecided
Unassigned
Karmic
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: cups

When trying to print on an HP Laserjet 4100 (through network, no possibility to connect to USB) in karmic, A notification tells me that printing succeeded, but regarding of the document to be printed, only one page gets printed with the following error message (6 lines):

ERROR: undefined
OFFENDING COMMAND: 0a

STACK:

-mark-

Other printers on the same network (e.g. OKI C7350) work flawlessly, also the same printer worked on intrepid and jaunty.

WORKAROUND 1:
Print from okular (KDE PDF viewer) or any other (non-gtk?) software.

WORKAROUND 2:
Use the fixed cairo packages from this PPA:
https://launchpad.net/~janne-hyotyla/+archive/jhyotyla

===========================================
ProblemType: Bug
Architecture: i386
CupsErrorLog:
 E [26/Aug/2009:11:46:23 +0200] CUPS-Add-Modify-Printer: Unauthorized
 E [26/Aug/2009:11:59:45 +0200] CUPS-Add-Modify-Printer: Unauthorized
Date: Wed Aug 26 12:02:29 2009
DistroRelease: Ubuntu 9.10
Lpstat:
 device for bioz3-hp4100: socket://131.152.19.90:9100
 device for bioz3-okic2: socket://131.152.19.56:9100
MachineType: Dell Inc. Latitude D630
Package: cups 1.3.11-2ubuntu1
Papersize: letter
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
PpdFiles:
 bioz3-okic2: Oki C5900 Foomatic/Postscript
 bioz3-hp4100: HP LaserJet 4100 Series v.3010.107 Postscript (recommended)
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-6-generic root=UUID=a4e3ce99-2ce1-4bfa-b256-0135ea2c2244 ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-6.26-generic
SourcePackage: cups
Uname: Linux 2.6.31-6-generic i686
dmi.bios.date: 07/23/2007
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A03
dmi.board.name: 0KU184
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA03:bd07/23/2007:svnDellInc.:pnLatitudeD630:pvr:rvnDellInc.:rn0KU184:rvr:cvnDellInc.:ct8:cvr:
dmi.product.name: Latitude D630
dmi.sys.vendor: Dell Inc.

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have done some tests and printing with the PPD for the LJ 4100 which you are using works for me on the LJ 3390 and the LJ P3005 (both on the network, CUPS version 1.4.0 from Karmic).

Can you attach the files which you did not succeed to print and can you also create an error_log as described in the "CUPS error_log" section of

https://wiki.ubuntu.com/DebuggingPrintingProblems

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

If you have CUPS 1.4.0 already, the USB problem is caused by a new USB CUPS backend. For this backend the "usblp" kernel module must be unloaded.

Edit /etc//etc/modprobe.d/blacklist.conf adding a line

blacklist usblp

and then run the command

sudo rmmod usblp

Now CUPS should see your USB printers again.

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

Attached is a PDF where this error occurs when printing from evince. Printing the same file from okular works perfectly.

Most of my PDFs get this error from evince.

Incidentally, this PDF gets printed correctly (I just picked a random PDF from the ubuntu site):
http://www.ubuntu.com/files/server/UbuntuServerBrochure804LTS.pdf

Attached is the cups error_log with print job 39 from evince (1 page, error) and job 40 from okular (2 pages, correct printout).
The okular printout is duplex although in the okular printing options duplex was set to "none".

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :
Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

Forgot to mention: I'm running the latest cups now
$ apt-cache policy cups
cups:
  Installed: 1.4.0~svn8773-1
  Candidate: 1.4.0~svn8773-1

And regarding USB I just wanted to say that I have no opportunity to plug the printer in the USB (company shared printer), not that I have a problem with USB in this case.

Also adding evince to affects.

Changed in cups (Ubuntu):
status: Incomplete → New
summary: - [karmic, regression] Printing with HP Laserjet 4100 broken
+ Printing with HP Laserjet 4100 broken
Changed in evince (Ubuntu):
importance: Undecided → Low
Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote : Re: Printing with HP Laserjet 4100 broken

I'm seeing this problem on the (networked; not local USB) HP LaserJet 4100 in the office. I suspect it's also going on with the LaserJet 5M in the office, which just silently discards the print job. Unfortunately, that's 0 out of the two printers that I can use.

Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :

Attaching a bunch of pdfs that trigger the bug for me. Also, I think that "low" really underestimates the importance of this bug. If people upgrade to Karmic and can no longer print, they are going to be cheesed (not to mention that I suspect that the problem is much more widespread than just this printer).

description: updated
Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

This bug appears to be fixed in current karmic. Can anybody confirm?

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

Can everyone who still has problems post his PPD file (/etc/cups/ppd/<printer>.ppd)? Thanks.

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

Looks that this is a bug in HP's PostScript interpreters. I have tried to print the file XAFSPhoton_estimate.pdf (attached to comment #4) and it does not print on my HP LaserJet 3390 if I use any PostScript PPD file (tried the onr for the LaserJet 4100 and for the LaserJet 3390). Only way to get it printed is setting up a PCL-based print queue ("pxlmono" driver) or not using evince.

Looking into the generated PostScript file it seems that the HP printers are not able to parse the embedded fonts. The offending 0a is in the beginning of the second binary code line of

%%BeginResource: font CairoFont-0-0
%!PS-AdobeFont-1.0: NimbusRomNo9L-Medi 1.06
%%Title: NimbusRomNo9L-Medi
%Version: 1.06
%%CreationDate: Thu Aug 2 13:15:44 2007
%%Creator: frob
%Copyright: Copyright (URW)++,Copyright 1999 by (URW)++ Design &
%Copyright: Development; Cyrillic glyphs added by Valek Filippov (C)
%Copyright: 2001-2005
% Generated by FontForge 20070723 (http://fontforge.sf.net/)
%%EndComments

FontDirectory/NimbusRomNo9L-Medi known{/NimbusRomNo9L-Medi findfont dup/UniqueID known pop false {dup
/UniqueID get 5020933 eq exch/FontType get 1 eq and}{pop false}ifelse
{save true}{false}ifelse}{false}ifelse
11 dict begin
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def
/FontName /CairoFont-0-0 def
/FontBBox {-168 -341 1093 960 }readonly def

/PaintType 0 def
/FontInfo 9 dict dup begin
 /version (1.06) readonly def
 /Notice (Copyright \050URW\051++,Copyright 1999 by \050URW\051++ Design & Development; Cyrillic glyphs added by Valek Filippov \050C\051 2001-2005) readonly def
 /FullName (Nimbus Roman No9 L Medium) readonly def
 /FamilyName (Nimbus Roman No9 L) readonly def
 /Weight (Bold) readonly def
 /ItalicAngle 0 def
 /isFixedPitch false def
 /UnderlinePosition -100 def
 /UnderlineThickness 50 def
end readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 8 /space put
dup 31 /two put
dup 7 /colon put
dup 5 /A put
dup 1 /B put
dup 4 /C put
dup 19 /E put
dup 21 /F put
dup 30 /P put
dup 22 /S put
dup 6 /T put
dup 20 /X put
dup 9 /a put
dup 29 /b put
dup 11 /c put
dup 12 /e put
dup 17 /f put
dup 25 /g put
dup 13 /h put
dup 2 /i put
dup 27 /l put
dup 24 /m put
dup 14 /n put
dup 3 /o put
dup 26 /p put
dup 15 /q put
dup 18 /r put
dup 10 /s put
dup 23 /t put
dup 16 /u put
dup 28 /x put
readonly def
currentdict end
currentfile eexec
f983ef0097ece61cf3a79690d73bfb4b0027b850f3158905fdac1bc024d7276e
0a12b7ddcede59e3601ab4509dfe0977ed5bf624ebc1f818c45f1350d41b052a
72743accb053eb06ed043568d3196a30bed220227e2a15bacef508449221cf33
8a8666e92410a9aa91d5a31900a93c01ec21742cd14dc46bffa111ce10b78ae0
1abaeba7f36cdf79a4733245c63f6d36234d6b0961f1ac295d6177931b9ed554
bb5fc6741a63c493daabf03d753c7d2b8e8c01e3e280898f810da5985212c8c0
[...]

Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :

Attaching ppds

Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :
Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :
Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

I take back the statement that the bug was fixed for me. I thought I had much less printing problems now than before, but maybe it was just coincidence. Trying to print XAFSPhoton_estimate.pdf gives me the same old error.
PPD attached.

Revision history for this message
Mingming Ren (portis25) wrote :

I have this error on a Kyocera KM-2560 printer.

Revision history for this message
Mingming Ren (portis25) wrote :

And the Kyocera KM-2560 PPD.

This error appears in Karmic only, I can print flawlessly in Jaunty.

Revision history for this message
Mingming Ren (portis25) wrote :

The title of this bug report is misleading, should we change it from HP Laserjet 4100 specific to some a general title?

summary: - Printing with HP Laserjet 4100 broken
+ Printing from evince (and perhaps other GTK apps) to PostScript printers
+ is broken
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Same problem here, cannot print from evince to a Kyocera FS-1030D.

Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :

I think this needs to be higher priority. Businesses are the ones with PostScript printers, and I suspect they'll be upset to have print jobs randomly failing.

In other news, I suspect that the error is related to image (bitmap) data. Scanned text and some articles (not all) fail. I've not sorted out which of the last vjnano articles last week failed to print, but I have a hunch that they're the ones that have bitmap figures.

Changed in cups (Ubuntu):
milestone: none → ubuntu-9.10
Changed in evince (Ubuntu):
milestone: none → ubuntu-9.10
Changed in cups (Ubuntu):
importance: Undecided → High
Changed in evince (Ubuntu):
importance: Low → High
Revision history for this message
PrivateUser132781 (privateuser132781-deactivatedaccount) wrote :

I thought the problem had been solved for me, but the PDFs posted by GiuseppeVerde still trigger the bug. I attach my PPD.

I do not understand the workaround described by Till Kamppeter in my original bug report ( https://bugs.edge.launchpad.net/ubuntu/+source/cups/+bug/439384/comments/2 )

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

Eduard Grebe, note that my comment does not describe a workaround, it only tells that on your printer you can turn on a mode so that the printer prints error messages. You can turn it on on the printer, to see whether you get the same messages as the original poster.

Revision history for this message
Johannes (hummlbach) wrote :

I can confirm this problem on my kyocera fs-c5100dn. I'm getting the same error. (offending command: 0a)
As a workaround I downgraded evince to 2.26.1 (jaunty's evince version).
( what two minor versions can do... :) )

Revision history for this message
Pascal Grossé (pascal-grosse) wrote :

Hi,

I have a similar issue with my Brother HL2070N (which is not a postscript printer I think).

When printing from evince, it fails silently. When printing the same file.ps from gv, it works perfectly. So, I would say it is not a config problem, and probably not a cups bug.

Note that the test page is correctly printed from system-config-printer.

Pascal

Revision history for this message
PrivateUser132781 (privateuser132781-deactivatedaccount) wrote :

I have continued to experience problems printing to HP Laserjet P3005dn. However, the problems seem to disappear when I use a different PPD called "CUPS+Gutenprint v5.2.4" which is one of the 3 options listed in the list of PPDs in the add printer tool. The two others, the default and one labeled "hpljs" do not work.

Revision history for this message
Johannes (hummlbach) wrote :

I suppose, that it's not a bug of evince but a feature... Since version 2.27.4 in ev-print-operation.c the lines

export->fc.format = file_format && g_ascii_strcasecmp (file_format, "pdf") == 0 ?
                        EV_FILE_FORMAT_PDF : EV_FILE_FORMAT_PS;

changed to

if (file_format) {
                export->fc.format = g_ascii_strcasecmp (file_format, "pdf") == 0 ?
                        EV_FILE_FORMAT_PDF : EV_FILE_FORMAT_PS;
        } else {
                export->fc.format = gtk_printer_accepts_pdf (printer) ?
                        EV_FILE_FORMAT_PDF : EV_FILE_FORMAT_PS;
        }

so that evince > 2.27.3 sends pdf-file (if print system supports pdf-input) even if file_format is NULL what ever - I don't understand it completely...
In the case of the problematic files evince sends pdf-files since version 2.27.4 and ps-files in earlier versions. This change causes the problem. But the bug probably lies not in evince?!?

Changed in evince (Ubuntu Karmic):
status: New → Confirmed
Changed in cups (Ubuntu Karmic):
status: New → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The problem is not the fact whether evince produces PostScript or PDF output when sending a print job to CUPS but the PDF which gets sent to CUPS. This is not necessarily produced by evince, but rather by some library like GTK or Cairo. So a real fix has to be done in the appropriate library.

Another, but only partial fix would be to make evince simply passing through the input file if it is PDF. This does not cover the case of evince be used to display a non-PDF file (PostScript could also be passed through).

Making evince outputting PostScript again is only a workaround for the time being until PDF generation gets fixed. In addition, this causes other problems which we solved by switching over to PDF output. If we do this step, it only should be done in the Ubuntu package, not upstream.

Also any attempt to solve the problem by modifying the CUPS filters is only a workaround, as CUPS prints all PDF files from other sources than evince just fine.

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

As workaround for bug 443026 a new evince package got uploaded which returns to sending PostScript and not PDF to CUPS when printing. Please try this version and tell whether it also solves the problem described here.

Revision history for this message
Pascal Grossé (pascal-grosse) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Well, it worked for me ! It's probably better to have such a temporary
workaround than a non functional evince. Thanks for your work !

Pascal

2009/10/15 Till Kamppeter <email address hidden>

> As workaround for bug 443026 a new evince package got uploaded which
> returns to sending PostScript and not PDF to CUPS when printing. Please
> try this version and tell whether it also solves the problem described
> here.
>
> --
> Printing from evince (and perhaps other GTK apps) to PostScript printers is
> broken
> https://bugs.launchpad.net/bugs/419143
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Till Kamppeter (till-kamppeter) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Pascal, thank you, good to know that the workaround for Karmic works. So I am closing this bug for Karmic. I hope for Lucid we will get a real fix.

Changed in evince (Ubuntu Karmic):
status: Confirmed → Fix Released
Changed in cups (Ubuntu Karmic):
milestone: ubuntu-9.10 → none
Revision history for this message
Thomas Jagoditsch (tja) wrote :

todays updates (2.28.0ubuntu4) doesnt seem to help the issue (was the fix reverted ?!?).
*photon* and some of my pdfs still will fail to print with ps "error undefined command 0a" on my brother dcp-8065n - otoh okular will print them without issues.
laymans question: doesnt this hint that indeed evince/gtk/gnome etc is faulty and neither gs nor cups ?

Revision history for this message
Pascal Grossé (pascal-grosse) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Maybe the bug you encountered is different from mine, because in my case
evince failed silently to print, and now it works again. I never had an
error message (but the printer made its caracteristic "heating noise" each
time, as it probably received something, just didn't know how to deal with).

Pascal

2009/10/16 Thomas Jagoditsch <email address hidden>

> todays updates (2.28.0ubuntu4) doesnt seem to help the issue (was the fix
> reverted ?!?).
> *photon* and some of my pdfs still will fail to print with ps "error
> undefined command 0a" on my brother dcp-8065n - otoh okular will print them
> without issues.
> laymans question: doesnt this hint that indeed evince/gtk/gnome etc is
> faulty and neither gs nor cups ?
>
> --
> Printing from evince (and perhaps other GTK apps) to PostScript printers is
> broken
> https://bugs.launchpad.net/bugs/419143
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Thomas Jagoditsch (tja) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

@pascal:
i dont think so, it seems that some printers will print an error page while others are just sitting quietly or give some error on their displays.
but i cant understand that your problem is gone while mine (and others like https://bugs.launchpad.net/ubuntu/+source/cups/+bug/443026/comments/14 suggests) are still around.

Revision history for this message
Pascal Grossé (pascal-grosse) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Yes, you must be right, I did actually have a blinking led on the printer
(but as the printer isn't in the same room I had to run to see it).

Pascal

2009/10/16 Thomas Jagoditsch <email address hidden>

> @pascal:
> i dont think so, it seems that some printers will print an error page while
> others are just sitting quietly or give some error on their displays.
> but i cant understand that your problem is gone while mine (and others like
> https://bugs.launchpad.net/ubuntu/+source/cups/+bug/443026/comments/14suggests) are still around.
>
> --
> Printing from evince (and perhaps other GTK apps) to PostScript printers is
> broken
> https://bugs.launchpad.net/bugs/419143
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

XAFSPhoton...pdf from comment 4 still does not work with my HP Laserjet 4100 (PPD in comment 15) and Postscript drivers. Same error as originally reported.

Changed in evince (Ubuntu Karmic):
status: Fix Released → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

It's a bug in evince, closing cups task.

Changed in cups (Ubuntu Karmic):
status: Confirmed → Invalid
Revision history for this message
Martin Pitt (pitti) wrote :

In Karmic we got the workaround to produce PostScript instead of PDF from evince, which should mitigate the situation.

Changed in evince (Ubuntu Karmic):
milestone: ubuntu-9.10 → none
status: Confirmed → Won't Fix
Changed in evince (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

What does this mean?
It still does not work for me (as the bug reporter). Or is there something I'm missing? (i.e. I have to use a specific driver or other settings to make it work)

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

I have checked the output and both the PostScript directly generated by evince and the PostScript which is generated when converting evince's PDF to PostScript generates the offending embedded font code. This means that this bug is not covered by switching evince from outputting PDF to outputting PostScript.

Wwe need a real fix of GTK's or Cairo's PDF AND PostScript output.

A good workaround would be to make evince simply passing through the input files to the print queue if they are PDF or PostScript.

Revision history for this message
Nathaniel Smith (njs) wrote :

It's claimed here that the bug is in evince, but I don't actually see the evidence. The "bad" PDFs produced by evince display render perfectly in evince, xpdf, and gs; the output of pstopdf on those files also renders perfectly in evince and gs. It's just the printer that is complaining.

It seems to me that *if* the PDF/PS files evince is generating are legal, and just happen to trigger a printer bug, then it's really cups' job to work around that printer bug, not evince's to somehow intuit what sort of printer the file will eventually be sent to after being passed through some set of filters they have no control over.

Of course, it maybe be that evince/xpdf/gs are in just lenient when displaying stuff, and evince is actually generating buggy PDF/PS, in which case it should be fixed. But to make that argument surely we need someone to actually look at the postscript spec and figure things out.

Revision history for this message
Thomas Jagoditsch (tja) wrote :

@nathaniel:
as i reported in #31 ocular will print them fine (on the same box ofc).

so either
a) ocular does some workaround for a cups-bug (which is what u suggest)
b) something in the gnome chain is changing the output wrongly when printing

the fact that evince will display them ok is IMHO no evidence that there is no bug while printing.

i am no PS guru but is it sure that this is a printers bug as till in #11 suggests ?
i would find it strange that my brother 8065 would have the same error as some hp's ...

Revision history for this message
Nathaniel Smith (njs) wrote :

That's great that Ocular works, but it's irrelevant. We know that there is something special about the file evince is generating -- probably something to do with font embedding -- that is triggering this bug.

But that doesn't mean that evince is buggy. It might be that evince and ocular are both generating correct files, but those files are different, and something in the difference is running into a cups bug. Or maybe not, but it's important to figure out, because if so then the correct fix is to teach cups to handle these files, not to encode quirky rules about cups/printer bugs into all PDF implementations.

Revision history for this message
Francis (francisd) wrote :

I understand this bug is fixed by a fix released for the bug #443026 with the release of a new evince package (version 2.28.0-0ubuntu3) -> https://bugs.launchpad.net/ubuntu/+source/cups/+bug/443026/comments/13. Am I right?

My evince's package is version 2.28.1-ubuntu1 and I still have this bug. What should I do?

Thanks!

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

I have exactly the same problem here with an HP Color Laserjet 2605dn (Postscript PPD, see enclosed hp4.ppd file). When printing from evince as available in up-to-date karmic, it prints an error page :

ERROR: undefined
OFFENDING COMMAND: 0a
STACK: false, --mark-- ,

I tried this workaround : use epdfview. Epdfview is nice, it prints without problem on the same printer, but I can't access all the printer options with epdfview (for example, I can't access the recto/verso printer option from epdfview). Of course, we can use xpdf, but there is no graphical selection of the printer in the interface, which is quite annoying for our users, because we have multiple printers.

Revision history for this message
Francis (francisd) wrote :

Not all pdf are unprintable. I attach a bugged pdf into this bug report.

I remarked that most of the bug's subscribers are non-english. Can this bug be related to non-english character-set or something related to the locale used on the system/file?

Revision history for this message
Francis (francisd) wrote :

I also confirm that printing the pdf with Epdfview works.

Revision history for this message
Christoph Korn (c-korn) wrote :

Can someone please summarize the workaround/fix for this bug ?

I read all the comments but maybe I missed the point.

How can I print PDFs with evince on a Kyocera FS-1030D.

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

The only workaround for the moment is to use another PDF reader than evince (xpdf, epdfview, ...).

Revision history for this message
farchumbre (farchumbre) wrote :

I can confirm the bug. Evince can print some but not all pdf files after upgrading to ubuntu 9.10.
Before evince was able to print all types of pdf files.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you Adrian, I will backport that to karmic

affects: evince (Ubuntu) → cairo (Ubuntu)
affects: cairo (Ubuntu) → evince (Ubuntu)
affects: evince (Ubuntu) → cairo (Ubuntu)
Changed in cairo (Ubuntu):
status: Confirmed → Fix Committed
Changed in cairo (Ubuntu Karmic):
status: Won't Fix → Fix Committed
status: Fix Committed → Triaged
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Sebastien, if you apply/backport the patch, can you also switch back to PDF output, so that all problems for which we originally introduced outputting PDF are fixed again.

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

One additional isuue: Before trying to switch back to PDF output, check whether the patch also fixes bug #443026.

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

I can confirm that the fix works here. I was able to print all PDFs so far with my HP LJ 4100

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

Janne Hyötylä do you mean Adrian Johnson's patch of comment #50?

If so, let evince print into a PDF file ("Print to File" in the list of available printers) and print the resulting files with "lp <file name>" from a terminal window.

If they print out correctly, can you then please try to print all PDF and PostScript files attached to bug #443026 the same way and see whether they come out correctly (with images/graphics) for you?

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

Yes I meant Adrian's patch.
I put up a package with that patch into my PPA, so other people can test as well:
https://launchpad.net/~janne-hyotyla/+archive/jhyotyla

Printing to file and then with 'lp' fails with the original Ubuntu package but works with the one from the PPA (with PDFs from this bug report).

Unfortunately I cannot reproduce bug #443026 even with the unpatched cairo (i.e. the PDF gets printed correctly with the graph etc. on my printer in any case).

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

Janne Hyötylä, thank you for putting up this patch on your PPA. I will also ask the reporters of bug 443026 to test it with their printers.

Revision history for this message
Justin Mazzola Paluska (jmp-mit) wrote :

With Janne Hyötylä libraries, I can print the example XAFSPhoton_estimate.pdf document, but I can't print other PDFs, e.g., the attached paper I got from the ACM.

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 09 Nov 2009 18:07:46 +0100, Justin Mazzola Paluska <email address hidden>
wrote:

> With Janne Hyötylä libraries, I can print the example
> XAFSPhoton_estimate.pdf document, but I can't print other PDFs, e.g.,
> the attached paper I got from the ACM.

Printing your PDF works for me. It might be that you are experiencing Bug
#443026
there.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkr4ZSsACgkQ9dzZ3jarGGBxnACeLEcV1nQgUTDo6XMj5iuYQhD2
lEUAn0NCQhchrydsLGX2wJsKp+IXerJh
=pmHh
-----END PGP SIGNATURE-----

Revision history for this message
Justin Mazzola Paluska (jmp-mit) wrote :

Janne Hyötylä wrote:
> Printing your PDF works for me. It might be that you are experiencing Bug
> #443026 there

I don't think so -- my printer (a Brother HL-4070CDW) spits out a single
page saying undefined command "Q" (rather than the "0a" that others have
been reporting).

*sigh* I latched onto this bug because evince was causing my printer to
*crash* (as in the printer reboots itself), so having it print pages
with undefined command "tracebacks" is a start in the correct direction,
even if I still can't print.

Changed in cairo (Ubuntu):
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Merijn Schering (mschering) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

I have a hp color laserjet 2550L using the standard drivers and it's still not working. I updated ubuntu with the latest patches and I even restarted my computer. Still no GO. When I launch the print dialog the dialog hangs for a few seconds (greyed out) while fetching printer information. Then it comes back. When I hit Print the light on the printer flashes a couple of times but does nothing.
A fix is really important for me cause we run our business completely on Ubuntu workstations and we can't print our PDF invoices.

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

Workaround for everyone who has still the problem of printing PDFs from evince, especially if the packages of comment #56 (https://bugs.launchpad.net/ubuntu/+source/cups/+bug/419143/comments/56) do not help:

Install the package "okular" and use this program for viewing and printing PDF files.

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

Justin Mazzola Paluska, what does exactly happen if you print the file? Do you get an error message page? What does the page show? If you do not get an error message page, activate error message page printing via the front panel menus or the web interface (web interface needs printer to be connected via network). Then print again and post the message of the error message page here.

Please tell us also if you can print the file with alternative programs like okular or Adobe Reader.

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

Also a workaround is to set up PostScript printers with a PCL driver (pxlcolor, pxlmono, hpijs), if for your printer such a driver is not listed, use the "Generic" printer entries: "PCL 6/PCL XL" and if this does not work "PCL 5c" for color printers and "PCL 5e" for monochrome printers.

Revision history for this message
Justin Mazzola Paluska (jmp-mit) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

On 11/11/2009 03:53 AM, Till Kamppeter wrote:
> Justin Mazzola Paluska, what does exactly happen if you print the file?
> Do you get an error message page? What does the page show? If you do not
> get an error message page, activate error message page printing via the
> front panel menus or the web interface (web interface needs printer to
> be connected via network). Then print again and post the message of the
> error message page here.
>

When I the ACM paper I uploaded, I get an error page from my printer saying

    ERROR NAME:
        undefined
    COMMAND:
       Q
    OPERAND STACK;

Other papers crash the printer. Without printing anything, the printer
reboots.

I can print the same files using xpdf and lpr with no problems.
However, I'd prefer to use evince, given the interface for changing
options in lpr is rather baroque.

I'm printing over the network. My print job gets routed through a
network cups server (running Debian lenny), which then communicates with
the printer over IPP. It's a pretty standard configuration that worked
flawlessly in 8.10 and 9.04.
    --Justin

Revision history for this message
Justin Mazzola Paluska (jmp-mit) wrote :

OK, I just needed to print another paper. This one came from
http://www.iptps.org/papers-2006/Ford-UIA.pdf. The md5sum of the PDF
is: 505ec9dfeb58e97fa22975eb4876181d (just to make sure we're talking
about the exact same PDF).

Attached are the three pages that came out of my printer when I printed
all 6 pages using evince. You'll notice that page 1 is OK, page 2 is
incompletely rendered, and page 3 is the error message from my printer.
The rest of the pages are not printed.

xpdf + lpr printed the paper just fine.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Justin Mazzola Paluska, what is your printer model? My HP printers print the document and Ghostscript displays it correctly, too.

Revision history for this message
Filofel (filofel) wrote :

After this morning batch of patches (including various cups ones), I still have a Postcript crash too on my LaserJet 4 Si (using the recommended driver HP LaserJet 4 Plus v2013.111 Postscript).
The printer diagnoses this:

Error: Undefined
OFFENDING COMMAND: 0a

STACK:

-mark-
false

Revision history for this message
Justin Mazzola Paluska (jmp-mit) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

As I said in post #60, my printer is a Brother HL-4070CDW.

Revision history for this message
Alexis de Lattre (alexis-via) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Merijn,

The current status is "Fix Commited" and, as explained on the wiki https://wiki.ubuntu.com/Bugs/Status, it means "the changes are pending and to be uploaded soon". It doesn't mean that there is an updated package available in the official Ubuntu repositories (which would correspond to "Fix Released" status). So you should continue to wait for the fix to be available on your Ubuntu Karmic via the official repositories.

Revision history for this message
Merijn Schering (mschering) wrote :

Oops, sorry. I was so excited to see an evince and cups update just after that status change that I thought it meant this was in the repositories already. I'll just have to be patient and thanks for all the help!

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

The patch which fixes the issue has been out for more than a week now. What is blocking the arrival of an updated package in Karmic with the fix ?

Revision history for this message
Levente Torok (toroklev) wrote :

It is not related to a specific printer. Actually, evince cannot print on any of the printers.
I tried the latest evince version 2.29 too but it behaves exactly the same.
For this reason I switched back to the version that can be found in the repo (2.28)

Actually it is may be related to the bug #200988 .

Thanks:L

Revision history for this message
Levente Torok (toroklev) wrote :

For some reasons I had the impression that this is related to the
upgrade from 9.04. However I still don't know if it was but I got the
solution as:

rm $HOME/.gnome2/evince $HOME/.gnome2/accels/evince -Rf

And after that evince can print again nicely.

Lev

Revision history for this message
Merijn Schering (mschering) wrote :

>> rm $HOME/.gnome2/evince $HOME/.gnome2/accels/evince -Rf

Unfortunately that didn't work for me. Hopefully the fix will be released soon so I can stop working around with xpdf.

Revision history for this message
Paolo (capitanomifune) wrote :

Thunderbird prints PDF attachments with Evince! Only in Firefox does not print, or I'm wrong?

Revision history for this message
kvaml (kvamlnk) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

On Tue, 2009-11-17 at 17:02 +0000, Paolo wrote:
> Thunderbird prints PDF attachments with Evince! Only in Firefox does
> not
> print, or I'm wrong?
>
I have a PDF file that I open with evince, that will not print. I
believe that some PDF files do print OK. It depends on the stream of
instructions that evince sends to the printer. So far as I know, it
does not matter which application fed the PDF file to evince.

Revision history for this message
Levente Torok (toroklev) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Hi,

I tried to use evince 2.29 from http://live.gnome.org/Evince/Downloads
however it didn't solve my problem. I suggest you to take chance on this.
Or, okular (kpdf). printing is not that advanced (yet) but okular is
very nice either.

L

On Tue, Nov 17, 2009 at 4:52 PM, Merijn Schering <email address hidden> wrote:
>>> rm $HOME/.gnome2/evince $HOME/.gnome2/accels/evince -Rf
>
> Unfortunately that didn't work for me. Hopefully the fix will be
> released soon so I can stop working around with xpdf.
>
> --
> Printing from evince (and perhaps other GTK apps) to PostScript printers is broken
> https://bugs.launchpad.net/bugs/419143
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “cairo” package in Ubuntu: Fix Committed
> Status in “cups” package in Ubuntu: Invalid
> Status in “cairo” source package in Karmic: Triaged
> Status in “cups” source package in Karmic: Invalid
>
> Bug description:
> Binary package hint: cups
>
> When trying to print on an HP Laserjet 4100 (through network, no possibility to connect to USB) in karmic, A notification tells me that printing succeeded, but regarding of the document to be printed, only one page gets printed with the following error message (6 lines):
>
>
> ERROR: undefined
> OFFENDING COMMAND: 0a
>
> STACK:
>
> -mark-
>
>
> Other printers on the same network (e.g. OKI C7350) work flawlessly, also the same printer worked on intrepid and jaunty.
>
> WORKAROUND:
> Print from okular (KDE PDF viewer) or any other (non-gtk?) software.
>
> ProblemType: Bug
> Architecture: i386
> CupsErrorLog:
>  E [26/Aug/2009:11:46:23 +0200] CUPS-Add-Modify-Printer: Unauthorized
>  E [26/Aug/2009:11:59:45 +0200] CUPS-Add-Modify-Printer: Unauthorized
> Date: Wed Aug 26 12:02:29 2009
> DistroRelease: Ubuntu 9.10
> Lpstat:
>  device for bioz3-hp4100: socket://131.152.19.90:9100
>  device for bioz3-okic2: socket://131.152.19.56:9100
> MachineType: Dell Inc. Latitude D630
> Package: cups 1.3.11-2ubuntu1
> Papersize: letter
> PccardctlIdent:
>  Socket 0:
>   no product info available
> PccardctlStatus:
>  Socket 0:
>   no card
> PpdFiles:
>  bioz3-okic2: Oki C5900 Foomatic/Postscript
>  bioz3-hp4100: HP LaserJet 4100 Series v.3010.107 Postscript (recommended)
> ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-6-generic root=UUID=a4e3ce99-2ce1-4bfa-b256-0135ea2c2244 ro quiet splash
> ProcEnviron:
>  PATH=(custom, user)
>  LANG=en_US.UTF-8
>  SHELL=/bin/bash
> ProcVersionSignature: Ubuntu 2.6.31-6.26-generic
> SourcePackage: cups
> Uname: Linux 2.6.31-6-generic i686
> dmi.bios.date: 07/23/2007
> dmi.bios.vendor: Dell Inc.
> dmi.bios.version: A03
> dmi.board.name: 0KU184
> dmi.board.vendor: Dell Inc.
> dmi.chassis.type: 8
> dmi.chassis.vendor: Dell Inc.
> dmi.modalias: dmi:bvnDellInc.:bvrA03:bd07/23/2007:svnDellInc.:pnLatitudeD630:pvr:rvnDellInc.:rn0KU184:rvr:cvnDellInc.:ct8:cvr:
> dmi.product.name: Latitude D630
> dmi.sys.vendor: Dell Inc.
>

Revision history for this message
Alexis de Lattre (alexis-via) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

Here are my last tests :

- recently-released evince Karmic package version 2.28.1-0ubuntu1.2 with standard libcairo2 karmic package version 1.8.8-2ubuntu1 -> bug still present with "OFFENDING COMMAND: 0a" postscript error.

- recently-released evince Karmic package version 2.28.1-0ubuntu1.2 with libcairo from Janne Hyötylä's PPA (cf comment #56) version 1.8.8-2ubuntu1+lp419143 which includes Adrian Johnson's patch -> works like a charm, no bug !

So, let's go and update Karmic's libcairo with Adrian Johnson's patch !

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

And, by the way, the solution proposed in comment #74 (rm $HOME/.gnome2/evince $HOME/.gnome2/accels/evince -Rf) doesn't work for me either, I still have the postscript error. So the only working solution is Adrian Johnson's patch.

Revision history for this message
Loïc Minier (lool) wrote :

Is there a pure software test case for this fix? I'm not near a printer nor do I know whether my printer is affected, so I can't easily test the fix.

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

Loic: The problems appears to be that cairo adds a newline character (0x0A) at the end of any binary type 1 font definition in the PDF. This is the thing that the patch fixes, so you can check for that.

Since I'm not really familiar with the PDF file format, and the font definitions/declarations seem to be somehow encoded, I did the following:

* Open bug triggering PDF in evince (e.g. XAFSPhoton.. from this bug report)
* Print to file in PostScript format (this is to find out the font definitions)
* Print to file in PDF format (this triggers the bug)

* Open Postscript file and look for "/FontType 1 def", this starts the font definition.
* Go to the end of the hex output of this font (just before the lines with zeroes at least in my PDFs) and copy/note the last 10 characters (i.e. 5 8bit hex numbers) or so (this is so you can find the font def in the PDF).

* Open the printed PDF file in a hex editor and search for the noted hex sequence.
* This should be just before the string "endstream" in the PDF.

* If immediately after the noted hex sequence (i.e. the next hex number) is "0A", this is the bug.
* If it is any other value, the bug is fixed (basically the 0A is inserted additionally in the bug case, so the font definition is also 1 character longer).

I hope this helps and sorry if it's not suitable as a test case... as mentioned I'm not really an expert in PDF/PS.

Revision history for this message
Levente Torok (toroklev) wrote : Re: [Bug 419143] Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

What else could you do?
Install and see.

Lev

On Thu, Nov 19, 2009 at 12:07 AM, Loïc Minier <email address hidden> wrote:
> Is there a pure software test case for this fix?  I'm not near a printer
> nor do I know whether my printer is affected, so I can't easily test the
> fix.
>
> --
> Printing from evince (and perhaps other GTK apps) to PostScript printers is broken
> https://bugs.launchpad.net/bugs/419143
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “cairo” package in Ubuntu: Fix Committed
> Status in “cups” package in Ubuntu: Invalid
> Status in “cairo” source package in Karmic: Triaged
> Status in “cups” source package in Karmic: Invalid
>
> Bug description:
> Binary package hint: cups
>
> When trying to print on an HP Laserjet 4100 (through network, no possibility to connect to USB) in karmic, A notification tells me that printing succeeded, but regarding of the document to be printed, only one page gets printed with the following error message (6 lines):
>
>
> ERROR: undefined
> OFFENDING COMMAND: 0a
>
> STACK:
>
> -mark-
>
>
> Other printers on the same network (e.g. OKI C7350) work flawlessly, also the same printer worked on intrepid and jaunty.
>
> WORKAROUND:
> Print from okular (KDE PDF viewer) or any other (non-gtk?) software.
>
> ProblemType: Bug
> Architecture: i386
> CupsErrorLog:
>  E [26/Aug/2009:11:46:23 +0200] CUPS-Add-Modify-Printer: Unauthorized
>  E [26/Aug/2009:11:59:45 +0200] CUPS-Add-Modify-Printer: Unauthorized
> Date: Wed Aug 26 12:02:29 2009
> DistroRelease: Ubuntu 9.10
> Lpstat:
>  device for bioz3-hp4100: socket://131.152.19.90:9100
>  device for bioz3-okic2: socket://131.152.19.56:9100
> MachineType: Dell Inc. Latitude D630
> Package: cups 1.3.11-2ubuntu1
> Papersize: letter
> PccardctlIdent:
>  Socket 0:
>   no product info available
> PccardctlStatus:
>  Socket 0:
>   no card
> PpdFiles:
>  bioz3-okic2: Oki C5900 Foomatic/Postscript
>  bioz3-hp4100: HP LaserJet 4100 Series v.3010.107 Postscript (recommended)
> ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-6-generic root=UUID=a4e3ce99-2ce1-4bfa-b256-0135ea2c2244 ro quiet splash
> ProcEnviron:
>  PATH=(custom, user)
>  LANG=en_US.UTF-8
>  SHELL=/bin/bash
> ProcVersionSignature: Ubuntu 2.6.31-6.26-generic
> SourcePackage: cups
> Uname: Linux 2.6.31-6-generic i686
> dmi.bios.date: 07/23/2007
> dmi.bios.vendor: Dell Inc.
> dmi.bios.version: A03
> dmi.board.name: 0KU184
> dmi.board.vendor: Dell Inc.
> dmi.chassis.type: 8
> dmi.chassis.vendor: Dell Inc.
> dmi.modalias: dmi:bvnDellInc.:bvrA03:bd07/23/2007:svnDellInc.:pnLatitudeD630:pvr:rvnDellInc.:rn0KU184:rvr:cvnDellInc.:ct8:cvr:
> dmi.product.name: Latitude D630
> dmi.sys.vendor: Dell Inc.
>

Revision history for this message
farchumbre (farchumbre) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

well the patch doesn't seem to solve all the problems, I still have some pdf files that can't be printed

Revision history for this message
Chris Conway (cconway) wrote :

I as having this problem with an HP P4515x. Switching to the PCL driver as suggested in #64 works for me. I was previously using the "HP LaserJet P4010 Series Postscript" driver.

Revision history for this message
houdek.z (houdek-z) wrote :

I have this same problem with printing PDF on my Xerox Phaser 3117 (SpliX v 2.0.0).

Revision history for this message
alex.2 (c-tamburrino) wrote :

I have exactly this same problem.
The printer is Samsung ML-2855 Series, the driver is ML-2855ps.ppd, downloaded from internet http://www.samsung.com/uk/support/local/supportPrdDetail.do?prd_mdl_name=ML-2855ND# .

Revision history for this message
alex.2 (c-tamburrino) wrote :

I tried the solution in post #56, now it works.

Revision history for this message
Mark Edgington (edgimar) wrote :

One "workaround" for this which seems consistently to work for me is to first print it to another PDF file via cups-pdf, and then open the generated PDF file, and print it (all printing done via evince). This may mean that a "good" filter is being used by cups-pdf, which might be able to be adapted to solve the problem here. (?)

Revision history for this message
Mark Edgington (edgimar) wrote :

By the way, the updated libcairo2 (comment #56) packages do not solve the problem for me, whereas the printing twice (first via cups-pdf) workaround I mentioned does.

Revision history for this message
fbonsignori (fbonsignori) wrote :

My environment is: Ubuntu Karmic, Evince Document Viewer 2.28.1 (running on poppler 0.12.0), printer HP LaserJet 4050PS.
Workaround: change printer driver from recomended (HP LaserJet 4050 Series Postscript) to HP LaserJet 4050 - CUPS+Gutenprint v5.2.4.
The result is that I can print from evince without problems.

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

Loïc, the fix in Cairo seems to help most users. What about an SRU for Karmic to get this fix into Karmic?

Are the upstream developers of Cairo also aware that the fix does not solve the problem in all situations?

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

I confirm that the fix in cairo helps most users. I have deployed Janne Hyötylä's PPA (cf comment #56) on all the Ubuntu Karmic PCs in my company for sevel weeks now and it works great ; they are now able to print with evince on our HP Postscript printers. Some users here say it doesn't fix their printing problem, but it's probably a second bug with requires another fix.

Revision history for this message
renbag (renbag) wrote :

I can also confirm that the PPA packages with the libcairo fix work well with several karmic boxes installed inside a large network and with several samba printers. I had no particular problems reported by the users.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

> Are the upstream developers of Cairo also aware that the fix does not solve the problem in all situations?

No. Probably because it is a different bug.

If you think you've found a cairo printing bug I suggest the following:

1. First show that the PDF fails to print when cairo is part of the printing pipeline but prints correctly when cairo is not involved:

a) Check that using poppler to generate the PostScript then sending the PS file directly to the printer bypassing any cups filters works:
  pdftops file.pdf
  lpr -o raw file.ps

b) Then use cairo to convert the PDF to PS. This can be done by opening the file in evince and printing to a PS file. Print with "lpr -o raw". If this fails but (a) works it is a cairo bug.

c) Alternatively you can use evince to print to PDF then use pdftops to convert to PS. If this fails to print but (a) works it is a cairo bug.

2. Either report the bug on cairo bugzilla, send mail to the cairo list, contact me on #cairo or cc me on the Ubuntu bug.

3. Unless the bug can be reproduced on a LaserJet 4050, chances are I can't reproduce it as I don't have the same printer. So you will have to help me debug it. You can do this by:

a) Find the smallest simplest PDF file that reproduces the problem. Find which page it fails on and provide me with the cairo generated PS that fails and the poppler PS that works for that page and the printer error message.

b) Identify any patterns. Does it fail for every page in the PDF? Does it only fail on pages with images or certain fonts?

c) Find other PDFs that fail the same way. Look for patterns. Are they from the same PDF creator? Are they using the same font?

Revision history for this message
Merijn Schering (mschering) wrote :

Can anyone update me on when this fix is going to be released? It's been a while and I still have to use xpdf to print my incomming PDF invoices. It works but evince is much nicer then xpdf and I would like to use it again if it could print....

Revision history for this message
Janne Hyötylä (janne-hyotyla) wrote :

Merijn, you can use the packages from
https://launchpad.net/~janne-hyotyla/+archive/jhyotyla
for the time being. The fix is integrated there.

I added this info to the bug description so that it doesn't get lost in the comments.

description: updated
Revision history for this message
Merijn Schering (mschering) wrote :

Thanks! those packages work for me.

Revision history for this message
Filofel (filofel) wrote :

Janne,

Your workaround 2 (packages) worked just fine for me too.
I was experiencing the problem on both an HP 4250 and an HP LJ4 Plus rather than a 4100, btw.

Thanks alot!

Revision history for this message
mr_weasel (mr.weasel) wrote :

The fix packages on Janne's PPA worked for me too. Thanks. (I have a Brother HL5240DN printer.)
Incidentally, I noticed that the quality of the output for my PDF wasn't that good when printed from evince, with respect to the smallish fonts. (Looks like a resolution issue or quality setting because some vertical lines in the fonts are twice as wide as the same letter elsewhere.) So I tried printing it from okular and it came out much better (and darker too, which may indicate a quality setting). This might be something to do with translating between PDF and PS or something, or may not be. Dunno. Anyway thought it worth mentioning in case anyone else thinks their printout quality isn't that great.

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

This bug was fixed in the package cairo - 1.8.8-2ubuntu2

---------------
cairo (1.8.8-2ubuntu2) lucid; urgency=low

  * debian/patches/90_git_change_fix_binary_mode_new_lines_bug.dpatch:
    - git change to fix a pdf printing issue, thank Adrian Johnson
      (lp: #419143)
 -- Sebastien Bacher <email address hidden> Wed, 06 Jan 2010 10:59:01 +0100

Changed in cairo (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in cairo (Ubuntu Karmic):
status: Triaged → Fix Committed
assignee: nobody → Sebastien Bacher (seb128)
Revision history for this message
Sebastien Bacher (seb128) wrote :

the config.sub and config.guess changes are coming from lucid but should not be an issue there

Revision history for this message
Eero Aaltonen (ejn) wrote :

Evince seems to have trouble with .png and .jpg files in the pdf.

I installed the fixes in Janne's PPA. Did not fix problems with evince.

Printing works using both paths:
- pdftops, lpr -o raw
- evince save as ps, lpr -o raw

Revision history for this message
Filofel (filofel) wrote :

Not fully fixed for me either, after all.
Printing a PDF from the document viewer to an HP LJ4 Plus, I get a failure on the first page:

ERROR: invalidfont
OFFENDING COMMAND: definefont

STACK

/Font
-dictionary-
/LiberationSerif_00

Revision history for this message
florian.schwemin (florian-schwemin) wrote :

Fix doesn't work for me either (on 3 different machines)

Jobs vanish in nirwana. Only single pages work (sometimes)

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted cairo into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Karl Frisk (karl-frisk) wrote : Re: Printing from evince (and perhaps other GTK apps) to PostScript printers is broken

not fixed for me with the proposed cairo package.

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

It seems that the fix in Cairo solves the "0a" problem of the original poster (embedded fonts), but there are also other "0a" problems which are not covered (other embedded binary data, like pictures or so).

So we can approve the Cairo fix to at least help the users who cannot print files with embedded fonts, but we need to get Cairo completely fixed to cover all "0a" cases.

Revision history for this message
Luke Faraone (lfaraone) wrote :

I'd agree with Till, I was previously experiencing the "ERROR NAME; undefined
 COMMAND; 0a
OPERAND STACK; --marktype-- --booleantype--" problem, and the new cairo package fixes that for me.

Revision history for this message
Nick Davis (argoneus) wrote :

I still have this bug when printing certain PDFs in Evince. I try multiple printers as well, but nothing prints. Using lpr from command line prints the PDF fine.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for testing. So it seems that this update works and improves things, but isn't perfect yet. That's fine for moving to -updates then. Can you please file a new bug if printing is still broken with the updated cairo?

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cairo - 1.8.8-2ubuntu1.1

---------------
cairo (1.8.8-2ubuntu1.1) karmic-proposed; urgency=low

  * debian/patches/90_git_change_fix_binary_mode_new_lines_bug.dpatch:
    - git change to fix a pdf printing issue, thank Adrian Johnson
      (lp: #419143)
 -- Sebastien Bacher <email address hidden> Wed, 06 Jan 2010 10:59:01 +0100

Changed in cairo (Ubuntu Karmic):
status: Fix Committed → Fix Released
Revision history for this message
Karl Frisk (karl-frisk) wrote :

why open a new bug, when all info is here?

to repeat myself, the new cairo package DOES NOT fix THIS bug.

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

@Karl - as Till said in comment 109, "It seems that the fix in Cairo solves the "0a" problem of the original poster (embedded fonts), but there are also other "0a" problems which are not covered (other embedded binary data, like pictures or so).

So we can approve the Cairo fix to at least help the users who cannot print files with embedded fonts, but we need to get Cairo completely fixed to cover all "0a" cases."

And all the info is not here, if you have a PDF that will not print even with the new patch, you should attach it to this bug report, or preferably to a new bug report.

Revision history for this message
Karl Frisk (karl-frisk) wrote :

this pdf prints well using okular but printing from evince fails.
ubuntu 9.10, fully updated, printer: HP 5100 DTN

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

Karl Frisk, problem are file conversions which blow up your file more and more so that the PostScript sent to the printer is to big for the printer's memory. I have a LaserJet P3005 with extended memory and this printer prints the file but needs several minutes per page, probably due to the huge Postscript being sent. One can easily reproduce the problem without using CUPS:

First, your file:

till@till:~/ghostscript/gpl/testfiles$ ll 10.1.1.65.8661-1.pdf
-rw-r--r-- 1 till till 2256496 2010-03-04 12:49 10.1.1.65.8661-1.pdf
till@till:~/ghostscript/gpl/testfiles$

Then I print into a PDF file with evince:

till@till:~/ghostscript/gpl/testfiles$ ll x.pdf
-rw-r--r-- 1 till till 25530177 2010-03-04 13:15 x.pdf
till@till:~/ghostscript/gpl/testfiles$

This is 10 times bigger than the original. Now I convert this to PostScrip, using Poppler's pdftops utility (CUPS uses it, too):

till@till:~/ghostscript/gpl/testfiles$ ll x.ps
-rw-r--r-- 1 till till 103784255 2010-03-04 13:15 x.ps
till@till:~/ghostscript/gpl/testfiles$

This is another 4 times bigger. 100 MB are a lot for the memory PostScript printers usually have.

What has to be done here is the following:

evince should not re-render PDF (and also PostScript) files when printing, but simply send them to CUPS. If the user requests, N-up, reverse order, ... evince should send appropriate IPP attributes alog with the job instead of doing these actions by itself.

Sending the PDF file directly to CUPS ("lpr 10.1.1.65.8661-1.pdf") or only doing "pdftops 10.1.1.65.8661-1.pdf" leads to a much faster printout for me.

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

Karl Frisk, as your problem is not the one originally reported here, please file a bug on the evince package.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

I can reproduce the failure to print on my printer. The jpeg images are being uncompressed then recompressed with Flate in the cairo PDF output. Cairo 1.9.6 and Poppler git master contain a fix that embeds the original jpeg in the output so the file size will not blow up.

With cairo and poppler git master I get:

original file: 2,256,496 bytes
evince printed to PDF: 2,287,229 bytes
then converted to PS with pdftops: 3,353,194 bytes

This PS file prints on my printer.

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

Can this fix be applied to Lucid as a patch? This would solve a lot of printing problems.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

Probably not. It requires the cairo 1.9.6 development snapshot which still has a number of regressions that need to be fixed before 1.10.0 can be released. Patching cairo 1.8.10 is not feasible due to the large number of changes required.

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

Is it not possible to extract only the change for the embedded image handling in backport only that as a patch for the current Cairo?

Changed in cairo (Ubuntu):
status: Fix Released → Triaged
Changed in cairo (Ubuntu Karmic):
status: Fix Released → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :

unassigning myself since I'm not working on this issue

Changed in cairo (Ubuntu Karmic):
assignee: Sebastien Bacher (seb128) → nobody
Revision history for this message
Eero Aaltonen (ejn) wrote :

.jpgs in the pdf still seem to cause a problem. png files and vector graphics ok.

Is someone working on this? If this goes to lucid, expect to see angry mobs with pitch forks...

Revision history for this message
UeB (moritz-nadler) wrote :

For me the bug disappeared after upgrading to 10.04. So I can print with evince again and do not have to use okular for printing.

Revision history for this message
steba (ste-ba) wrote :

Just tried to print a 100 page PDF to HP LaserJet 4100DTN network printer accessible via CUPS. Data LED was blinking for some minutes, then the job just disappeared. I wouldn't consider this issue solved...

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

Needs Cairo and Poppler to get updated to the newest versions. See comment #119.

Changed in poppler (Ubuntu Karmic):
status: New → Invalid
Changed in poppler (Ubuntu):
status: New → Triaged
Revision history for this message
Thomy23 (thomas-stather) wrote :

Hello

I just want to confirm this bug in the latest release of lucid (x86), with:

cups 1.4.3-1ubuntu1.2
libpoppler-glib4 0.12.4-0ubuntu5
libpoppler5 0.12.4-0ubuntu5
poppler-utils 0.12.4-0ubuntu5
ievince 2.30.3-0ubuntu1.1

using acroread as an alternative (although its non-free) solves the problem.

Greets Thomas

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

Thomy23, can you post files which did not print out of evince for you?

Revision history for this message
Thomy23 (thomas-stather) wrote :

Hi

Unfortunately i can't do this because the documents contain confidential information. Can i help you in some other way to solve the problem?

Revision history for this message
Derrik Pates (demon-devrandom) wrote :

I have the same problem; my printer prints out a page when trying to print an affected PDF which reads:

PCL XL Error

        Subsystem: KERNEL

        Error: MissingData

        Operator: ReadImage

        Position: 15

This is with a Brother HL-2170W laser printer, with the PPD generated by foomatic. I'm also running lucid, and can reproduce the issue on both x86 and x86_64 systems (netbook and workstation, respectively).

Revision history for this message
Derrik Pates (demon-devrandom) wrote :

Also, as others mentioned, the same documents print perfectly via Adobe Acrobat Reader.

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

Derrik, your problem is bug 570027. I have already prepared the fix (in foomatic-db). I will upload it as soon as the beta freeze is over. For the time being set up an additional print queue using the "Generic PCL-5e printer" as make and model and hpijs-pcl5e as the driver.

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

Derrik, bug 570027 is fixed now.

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

Thomy23, can you take the application with which you created the confidential documents and create non-confidential sample documents? Or can you modify the confidential documents to remove the confidential data?

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

Although it's not this bug (the solution to the remainder of this bug lies in the info in comment #109), the file size blowing up issue should be fixed with Ubuntu 10.10 "Maverick Meerkat", which contains libcairo2 1.10.0-1ubuntu2. Karl, Eero and steba, can you test?

Revision history for this message
smarf (smarf) wrote :

Having 1.8.10-2ubuntu1 installed, this bug still affects me. I had no problem printing with Ubuntu 9.04, but 10.04 refuses to print some PDFs from evince. The hp LaserJet 2200 tells "getting data" all the time, but does not start printing - even for a 28 kb PDF.

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

smarf, can you attach the files which do not print?

Can you print these files using Maverick (try a live CD if you do not want to update).

Revision history for this message
Arthur Wiebe (artooro) wrote :

If this get's fixed in 10.10, can the fix be back-ported to 10.04 LTS?

I am in charge of a business deployment where we are experiencing this bug but we are sticking with the LTS release for obvious reasons.

Revision history for this message
steba (ste-ba) wrote :

I don't see this issue anymore with Ubuntu 10.10.

Revision history for this message
Mateusz Holysz (mateusz-holysz) wrote :

I would like to confirm the above mentioned problem in 10.10 issue. I have x64 version installed and I use Samsung ML 2010 printer.

Regards

MH

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

Everyone who has still problems, 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.

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

Note that this bug is only about the spurious "0a" in Cairo-generated PDF. It is only still open because there are still "0a" cases in Cairo. See comment #109.

If you have other problems with Cairo-generated PDF, please continue in bug 680628. Especially answer the questions of my previous comment there.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

If there are still cases of cairo causing "0a" errors I will need to see the PDF file to fix. Looking back over the comments there were a few comments saying they still had the "0a" error after the update but none of them supplied the PDF file that reproduces the problem.

summary: Printing from evince (and perhaps other GTK apps) to PostScript printers
- is broken
+ is broken ("0a" bytes inserted into PostScript output)
Revision history for this message
LEGOManiac (bzflaglegomaniac) wrote :

Four days ago I unsubscribed to this list as I hadn't had this problem in months and assumed it was fixed. Today, I tried printing a calendar and discovered the bug still exists.
I'm running Ubuntu 10.10, fully patched as of this afternoon (Dec. 11, 2010).
The problem surfaces when I try to this PDF from Document Viewer. I've had to resort to using Okular.

When I print it from Document viewer, the printer light flashes to indicate that it is receiving data, but nothing ever prints. Printing from Okular works fine.

For what it's worth, the calendar is formatted for 11x17" paper but I was trying to print it to legal size pages. I'm not sure if it's the printer or the computer that does the appropriate scaling, in case that has anything to do with it.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

calendar.pdf works for me on all the printers I have.

- What sort of printer do you have?
- Do you have problems printing other PDF files?
- Have you tried any of the steps in comment 95. Attaching the PS file that does not print with "lpr -o raw" would be helpful
- Is your printer configured to print PS errors?

Are you able to print PDFs created with gedit that use the same fonts as calendar.pdf? ie open gedit, enter some text, print to PDF ensuring that in the "Text Editor" tab of the print dialog the fonts used are NimbusSanL-Regular and NimbusSanL-Bold.

Revision history for this message
LEGOManiac (bzflaglegomaniac) wrote :

I'm using a Laserjet 2605dn. The problem was happening consistently (6 attempts) and continued after a reboot of the printer. I was also using Document Viewer 2.32.0 to view and print the calendar.

When Okular worked, I chalked it up to a problem with Document Viewer or some component thereof.

It's now about 5 hours later and I just tested it again but this time I *can* print it from Document Viewer.

I hate intermittent problems.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

If it is intermittent it is not this bug. I had intermittent problems with printing to my LaserJet 4050 after upgrading to 10.10. It turned out to be bug 229981 which I fixed by changing the connection type to AppSocket/HP JetDirect.

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

LEGOManiac, also note that this bug is only about spurious insertions of "0a" into the PostScript output. You can most easily find out about that if you activate error page printing in your printer, but this problem should always occur and not disappear after some hours as you have observed. So your problem is not the one described here.

Revision history for this message
Eero Aaltonen (ejn) wrote :

"0a" bug for pdf with embedded .jpg image

present in 9.10 (my computer)
NOT present in 10.04 (coworkers computer)

good job guys! (And I need a new computer)

Revision history for this message
mejo (jonas-freesources) wrote :

I'm having a similiar bug with a Brother HL 5270DN, regardless whether configured as USB or network printer. Printing PDFs with GTK applications, or printing from firefox, both sometimes result in one page being printed with the following content:

--8<--8<--8<--
ERROR NAME;
         undefined
COMMAND;
          Q
OPERAND STACK;
-->8-->8-->8--

This bug happens both on up-to-date Debian unstable and Ubuntu Natty. I already discover this bug with Debian for years, and unfortunately I now discovered it on Ubuntu Natty as well.

Changed in poppler (Ubuntu):
status: Triaged → Confirmed
Changed in cups (Ubuntu):
status: Invalid → Confirmed
Changed in cairo (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
mejo (jonas-freesources) wrote :

Forgot to mention, that same PDF documents that print this error with evince, print fine with okular.

Revision history for this message
Micah Gersten (micahg) wrote :

Reseting triage states

Changed in cairo (Ubuntu):
status: Confirmed → Triaged
Changed in cups (Ubuntu):
status: Confirmed → Invalid
Changed in poppler (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Lindsay (fmouse) wrote :

I'm also seeing this in Ubuntu Natty (11.04) when printing _some_ pages from Firefox to a Brother HL-5250DN. Other pages work OK. This may or may not be related to a long-standing problem with this printer whereby the 2nd and subsequent jobs sent to the printer without a printer power-cycle or printer reset will result in garbled text.

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

In Oneiric we will switch to Ghostscript for the pdftops filter, so the 0a byte contamnination should stop there.

Everyone who has still problem on Natty, please give exact instructions to reproduce the problem. Especially follow the instructiopns in the section "Capturing print job data" in https://wiki.ubuntu.com/DebuggingPrintingProblems.

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

AFAIK Firefox prints via Cairo, so no extra task needed.

Changed in firefox (Ubuntu):
status: New → Invalid
Changed in firefox (Ubuntu Karmic):
status: New → Invalid
Rolf Leggewie (r0lf)
Changed in cairo (Ubuntu Karmic):
status: Triaged → Won't Fix
Revision history for this message
svenmeier (sven-meiers) wrote :

I'm experiencing this problem on Ubuntu 11.10 oneiric with a PDF file printed from evince:

ERROR:
undefined
OFFENDING COMMAND:
 0
STACK:
-mark-
-mark-
-mark-
-mark-

The same file printed with Okular works fine.

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

svenmeier, can you post the PDF file with which you experience this problem? Can you also follow the instructions in the sections "CUPS error_log" and "Capturing print job data" of https://wiki.ubuntu.com/DebuggingPrintingProblems? Thanks.

Revision history for this message
svenmeier (sven-meiers) wrote :

PDF causing the issure.

Revision history for this message
svenmeier (sven-meiers) wrote :

printout as requested

Revision history for this message
svenmeier (sven-meiers) wrote :

Error log as requested.

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

svenmeier, the original bug reported here was that Poppler's pdftops is generating broken PostScript in your case foomatic-rip calls Ghostscript to turn PDF into PostScript. So I tried to isolate the problem with

pdf2ps printout

where pdf2ps is a simple wrapper script which comes with Ghostscript to turn PDF into PostScript and printout is your "printout" file. The resulting PostScript is broken, easy to see with

gs printout.ps

This is a bug in Ghostscript upstream which I have reported now as

http://bugs.ghostscript.com/show_bug.cgi?id=692679

Please subscribe to that bug report and supply additional information if the Ghostscript develkopers ask for it.

Revision history for this message
svenmeier (sven-meiers) wrote :

Hi Till, thanks for your analysis and forwarding the bug :).

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

I have reported Sven Meier's bug also on Launchpad as bug 890270 now, for an Oneiric SRU.

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

Official support for Ubuntu 11.04 "Natty Narwhal" has ended. Can we close this bug?

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

Yes, let us close this ...

Changed in poppler (Ubuntu):
status: Triaged → Invalid
Changed in cairo (Ubuntu):
status: Triaged → Invalid
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.