NetworkPrinter Plugin: Netzwerkdrucker direkt per IP anbinden#257
Open
Avatarsia wants to merge 14 commits intoOpenXE-org:masterfrom
Open
NetworkPrinter Plugin: Netzwerkdrucker direkt per IP anbinden#257Avatarsia wants to merge 14 commits intoOpenXE-org:masterfrom
Avatarsia wants to merge 14 commits intoOpenXE-org:masterfrom
Conversation
…nting Implements RFC 8011/8010 binary IPP protocol: IppEncoder handles binary encoding/decoding of Print-Job and Get-Printer-Attributes requests; IppDriver wraps it as a DriverInterface with full support for duplex, color, tray, media, staple, orientation and copies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… settings UI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e, IPP media keywords Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r null checks - EscPosDriver.php: Added PHPDoc for constructor and all public methods - LprDriver.php: Added PHPDoc for constructor and all public methods, @throws annotations - IppStatus.php: Translate class doc and query() to German - SnmpStatus.php: Translate all docs to German (class, methods, parameters) - StatusMonitor.php: Translate class doc and all method docs to German, fix constructor PHPDoc, remove redundant variable initialization - IppEncoder.php: Translate class doc and all public method docs to German - IppDriver.php: Fix English comment on line 79 to German - ConnectionTest.php: Add null check for supply['percent'] in supplies loop Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nitization, file size limit - NetworkPrinter: port range (1-65535), blocked hosts (SSRF), loopback block - NetworkPrinter: timeout clamped to 1-300s, file size limit 100MB - IppEncoder: encodeAttribute truncates name/value at 65535 bytes (pack overflow) - LprDriver: queue name sanitized (removes non-alphanumeric), rand -> random_int Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…date testConnection path - Replace string-based blocklist in validateSettings() with IP normalization via gethostbyname/ip2long/filter_var to block octal, hex, dword and IPv6-mapped addresses - Add validateSettings() call to testConnection() to close SSRF via test button - Remove raw OS error string ($errstr) from user-facing ConnectionTest message - Add 65535-byte truncation guard on IPP continuation attribute values in IppEncoder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…check The test_connection button used typ=submit which created a separate <form> that triggered OpenXE's POST-Redirect-GET pattern, losing the POST data. Replaced with typ=custom + renderTestButton() that performs an inline TCP connect check during page render. Shows green/red status indicator with response time. Points user to existing "Testseite drucken" button for actual print testing.
New opt-in feature to combine two A5 labels onto a single A4 sheet (label 1 on top half, label 2 on bottom half, portrait A4). Settings (per printer, all default off): - batch_2up: master switch to enable batching - batch_timeout: seconds to wait for second label (default 30) - batch_rotation: auto | none | cw | ccw (default auto) Behavior when batch_2up is enabled: - First label is stored in file-based queue (/tmp/np_batch_*) - Second label within timeout: both combined on one A4 sheet - Single label after timeout: printed alone on top half of A4 - Per-user + per-printer queue isolation Uses existing FPDI (www/lib/pdf/fpdi.php) for PDF import, no new dependencies. Labels are auto-scaled to fit target area while preserving aspect ratio; rotation handles portrait/landscape mismatch. Tested with Kyocera ECOSYS M5526cdw via IPP, A4 paper with 2x A5 adhesive labels.
Add classes/Modules/NetworkPrinter/Bootstrap.php plus a README that documents the wrapper. The NetworkPrinter library itself stays where it is under www/lib/Printer/NetworkPrinter/: it uses global class names and require_once chains, external callers rely on those paths, and the library is already pending upstream as OpenXE-org#257. The Bootstrap exposes a 'NetworkPrinterFactory' service via the OpenXE DI container so other modules (e.g. LexwareOffice or a future invoice-print integration) can resolve a configured NetworkPrinter instance without touching the require_once chain. Zero changes to the library itself. The wrapper is purely additive and survives an upstream merge of PR OpenXE-org#257 unchanged because it only references paths, not symbols. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Neues Drucker-Plugin das Netzwerkdrucker direkt per IP-Adresse anspricht.
Ersetzt die Abhaengigkeit von der nicht mehr hergestellten Adapterbox-Hardware
und dem Windows-Druckerspooler.
Unterstuetzte Protokolle:
Druckoptionen (Duplex, Farbe, Schacht, Format, Heftung)
Features:
Kompatibilitaet:
Getestet mit Kyocera ECOSYS M5526cdw (IPP + RAW).