Advanced Function Presentation data stream

Advanced Function Presentation Data Stream is the application interface to Advanced Function Presentation™ (AFP™) based on the Mixed Object:Document Content Architecture–Presentation (MO:DCA–P). It is independent of both printers and operating systems.

AFP data stream is a structured data stream. Structured fields are used to define composed text pages, line format data, and a mixture of line and composed text data. The structured field is a self-identifying string of bytes containing data or parameters and must have an introducer, which contains a length field, an identifier, a flag, and a sequence number. This is followed by parameter bytes that contain control information or data to be printed.

AFP data stream is the application interface to Advanced Function Presentation (AFP) based on the Mixed Object:Document Content Architecture–Presentation (MO:DCA–P).
Length
A 2-byte field that specifies the length of the record (not including the 5A control character).
Identifier (ID)
A 3-byte field that specifies the type of the structured field.
Flag byte
A 1-byte field that specifies information about the data field.
Sequence number
A 2-byte field that identifies the record.
Control and data
A text control code, the name of an object, or coordinates for positioning an image or page segment. The control information is followed by the data to be printed.

Source programs that generate Advanced Function Presentation data stream

The following IBM® licensed programs generate Advanced Function Presentation data streams:

Advanced Function Presentation

Advanced Function Presentation data stream describes what the page of data looks like and refers to printer resource objects by name, assuming that they are resident on the system where the actual printing is to take place and not on the system where the output was spooled. The printer resource objects that are resident on the system are downloaded to the printer by the processor when needed.

The iSeries server uses the following objects when processing AFP data stream:

AFP data stream spool buffers
The AFP data stream print file is sent to the system in one or more buffers. These buffers contain single or multiple contiguous structured fields. A pointer to the buffer and the length of each buffer are passed to the system.
AFP data stream resource objects
Resource objects contain data and control information that can be used in printing a job. These can be shared by different pages in the same job. A resource is composed entirely of structured fields.

Types of resources are:

These resources can be transmitted from a host zSeries to an iSeries server or loaded from tape into space objects using i5/OS commands. Overlays and page segments can be created by AFP Utilities for iSeries.

Messages
Messages generated during the processing of AFP data stream print files are placed in the printer writer job log.

Start of changeMixed Object: Document Content Architecture (MO:DCA)End of change

Start of changeMixed Object Document Content Architecture (MO:DCA) is an object-oriented data stream that is designed to allow consistent printing that is independent of operating system or device. An object is a collection of data that can be treated as a unit, such as text, images, and graphics. This architecture supports:

End of change

The data stream for an MO:DCA document consists of various objects as well as the logical and layout structure of the document. The logical structure defines the logical content of the document—chapters, figures, and lists. The following layout structure defines the way the data should be presented.

Figure 1. MO:DCA Document Structure
Mixed Object Document Content Architecture (MO:DCA)
BDT (Begin document)
Indicates the beginning of the document
Resource groups
Specifies fonts, overlays, and segments so that these objects can be transmitted as part of the data stream. They can be referred to by an MO:DCA Include structured field.
Master environment groups
Specifies the processing environment, such as space definitions, suppression of data, number of copies, and internal data stream references.
Pages
Contains objects that are part of the document. These objects could be text, graphics, and images.
EDT (End document)
Indicates the end of the document.

The following different types of objects make up MO:DCA. All of these objects are supported by IPDS™:

Bar Code Object Content Architecture (BCOCA)
A bar-code object could contain "draw rule" commands or raster data, depending on whether the bar code is to be drawn as a graphics object or has been scanned into the data stream as an image. A bar code object containing draw rule commands is built up using only lines of a specified length and width. A graphics object is constructed from a number of primitives, such as lines, arcs, symbols, shaded areas, and point arrays.
Image Object Content Architecture (IOCA)
IOCA represents images in device-independent format. A standard set of constructs has been defined to describe the image data, the characteristics of that data, and manipulation functions that can be performed on the data. The image content is inserted in an image segment.
Graphics Object Content Architecture (GOCA)
GOCA describes complex pictures. These pictures are formed from a collection of primitives, such as lines, arcs, characters, symbols, and shaded areas or point arrays. Each of these primitives has its own set of attributes, such as line width, orientation, and resolution. In addition to these attributes, there is a set of general drawing attributes like color, which apply to all primitives
Presentation Text Object Content Architecture (PTOCA)
PTOCA describes the text part of a document. The presentation text object, in common with the other objects, is designed not only to be carried by, but to be an integral part of, the data stream, providing the following:

Two structured fields provide the necessary presentation information to the printer:

P T descriptor structured field
Defines several positional parameters for the object
P T data structured field
Contains the presentation text and the control sequences for positioning graphic characters. These graphic characters are defined within the coded fonts.
Font Object Content Architecture (FOCA)

In order to achieve uniform document presentation output, it is essential that font resources be consistently defined and put into effect. These resources must be identified by means of a constant, unvarying set of parameters.

FOCA makes it possible to achieve the required degree of consistency by defining:

FOCA defines the parameter content of: