Skip to content

Fixes for HP LaserJet Pro P1102 - #3

Open
hrach wants to merge 3 commits into
faradayfury:mainfrom
hrach:fix-p1102-printing
Open

hrach wants to merge 3 commits into
faradayfury:mainfrom
hrach:fix-p1102-printing

Conversation

@hrach

@hrach hrach commented Oct 9, 2026

Copy link
Copy Markdown

Match foo2zjs ZjStream output for HP LaserJet models in rastertozjs

An HP LaserJet Pro P1102 accepted jobs from rastertozjs and printed
nothing. For the HP models (-z1, -z2, -z3), foo2zjs differs from
rastertozjs in two ways. Neither changes the printed image:

  • foo2zjs runs with -P, which leaves out the START_PLANE/END_PLANE
    chunks around the page data. These chunks only label the data as the
    black plane. The P1102 expects the page data without them.
  • foo2zjs forces JBIG MX = 0. JBIG is lossless, and MX only limits the
    encoder's adaptive template search. The compressed bytes change, the
    decoded page does not. The foo2zjs ChangeLog (2011-11-12) records a
    firmware bug in the P1102 and CP1025 that needs MX = 0.

The Minolta 2300DL model keeps plane 4 and MX = 16.

Checked by decoding both streams with foo2zjs's zjsdecode for the same
A4 page: the chunk and item layout now matches foo2zjs -z2 -P -L0. Not
yet confirmed on a printer.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

Print to HP LaserJet Pro P1102/P1102w through rastertozjs

The P1102 PPDs were unchanged Foomatic PPDs whose cupsFilter is
foomatic-rip. macOS has no foomatic-rip, so adding the printer in
System Settings failed with "The software for the printer was installed
incorrectly". The PPDs now hand CUPS raster to rastertozjs.

rastertozjs reads the model from the PPD's *cupsModelNumber (2 = HP Pro),
because CUPS does not put PPD defaults into the job options. A "Model"
job option still overrides it. The model selects the P1102 variant of
the job and page headers; it does not change the image.

The PPDs also set 1200x600 dpi, the only resolution foomatic-db allows
for these printers; it excludes 600x600. This sets the printed image:
cgpdftoraster renders 1200 pixels per inch horizontally, and rastertozjs
sends them as two pixels per 600 dpi dot (VIDEO_BPP 2). Without a
HWResolution setting, cgpdftoraster renders at 100 dpi.

The other ZjStream PPDs still call foomatic-rip and all claim
*cupsModelNumber 2. Each needs its own model number (from the -z flag in
its FoomaticRIPCommandLine) before it is switched to rastertozjs.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

Mark HP LaserJet Pro P1102 as verified on real hardware

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

hrach and others added 3 commits October 9, 2026 10:13
An HP LaserJet Pro P1102 accepted jobs from rastertozjs and printed
nothing. For the HP models (-z1, -z2, -z3), foo2zjs differs from
rastertozjs in two ways. Neither changes the printed image:

- foo2zjs runs with -P, which leaves out the START_PLANE/END_PLANE
  chunks around the page data. These chunks only label the data as the
  black plane. The P1102 expects the page data without them.
- foo2zjs forces JBIG MX = 0. JBIG is lossless, and MX only limits the
  encoder's adaptive template search. The compressed bytes change, the
  decoded page does not. The foo2zjs ChangeLog (2011-11-12) records a
  firmware bug in the P1102 and CP1025 that needs MX = 0.

The Minolta 2300DL model keeps plane 4 and MX = 16.

Checked by decoding both streams with foo2zjs's zjsdecode for the same
A4 page: the chunk and item layout now matches foo2zjs -z2 -P -L0. Not
yet confirmed on a printer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The P1102 PPDs were unchanged Foomatic PPDs whose cupsFilter is
foomatic-rip. macOS has no foomatic-rip, so adding the printer in
System Settings failed with "The software for the printer was installed
incorrectly". The PPDs now hand CUPS raster to rastertozjs.

rastertozjs reads the model from the PPD's *cupsModelNumber (2 = HP Pro),
because CUPS does not put PPD defaults into the job options. A "Model"
job option still overrides it. The model selects the P1102 variant of
the job and page headers; it does not change the image.

The PPDs also set 1200x600 dpi, the only resolution foomatic-db allows
for these printers; it excludes 600x600. This sets the printed image:
cgpdftoraster renders 1200 pixels per inch horizontally, and rastertozjs
sends them as two pixels per 600 dpi dot (VIDEO_BPP 2). Without a
HWResolution setting, cgpdftoraster renders at 100 dpi.

The other ZjStream PPDs still call foomatic-rip and all claim
*cupsModelNumber 2. Each needs its own model number (from the -z flag in
its FoomaticRIPCommandLine) before it is switched to rastertozjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hrach

hrach commented Oct 9, 2026

Copy link
Copy Markdown
Author

This change is part of the following stack:

Change managed by git-spice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant