IPDS

Intelligent Printer Data Stream™ (IPDS™) is IBM's host-to-printer data stream for Advanced Function Presentation™ subsystems. It provides an interface to all-points-addressable (APA) printers that makes possible the presentation of pages containing an architecturally unlimited mixture of different data types: high-quality text, raster image, vector graphics, and bar code.

IPDS incorporates the following functions:

IPDS functional divisions

IPDS architecture is divided into several functional areas, each of which contains a set of IPDS commands representing a major printer capability. This function set design allows IPDS to support a wide range of printer products. Product developers can match function set implementations to the specific needs of their product.

IPDS architecture is divided into several functional areas
Device control
Function set is composed of the IPDS commands that set up a page, communicate device controls, and manage acknowledgement protocol. The device-control function set is the only mandatory function set for IPDS printers, although not all DC1 orders are required to be supported.
Text
Function set composed of commands and orders (text controls) required to present text information on a page, page segment (stored command sequence), or an overlay (electronic form). The text function set contains two presentation text (PT) subsets: PT1 and PT2. Text printers support either subset. PT2 is a superset of PT1 and, therefore, all orders contained in PT1 are also in PT2.
IM image
Function set containing the IPDS commands required to present raster image data on a page, page segment, or an overlay.
IO image
Function set containing commands that present raster data (similar to IM image) but with additional functions.
Graphics
Function set composed of the IPDS commands and drawing orders required to present vector graphics on a page, page segment, or overlay. The graphics function set contains two drawing (DR) subsets: DR1 and DR2. Vector graphics printers support DR2, which is a superset of DR1.
Bar code
Function set composed of the IPDS commands required to present machine-readable bar code information on a page, page segment, or overlay.
Page segments and overlays
Function sets composed of the IPDS commands required to store and present IPDS constructs containing text, graphics, image, and bar code information. These stored constructs can be either page segments or overlays.
Loaded font
Function set composed of the IPDS commands necessary to load and delete font information.

Function-set requirements for IPDS

In order to claim support of the IPDS architecture, a product must do the following:

Return of function-set information

A host presentation services program determines the functional capabilities of an IPDS printer by issuing certain IPDS query commands to the printer and requesting an acknowledgement. The data that the printer returns in the acknowledge reply shows the printer type and model, details of the function sets supported, and a variety of printer characteristics.

The IPDS page environment

IPDS creates mixed-data pages within a hierarchy of presentation spaces. These presentation spaces are: physical page, logical page, and data blocks.

Physical page
The medium (typically paper) on which information is placed. The physical page has boundaries of width and depth that define the limits of the medium.
Logical page
The electronic representation of the page that is sent to the printer. The logical page is a rectangular area that might not be the same size as the physical page on which it is placed. Printing can only occur where the current logical page intersects the physical page (valid printable area).
Data blocks
Rectangular areas positioned on the logical page. Data blocks can be one of three types:
Note:
There is no text data block. Text can be positioned anywhere in the valid printable area. Data blocks can be positioned in relation to the text.

IPDS has a hierarchical relationship between a physical page, a logical page, and data blocks. In the following figure, the logical page boundaries do not correspond to the physical page boundaries.

IPDS has an hierarchical relationship between a physical page, a logical page, and data blocks.

One of the strengths of IPDS is that independent applications can create source data for each data block. The output of these independent applications is merged at the printer to create an integrated mixed data page. For example, text data could be produced on an editor, image data could be the output of a scanner stored in a folder, and graphics data could be produced by Business Graphics Utility. IPDS makes it possible to integrate application output rather than requiring the use of integrated applications.

Overlays and page segments

IPDS stores resources in the printer for later use. Overlays and page segments can be merged with the logical page before the logical page is printed on the physical page.

Overlay
Macro-like construct loaded by the host processor and sent to the printer's storage. An overlay can consist of any combination of text data, image block data, graphics block data, or bar code block data. An overlay contains the same type of presentation commands used in the logical page, but overlays are independent of the logical page environment. The major difference between overlays and logical pages is that overlays are stored until deleted but logical pages, if stored, are only stored until printed. Overlays are often used as electronic forms.
Page segment
This is like the overlay in makeup. The difference between a page segment and an overlay is that page segments are not independent of the page environment; they are merged with the logical page and assume the currently active environment.

Loaded fonts

A font is a set of characters in a particular type style and size. Fonts can be downloaded from the host or can be resident in printer storage. Downloaded fonts are called loaded fonts and come in one of the following configurations:

Coded font
A complete code page of graphic characters in a particular style. (A code page maps each character in a font to a numeric value or code point.)
Symbol set
A set of characters simpler in structure than a coded font. Symbol sets are used where typographic quality is not required. Many dot matrix printers and displays use symbol sets.

Coordinate systems

Xm, Ym coordinate system (physical page)

IPDS uses orthogonal coordinate systems to define any point on a page. Distances between these coordinate systems are measured in logical units or L-units rather than physical pels.

The Xm, Ym coordinate system is the physical-page coordinate system. The top-left corner of the physical page is always (0,0).

The printer defines the top of a physical page.

 Xm, Ym coordinate system (physical page)

The Xm, Ym coordinate system is fixed for each media size. IPDS commands cannot change the orientation of these coordinates.

