Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support config, data substitutions client-side #1256

Closed
tresf opened this issue Apr 19, 2024 · 1 comment · Fixed by #1258
Closed

Support config, data substitutions client-side #1256

tresf opened this issue Apr 19, 2024 · 1 comment · Fixed by #1258
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Apr 19, 2024

A growing complaint of clients is the inability to control certain printer preferences when the website developer is reluctant to do so.

Use-cases:

... in both cases, the customer is unable to remedy the situation because of reluctance of the website developer to add custom label sizes.

Proposed solution:

  • The proposed solution is to add a JSON mapping file called substitutions.json that allows the JSON messages from the websocket to be intercepted and overridden prior to printing.

Proposed JSON format:

[{
 "use": {
  "config": { "size": ... },
  "data": { "options": ... }
 },
 "for": {...}
}]
  • Prior to processing the JSON received from the websocket, QZ Tray will look for for in the sent data and replace it with use.
  • The operation will be logged to the QZ Tray console to ensure that this operation is well-known for diagnostic purposes.
  • The substitutions.json file will be removed (or renamed) on reinstall to ensure a vanilla experience between reinstalls.

TODO:

  • Ensure it does not break signature calculation.
  • Implications of allowing more copies, changing data (e.g. tickets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant