# HP178nw Header Buffer — source for version 1.2.3 I made this independent Mac utility after investigating intermittent gibberish printing on my HP Color Laser MFP 178nw. It collects the first 44 bytes of an Apple Raster print job before forwarding them, then streams the rest unchanged. The menu-bar app selects a separate buffered printer queue and remembers On/Off. Project page and notarized app: https://hp178nw.get-slurp.app/ The source is licensed under the MIT License in `LICENSE`. Use this experimental workaround at your own risk. Read `DISCLAIMER.txt` before installing or using it. The app also requires explicit acceptance of that notice on first use. I cannot inspect HP's proprietary firmware and have not measured long-term reliability. This is an independent project, not affiliated with or endorsed by HP. ## Build on a Mac You need macOS, Python 3.9 or newer, and Apple Command Line Tools or Xcode with a macOS SDK that can build for Intel and Apple silicon. The build uses only the Python standard library and native Apple tools. No pip packages, Homebrew, Apple Developer account, signing certificate, or notarization credentials are needed for a local build. If the developer tools are missing, run `xcode-select --install` and complete Apple's installation prompt. Check `python3 --version` before continuing. Open Terminal in the extracted source folder, then run: ```sh python3 tests/test_offline.py python3 build.py ``` The output is in `build/`: - `HP178nw Header Buffer.app` - `Remove HP178nw Header Buffer.app` - The user guide, disclaimer, license, and two-page low-toner test PDF The build refuses to overwrite a nonempty output directory. To build again, choose a new path, for example `python3 build.py --output ./build-again`. Run the build as your normal user, without `sudo`. Building compiles and signs the two apps locally; it does not launch them, install helpers, change printers, send print jobs, register a Login Item, or contact a service. Both apps contain Intel and Apple silicon code. The launcher targets macOS 11 and later, but actual installation also requires a compatible HP178nw AirPrint profile and the system Perl and CUPS/PPD tools. Setup checks those prerequisites. CUPS has deprecated PPD-based drivers; future macOS versions may remove them. ## Local builds and signing The default build uses an ad-hoc signature. It is your local build, not the Developer ID signed and Apple notarized download from the project page. Its signature, compiled bytes and Apple notarization tickets will differ from that release. The app sources and tested filter are supplied here, but this is not a claim of a byte-for-byte reproducible signed release. If you have your own suitable signing certificate, you can use: ```sh python3 build.py --output ./build-signed --identity 'Developer ID Application: Your Name (TEAMID)' ``` This signs with your identity; it does not notarize or submit anything to Apple. No private key, password, API token, certificate or Keychain profile is supplied in this archive. Use the notarized app download if you want the prepared release. ## Install and keep it available after reboot Copy the main app to Applications, open it, and read the first-use notice. Proceed only if you accept it. Setup asks for administrator approval once to create the separate queue and install its filter. See `USER-GUIDE.txt` for installation, the test page and removal instructions. Leave the menu switch On and add the app to System Settings → General → Login Items & Extensions → Open at Login. It restores the saved choice when you log in. The installed printer queue and filter survive reboot and apply to jobs sent to the buffered queue even when the menu app is closed. In Printers & Scanners, choose the buffered printer as the default. Print dialogs can still choose the original queue, which bypasses this workaround. ## Source layout - `src/Runner.m`: native Cocoa menu, saved preference, notice and script launcher - `src/app.applescript`: printer selection and setup dialogs - `src/uninstall.applescript`: removal dialog - `payload/header-buffer`: the byte-preserving Perl filter - `payload/install.zsh`: checks and creates the separate AirPrint queue - `payload/session.zsh`: verifies installation and switches the user's default - `payload/uninstall.zsh`: removes the marked helper and queue - `payload/profile.pl`: validates an existing profile and patches its URF entries - `assets/`: icons, their drawing source and the sparse two-page test PDF - `build.py`: standalone local app build - `tests/test_offline.py`: synthetic filter and profile checks without printing The runtime sources and payload match the version 1.2.3 app release. The build script is adapted to this standalone layout. The filter's SHA-256 is `304674f1961d68abef5c2f4a632b34a91612b1da1290b051483efb10c77fdd6f`. `SHA256SUMS.txt` lists the original source-package files; editing them naturally changes their checksums. The build regenerates payload checksums inside its apps. If you deliberately modify the filter, update `expected_filter` in `payload/session.zsh` to its new SHA-256 as well, then rebuild. That installation is your changed version, outside the controlled printing comparisons described on the project page. Changing the menu's default printer does not move jobs already queued, and the buffering change is not a printer firmware update. The archive contains no real printed documents, traffic captures, printer logs, private printer profiles, or network addresses. The tests create synthetic data in temporary folders and never invoke the printer installer or print commands.