OMR

Details on the Optical Mark Recognition (OMR) bar code type.

The code is typically used to control enveloping machines. It displays a vertical stack of horizontal lines at fixed distances, and the presence or absence of a line carries a machine-specific meaning. For example, enveloping machines may define a marker that means “collect page” if absent, or “insert the previously collected pages into an envelope now” if present.

Use the Code Value or Code Value Expression property to set the the individual markers. The string is expected to be a sequence of the characters “0” and “1”. The first character in the string represents the topmost line. In addition, the optional special character “P” can appear once in the string, representing an optional parity bit so that the total number of bits is even.

Note: An example of an OMR bar code can be seen in the Reports demo: OrderReport.4rp.

toBinaryString()

Note: toBinaryString() was created for the OMR bar code type, but can be used for all bar codes.

In the Code Value Expression property, you can use the PXML function toBinaryString() to compute the binary representation of a value. This function takes the following syntax:

String toBinaryString(Numeric value, Numeric length)
  • If the length of value is longer than length, value is trimmed from the left. For example, the result of toBinaryString(3,1) is 1.
  • If the length of value equals length, value is the binary value (without trimming or padding). For example, the result of toBinaryString(3,2) is 11.
  • If the length of value is shorter than length, value is padded with ‘0’ to the left to reach the length. For example, the result of toBinaryString(3,3) is 011.

Example

This expression (from the OrderReport.4rp design document in the Reports demo), produces the string 11000P1 on the first page of a one-paged report:

 “1”+toBinaryString(getTotalNumberOfPages("PageRoot")-getPageNumber("PageRoot")>0?0:1,1)+toBinaryString(getPhysicalPageNumber()-1,3)+"P1"=”11000P1”