Skip to content

Merge Dave Coffin's hbpl1.patch from 2014-04-05 to current foo2zjs. - #24

Open
JoesCat wants to merge 2 commits into
OpenPrinting:main-fixesfrom
JoesCat:foo2hbpl1
Open

Merge Dave Coffin's hbpl1.patch from 2014-04-05 to current foo2zjs.#24
JoesCat wants to merge 2 commits into
OpenPrinting:main-fixesfrom
JoesCat:foo2hbpl1

Conversation

@JoesCat

@JoesCat JoesCat commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Merge part of Dave Coffin's hbpl1.patch (located here): https://web.archive.org/web/20160515134331/http://cybercom.net/~dcoffin/hbpl/hbpl1.patch to current foo2zjs. Note that it is a merge since much has changed.

Only foo2hbpl1, foo2hbpl1-wrapper, and manuals added here since the other files like PPDs and xml files should be added to foomatic-db. Note edits and upgrades required to sync-up with current code base.

Merge part of Dave Coffin's hbpl1.patch (located here):
https://web.archive.org/web/20160515134331/http://cybercom.net/~dcoffin/hbpl/hbpl1.patch
to current foo2zjs. Note that it is a merge since much has changed.

Only foo2hbpl1, foo2hbpl1-wrapper, and manuals added here since the
other files like PPDs and xml files should be added to foomatic-db.
Note edits and upgrades required to sync-up with current code base.
@JoesCat

JoesCat commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

At this point - the above could be compared with the patch before modifications

foo2hbpl1.c points of interest:
- Added -z1 option to work with Xerox 6000 and 6010 which seems to have
  larger media list compared to the initial Dell C1250c, plus discovered
  COPIES=n works too (kept backwards compatibility for older printers).
- Added printer reset so we have printer in a known state before loading
  job, and another reset as housekeeping cleanup when finishing job. This
  only done for -z1 printers (don't know if reset works on -z0 printers).
- Break large print jobs into smaller jobs to keep within printer buffer.
  Printed large 82 page pdf without having to break it into small parts.
- Moved all Global variables into Job structure, this should make program
  compatible with multithreading, plus we can clean-up memory in error().
- Moved Streams into Job structure so we can clean-up memory in error(),
  this meant having to edit putbits() and friends to pass int n instead.
- Static const arrays put in global space to be shared amongst functions.
- Added static const everywhere to avoid loading unnecessary mem arrays.
- Added more options like in foo2zjs, eg: debug, save_toner. See main().
- Replaced clip option -u with -u, -l and -L to work similar to foo2zjs.
- Check for absurdly large clipping and avoid/compensate when necessary.
- Replaced several for loops with faster memset().
- Used strncpy and MAXSTREAM to avoid Stream buffer overflows.
- More info added to reca[], head[], body[] (from info in hbpldecode.c).
- Debug >= 9 prints time as "02/26/2026 12:34:56" for md5sum 'make check'
- getint() has more input checks.

script foo2hbpl1-wrapper, and man files foo2hbpl1.1, foo2hbpl1-wrapper.1
- Updated and upgraded options to work with this updated foo2hbpl1
@JoesCat

JoesCat commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

#21 can also be used for reference.

testing:

gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter -r600x600 -sDEVICE=pamcmyk32 -sOutputFile=- - <testpage.ps >testpage.za
./foo2hbpl1 -m1 -D9  <testpage.za >testpage.zm
cat testpage.zm > /dev/tcp/192.168.xxx.yyy/9100

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