Bug 142220 - KPrinter fails to parse PPDs and shows incorrect printer options, but CUPS itself works correctly with same PPDs
Summary: KPrinter fails to parse PPDs and shows incorrect printer options, but CUPS it...
Status: CLOSED WORKSFORME
Alias: None
Product: kdeprint
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: HI major
Target Milestone: ---
Assignee: KDEPrint Devel Mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 12:49 UTC by Andreas Koch
Modified: 2008-12-31 20:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
PPD HP LaserJet 2430 DTN (65.89 KB, text/plain)
2007-02-26 12:50 UTC, Andreas Koch
Details
Screen capture of incorrect KPrinter properties dialog (46.68 KB, image/jpeg)
2007-02-26 12:51 UTC, Andreas Koch
Details
PPD for Lexmark Optra T610n printer, works in CUPS but fails in KDEPrint (39.63 KB, text/plain)
2007-02-27 13:49 UTC, Andreas Koch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Koch 2007-02-26 12:49:34 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
Compiler:          gcc 4.1.1 
OS:                Linux

Recent versions of KDEPrint appear to be no longer able to parse PPDs that were handled successfully before and continue to be processed successfully by CUPS 1.2.6.

Applications such as kprinter output a message

    kdeprint: WARNING: PPD syntax error, PPD parse failed

and then no longer show the correct options in the printer-specific options dialog. CUPS itself continues to handle these same PPDs correctly and processes the right options when printing from the command line.

As an example, I attach a PPD for a HP LaserJet 2430 DTN PostScript printer. To demonstrate the problems, consider the selection of the paper input tray. The PPD defines the following trays, which are also recognized by lpoptions -l

...
InputSlot/Media Source: *AutomaticallySelect Tray1 Tray2 Tray3_500
...

However, kprinter no longer shows these names in the Paper source property, but instead uses the (arbitrary?) names Upper Tray, Lower Tray, Multi-Purpose Tray and Large-Capacity Tray (see attached screenshot). Selecting one of these options has no effect, sheets are always pulled from the default defined in the PPD (Tray3_500).

I have checked a few more reports in bugs.kde.org. Initially #100201 seemed to be most appropriate. However, that bugs states:

``More recent versions of CUPS have become more strict with PPD parsing. They wont any longer tolerate PPDs which dont comply with the Adobe PPD Specification.''
 
While cupstestppd does indeed find some errors in the PPD:

/etc/cups/ppd/Tengwar.ppd: FAIL
      **FAIL**  Bad Resolution choice 600x600x2dpi!
                REF: Page 84, section 5.9
        WARN    Line 491 only contains whitespace!
        WARN    DefaultLeadingEdge has no corresponding options!
        WARN    DefaultHalftoneType has no corresponding options!
        WARN    Protocols contains PJL but JCL attributes are not set.
                REF: Pages 78-79, section 5.7.

all options are shown correctly in the CUPS printer configuration page and command line printing from CUPS itself works _perfectly_. For example, to select the input source,

    lp -d tengwar -o media=tray2 test1.pdf

does have the desired effect. So the difficulties appear to be at the KDE side of things. The same effect also occurs with other PPDs for the same printer (e.g., the one in the foomatic data base) or PPDs for different printers (e.g., one for a Lexmark Optra T610n printer, which also worked correctly in prior versions of KDE).
Comment 1 Andreas Koch 2007-02-26 12:50:42 UTC
Created attachment 19826 [details]
PPD HP LaserJet 2430 DTN
Comment 2 Andreas Koch 2007-02-26 12:51:28 UTC
Created attachment 19827 [details]
Screen capture of incorrect KPrinter properties dialog
Comment 3 Kurt Pfeifle 2007-02-27 12:26:49 UTC
I confirm this bug.

I recently experienced a similar situation, but had no time to investigate further. (And right now I've neither time [or even a Linux PC system] to do so.)

If this is now biting other users as well, this is a serious problem. (I initially thought it may be only a local problem of the box I was using at the time.)

----------
[AFAIK, KDEPrint does not use the CUPS API to parse the PPDs; it does "its own thing", but I can't remember the details.]
Comment 4 Kurt Pfeifle 2007-02-27 12:32:56 UTC
Additional thought:

HP have submitted their "For Macintosh only"-tagged PPDs to Linuxprinting.org since some time already. 

They seem to work just fine for CUPS/Linux too, but nevertheless I mildly complained, because they may lead to user confusion. They also contain some Apple-specific statements and paths [which normally should be ignored by any PPD-processing application if they don't understand them]. Now I wonder if this could contribute to this bug?

Andreas, can you check if this is the case (that all failing PPDs in KDEPrint are "For Macintosh only" ones)?
Comment 5 Andreas Koch 2007-02-27 13:48:18 UTC
No, a PPD for a a Lexmark Optra T610n PostScript laser printer shows the same symptoms. For reference, I also attach that PPD, which works perfectly in CUPS.

So the problem appears to extend beyond any possible Mac-isms in the HP PPDs.
Comment 6 Andreas Koch 2007-02-27 13:49:25 UTC
Created attachment 19840 [details]
PPD for Lexmark Optra T610n printer, works in CUPS but fails in KDEPrint
Comment 7 Andreas Koch 2007-03-05 19:29:24 UTC
The erroneous behavior reported here appears to be due to a -O3 optimization problem in GCC 4.1.1 (specifically, the Gentoo ebuild gcc-4.1.1-r3). When compiling kdelibs and kdebase with -O2 instead, KDEPrint does parse the PPDs successfully (kprinter doesn't output a warning), and shows the correct printer options in the Properties dialog.

Comment 8 Marco Cimmino 2007-05-12 10:31:23 UTC
Andreas why you have closed the bug?
Bug appears also in Kubuntu Feisty 7.04 for a lot of people and for a lot of variety of printers, like me with all canon pixma ip family.

All is compiled with gcc 4.1.2 but don't know if flag -O3 is responsible or not.
Closing as worksforme doesn't help us.

https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/99372
Comment 9 Andreas Koch 2007-05-12 14:25:40 UTC
> Andreas why you have closed the bug?

Cimmo,

in our case, the optimization level definitely made the difference. On the new system described above, switching from -O3 to -O2 removed the error. Our older systems, which were compiled with -O2 right from the start, never showed the symptoms at all. So, at least in the case of the HP and Lexmark PPDs I used, KDEPrint itself seems innocent.

It is of course possible that other, actual errors show up for other PPDs, such as the Canon PPDs you mention. In that case, you should open a new bug report here (with a possible link to this report) and attach your PPDs.
Comment 10 John Layt 2008-12-31 20:44:07 UTC
Closing old Resolved status bug.