HP LaserJet 1200: every bundled driver except pxlmono prints endless "ERROR: undefined" pages on cups-filters 2.x; root cause: JCL handling split

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
backend

Research direction

Start by reviewing the attached working reference PPD, LJ1200-PCL5-PJL-FINAL2.ppd, and the foomatic-rip debug logs comparing the working and broken chains. Reproduce the PDF and PostScript filter paths with cups-filters 2.0.1 and foomatic-rip, then trace where the PJL wrapper is lost. Done means the LaserJet 1200 receives the PCL personality switch and prints correctly without the endless error pages.

Written by the indexing model from the issue text.

Description

Title
HP LaserJet 1200: every bundled driver except pxlmono prints endless
"ERROR: undefined" pages on cups-filters 2.x; root cause: JCL handling split
between pdftops and foomatic-rip (jobhasjcl bypass) + missing PJL personality
switch; pxlmono works but takes minutes per page.

Environment
Distro: <Manjaro/Arch, версия>, cups <версия>, cups-filters 2.0.1, ghostscript 10.x
Printer: HP LaserJet 1200 (2002), USB. Languages: PCL5e, PCL6; PostScript
interpreter active by default; requires PJL switch "ENTER LANGUAGE = PCL"
to enter PCL.
Symptoms
Gutenprint PCL drivers, foomatic ljet4/lj4dith, "raw" ljet4: printer outputs
endless sheets with a single "ERROR: undefined" line (PostScript interpreter
consuming PCL data).
Foomatic/Postscript, Generic PS: endless PostScript error sheets.
pxlmono: only driver producing correct pages, but minutes per page.
Root cause (verified on real binaries)
No bundled PCL driver emits the PJL personality switch
"ESC%-12345X@PJL ENTER LANGUAGE = PCL" + trailing UEL, so PCL data is fed
to the PS interpreter.
For foomatic PPDs carrying JCL keys the chain
pdftopdf -> pdftops -> foomatic-rip breaks the JCL twice over:
pdftops also reads the PPD and injects the PJL into its PostScript;
foomatic-rip receives input not starting with %!PS, sets jobhasjcl=1 and
skips its own JCL wrapper;
the injected PJL never reaches the device stream (consumed by the
rendering stage), so the ljet4 PCL output goes out without any PJL.
Reproduced with cups-filters 2.0.1 (Arch) and foomatic-rip 1.28.17 (Debian)
and 2.0.1 (Arch); foomatic-rip debug logs show "JCL:
%-12345X@PJL ENTER LANGUAGE = PCL" planned but absent from the device bytes.
Minimal working fix (reference PPD, 2 KB, "HP LaserJet 1200 ljet4+PJL (PCL5 fast)")
Remove all JCL keys from the PPD (no other component can inject PJL).
Embed PJL directly in FoomaticRIPCommandLine (executed only by foomatic-rip
via sh -e -c):
*FoomaticRIPCommandLine: "printf '\033\045-12345X@PJL ENTER LANGUAGE = PCL\n';
gs -q -dBATCH -dPARANOIDSAFER -dNOPAUSE -dNOMEDIAATTRS -dNOINTERPOLATE
-sDEVICE=ljet4%B%A%Z -sOutputFile=-%C -f -; printf '\033\045-12345X'"
Add direct PDF filter line (as Debian's pxlmono PPD already does):
*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"
so PDF bypasses pdftops entirely.
Verified: libcups ppdOpenFile; foomatic-rip 1.28.17 and 2.0.1; full PDF and PS
chains produce byte-identical device output with the PJL entry; real-world
print 5-10 s/page (pxlmono: ~20 min/page; all others: endless error pages).
Suggested upstream fixes
cups-filters/foomatic-rip: do not let the jobhasjcl heuristic drop the JCL
wrapper when no JCL actually reached the device; and/or pdftops should not
inject JCL when the following filter is foomatic-rip.
foomatic-db: add PJL init to the HP LaserJet 1200 / LaserJet 4 family PCL
entries (reference PPD attached).
Attachments
LJ1200-PCL5-PJL-FINAL2.ppd (2 KB, working reference)
foomatic-rip debug logs: working vs broken chain (jobhasjcl bypass)

printer_LJ1200_report_20261105.md
LJ1200-upstream-bug-draft.md

Dominant language
HTML
Stars
14
Forks
26
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenPrinting/foomatic-db

All issues in OpenPrinting/foomatic-db

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.