Xp, Yp coordinate system (logical page)

The Xp, Yp coordinate system is the logical-page coordinate system. The origin of this system (Xp=0, Yp=0) is specified as an offset from the physical page origin (Xm=0, Ym=0) through the Load Page Position command. IPDS commands cannot change the orientation of the Xp, Yp coordinate system; it is always parallel to, but offset from, the Xm, Ym coordinate system.

The size of the logical page in the Xp dimension is called the Xp extent. The size of the logical page in the Yp dimension is called the Yp extent. The Xp, Yp coordinate system is used to locate data blocks on the logical page.

The coordinate system for overlays is the same as the Xp, Yp coordinate system for logical pages.

 Xp, Yp coordinate system (logical page)

I, B Coordinate System (Text)

The Inline, Baseline (I, B) coordinate system describes the placement of data blocks on the logical page. The printer places characters along the I-axis to form a line of text and places lines of text along the B-axis on the logical page. IPDS commands can change both the origin and the orientation of the inline and baseline axes.

As characters are developed on the page, the inline coordinate is incremented in the positive inline (or +I) direction. As lines are developed on the page, the baseline coordinate is incremented in the positive baseline (or +B) direction.

Note:
Characters are developed on a page in the direction in which they will be read (left to right, for example). The printer can actually place characters or lines on a page in various directions (as in bidirectional printing).

The coordinates of the first text position on the logical page are called the initial inline text coordinate (Io) and the initial baseline text coordinate (Bo). The coordinates of the current position on the logical page are called the current inline text coordinate (Ic) and the current baseline text coordinate (Bc).

The coordinates of the first text position on the logical page are called the initial inline text coordinate (Io) and the initial baseline text coordinate (Bo). The coordinates of the current position on the logical page are called the current inline text coordinate (Ic) and the current baseline text coordinate (Bc).

Processing IPDS commands

The structured field format of IPDS allows commands to be sent to the printer in a continuous stream. Each command is self-describing. The command length, identifier, flag byte, and data (not always present) are all part of each command. The printer-host conversation is carried on as if IPDS commands were processed in sequential order by the printer.

Every IPDS command contains a flag byte. The setting on the acknowledgement-required bit on this flag byte indicates the end of a command sequence to the printer. The printer then sends an acknowledge reply to the host, as illustrated in the following diagram:

Processing IPDS Commands

The IPDS command format

All IPDS commands are encoded in the following format:

Length Command Flag CID Data
Length
A 2-byte field that specifies the length of the command. This count includes itself, the command field, the flag byte and the optional correlation ID (CID), and data fields. The length field can range from X'0005' to X'7FFF'.
Command
A 2-byte field that specifies the IPDS command.
Flag
A 1-byte field that contains the IPDS command stream flags.
CID (correlation ID)
A 2-byte field that specifies an identifier for the command. A presentation services program can use any value between X'0000' and X'FFFF' for the correlation ID.
Data
Not present for all commands. If present, it contains specific orders, parameters, and data appropriate for the given command.

IPDS operating states

IPDS commands are defined within the context of printer operating states. The printer moves between these operating states during command processing. IPDS printers are state machines with the following operating states:

Home state
The initial IPDS operating state. The printer returns to home state at the end of each downloaded page, page segment, coded font, or overlay.

While in home state, the printer receives control and initialization commands to prepare for the print operation. In home state, the printer can also receive commands that delete resources or request the return of printer information to the host presentation services program.

Block states
State for establishing the initial processing conditions for a block of data and placing the block of data on the logical page, page segment or overlay. The printer can only enter a block state from page, page segment, or overlay states.
Page state
The operating state for printing a logical page. The printer enters page state from home state on receiving a Begin Page command and exits on receiving an End Page command.

In page state, the printer can receive commands that merge previously defined and loaded overlays and page segments with the current page information. The printer can also receive Write Text commands that position text on the logical page and can enter a block state to write image, bar code, and graphics blocks.

Overlay state
State that allows overlay data to be stored in the printer. The printer enters overlay state from home state on receiving a Begin Overlay command and exits on receiving an End Page command.

In overlay state, the printer can receive commands that merge previously defined and loaded overlays and page segments with the current page information. The printer can also receive Write Text commands that position text on the logical page and can enter a block state to write image, bar code, and graphics blocks.

Page segment state
State that allows page segment data to be stored in the printer. The printer enters page segment state from home state on receiving a Begin Page Segment command and exits on an End Page command.

In page segment state, the printer can receive Write Text commands that position text on the logical page and can enter a block state to write image, bar code, and graphics blocks.

Font state
State that allows the printer to receive downloaded coded-font data. The printer enters font state from home state on receiving a Load Font Control command.

While the printer is in font state, the Load Font command can send coded-font, character-raster pattern data to the printer. Receipt of an End command returns the printer to home state.

Any-state
Some IPDS commands can be received in any IPDS operating state. These commands do not change the IPDS operating state, with the exception of XOA Discard Buffered Data.

Default handling

Defaults are values used as control parameters when no other values are specified in the current command. IPDS defaults are called through omission or through values transmitted in the data field portion of commands. The IPDS default structure is normally hierarchical. General IPDS default rules are: