Skip to main content
Skip table of contents

Binary Find & Replace

Binary Find & Replace lets administrators fix or patch print job streams before they are parsed by MyQ. It works by applying a sequence of hexadecimal find-and-replace rules to each job at the byte level, targeting specific PDL commands (PCL, PJL, PostScript) as they enter a queue. Rules are defined per queue, run in a single streaming pass, and take effect immediately on save — no service restart required.

Warning!
This feature manipulates raw byte streams. A misconfigured rule can corrupt a print job or make it unprintable. Test in a non-production queue first. You should be comfortable working with hex data and the relevant PDL (PCL, PJL, PostScript).


Enabling Binary Find & Replace

The feature is disabled by default. To enable it, follow these steps.

  1. Modify config.ini in the application data director (default: C:\ProgramData\MyQ) to include these lines:

    CODE
    [JobProcessor]
    binaryFindReplaceEnabled=true
  2. Restart all MyQ services with Easy Config.

This enables Binary Find & Replace and creates the directory BinFindReplace in the application data directory, if it does not exist.

To disable the feature, set binaryFindReplaceEnabled=false and restart all MyQ services.


Using the Replacement Rules File

Create Config.json in the BinFindReplace folder inside the data directory (e.g., C:\ProgramData\MyQ\BinFindReplace\Config.json). Changes to the file take effect immediately, and no service restart is required. If the file is invalid, an error is logged and the entire file is skipped.

Example:

CODE
{
  "queues": {
    "Default": ["FixTraySelection", "InjectWatermarkHeader"],
    "Web": ["GlobalBanner"]
  },
  "filters": {
    "FixTraySelection": {
      "find": "1B266C3148",
      "replace": "1B266C3248"
    },
    "InjectWatermarkHeader": {
      "find": "40504A4C20454E544552",
      "replace": "40504A4C2053455420555345523D2241646D696E220D0A40504A4C20454E544552"
    },
    "GlobalBanner": {
      "find": "1B452A",
      "replace": ""
    }
  }
}

Filters are defined in the Config.json file, with a unique name and a pair of find–replace strings. To delete the matched bytes, use an empty string as the replace value (as for GlobalBanner in the example).

Filters in each queue array are applied in sequence, each operating on the output of the previous one, in a single pass over the print file. Additional filters can be added with no performance cost. The result is streamed directly to output without buffering the full job. A filter ID can appear multiple times in a queue array, in any combination with other filters.

Field Reference

Field

Type

Description

queues

Object

Maps queue names (case-sensitive) to an ordered array of filter IDs. Queues not listed are unaffected.

filters

Object

Named filter definitions; where each key is a filter ID and each value is a find/replace pair.

find

String

Hex bytes to find. Must be non-empty and even-length, and is case-insensitive.

replace

String

Hex bytes to substitute. An empty string deletes the matched bytes. Must be even-length, and is case-insensitive.

Note the following requirements:

  • Hex characters only: 0–9, a–f, A–F, case-insensitive

  • The strings find and replace must contain a whole number of bytes (2 hex characters per byte)

  • The find string cannot be empty.

  • The values for find and replace must be different.

  • Every filter ID in queues must be defined in filters.

  • Maximum size for each find and replace value is 256 KB.

  • The output of any single filter cannot expand to more than 64× the size of its input.


Logging

Events related to this feature appear in MyQ > Log, identified with the text Binary Find & Replace.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.