Skip to content

Commit 321b551

Browse files
committed
Readme update
1 parent e6ac5ba commit 321b551

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,36 @@ Prebuilt binaries & publishing
5656
- If you maintain a package registry release, ensure CI publishes prebuilt artifacts for all target Node.js versions and architectures you intend to support.
5757

5858
Build notes & troubleshooting
59+
5960
- Windows: Visual Studio Build Tools (MSVC) + Python are required to compile the native addon. Follow the Node.js native build tooling docs for setting up `node-gyp` on Windows.
6061
- Linux: `libcups2-dev` (or the distribution equivalent) is required to build the POSIX/CUPS native sources. On Debian/Ubuntu: `sudo apt-get install libcups2-dev build-essential python3`.
6162
- If `prebuild-install` cannot find a compatible prebuilt binary during `npm install`, the package will fall back to a source build and you will need the platform build toolchain installed.
6263

63-
Notes on driver option parsing (CUPS)
64-
- The POSIX implementation retrieves driver/option information from libcups. Historically the project used deprecated PPD helper APIs; the codebase has been migrated to use non-deprecated libcups APIs and, where available, `cupsCopyDestInfo`-style calls to gather richer printer driver metadata. Builds against older libcups that lack newer APIs will fall back to a conservative mapping of the destination options (name → value).
64+
Notes on CUPS API requirement and driver option parsing
65+
66+
- Minimum libcups requirement: This project requires the destination-based CUPS APIs introduced in CUPS 1.6. Practically, that means the build environment must provide the modern destination APIs (for example, `cupsCopyDestInfo`) via the development headers (`libcups2-dev` or equivalent). In short: libcups >= 1.6 is required.
67+
68+
- Rationale: The PPD helper family (e.g., `cupsGetPPD`, `ppdOpenFile`, `ppdMarkDefaults`, `cupsMarkOptions`, `ppdClose`) were deprecated in CUPS 1.6 in favor of destination-based APIs. Requiring the modern APIs avoids deprecated behavior, gives richer and more consistent printer metadata, and simplifies the native implementation.
69+
70+
- Verification commands (run on Linux/WSL to confirm headers and version):
71+
72+
```bash
73+
# Check libcups pkg-config version (if available)
74+
pkg-config --modversion libcups || pkg-config --modversion cups
75+
76+
# Search for destination API symbol in headers
77+
grep -nR "cupsCopyDestInfo" /usr/include 2>/dev/null || echo 'cupsCopyDestInfo not found in /usr/include'
78+
79+
# Search for deprecated PPD helper symbols (optional)
80+
grep -nR "cupsGetPPD\|ppdOpenFile\|ppdMarkDefaults\|cupsMarkOptions\|ppdClose" /usr/include 2>/dev/null || echo 'ppd helper symbols not found in /usr/include'
81+
```
82+
83+
- CI note: Update your CI runners to install the CUPS development package (for example `libcups2-dev` on Debian/Ubuntu) before building and running integration tests. The repository's integration tests that exercise POSIX bindings require those headers/libraries.
84+
85+
- Compatibility guidance: By design, this repository requires destination-based CUPS APIs (libcups >= 1.6). If you need to support very old systems that lack these APIs, consider one of the following:
86+
- Provide a compatibility branch or patch that implements a fallback using older PPD helpers (note: those APIs are deprecated and brittle).
87+
- Ship prebuilt binaries for the older target environments you need to support.
88+
- Encourage users on older systems to upgrade libcups or use a newer distribution image.
6589

6690
Contact
6791
- Issues & PRs: https://github.com/ssxv/node-printer

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ssxv/node-printer",
33
"version": "0.1.4",
4-
"description": "A modern N-API Node.js addon for printer access (Windows PoC).",
4+
"description": "Cross-platform N-API native printing bindings for Node.js (Windows & POSIX/CUPS). Requires Node.js >=18 and libcups >=1.6 for POSIX builds.",
55
"main": "printer.js",
66
"scripts": {
77
"install": "prebuild-install || node-gyp rebuild",

0 commit comments

Comments
 (0)