Printing Advanced Function Presentation (AFP) : Ibm I 7.2
Printing Advanced Function Presentation (AFP) : Ibm I 7.2
Printing Advanced Function Presentation (AFP) : Ibm I 7.2
7.2
Printing
Advanced Function Presentation (AFP)
IBM
Note
Before using this information and the product it supports, read the information in “Notices” on page
95.
This document may contain references to Licensed Internal Code. Licensed Internal Code is Machine Code and is
licensed to you under the terms of the IBM License Agreement for Machine Code.
© Copyright International Business Machines Corporation 2006, 2013.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
© InfoPrint Solutions Company 2008, 2013.
Contents
iii
Specifying an overlay...................................................................................................................... 46
Specifying an AFP font....................................................................................................................47
Specifying a TrueType or OpenType font........................................................................................47
Example: Specifying a font............................................................................................................. 48
Specifying a page segment.............................................................................................................50
Specifying an object container....................................................................................................... 51
Search order of library list.............................................................................................................. 51
Why you should use a library list.............................................................................................. 51
Search order for resources that are not specified by the AFPRSC keyword............................52
Search order for resources that are specified by the AFPRSC keyword..................................52
The QIBM_AFP_RESOURCES_PATH environment variable..................................................... 52
Search order for Color Management Resources.......................................................................53
Creating AFP data.................................................................................................................................53
Printing AFP data with PSF...................................................................................................................54
Printing AFP data generated on IBM i............................................................................................ 54
Printing data sent to IBM i from zSeries.........................................................................................55
Printing data sent from zSeries to an IBM i network file..........................................................55
Printing data sent from zSeries to an IBM i output queue....................................................... 55
Transforming IPDS data to PDF........................................................................................................... 56
Transforming spooled files to PDF without manual setup.............................................................56
Prerequisites............................................................................................................................. 57
Transforming a spooled file to PDF...........................................................................................57
Transforming spooled files to PDF with manual setup.................................................................. 57
Prerequisites............................................................................................................................. 57
Transforming a spooled file to PDF...........................................................................................57
Setting up your PSF configuration object................................................................................. 57
Changing the input file to create multiple output files or an indexed file................................59
Configuring a device for PDF conversion.................................................................................. 59
Sending the PDF file as email......................................................................................................... 60
Encrypting the PDF file................................................................................................................... 61
Suppress message text in an email................................................................................................62
Variable data taken from spooled file attributes........................................................................... 62
Generic support for PDF map object selection criteria................................................................. 63
Configuring PSF..........................................................................................................................................63
Configuring PSF by using a device description.................................................................................... 64
Configuring PSF by using a PSF configuration object..........................................................................64
Managing PSF.............................................................................................................................................64
Enabling IPDS pass-through support.................................................................................................. 65
Sharing print sessions.......................................................................................................................... 65
Automatic session recovery................................................................................................................. 66
Disabling offset stacking and edge marking........................................................................................67
Specifying public data authority for directories created by PSF.........................................................67
Preventing the copying of spooled file attribute USRDFNOPT when respooling AFP........................ 68
Line and mixed data stream support.........................................................................................................69
Special characters used with line data................................................................................................ 69
Printer file parameters used with line and mixed data....................................................................... 70
Considerations and restrictions when using line data or mixed data.................................................71
Sending data from zSeries to IBM i........................................................................................................... 73
Sending print data from VM to the output queue of a user ID............................................................ 73
Sending print data from z/OS to an IBM i output queue..................................................................... 74
Sending data from zSeries to IBM i network files............................................................................... 75
AFP reference information.........................................................................................................................75
Form definitions included with the operating system.........................................................................76
Page definitions included with the operating system......................................................................... 76
CL commands for PSF configuration objects.......................................................................................78
CL commands for device descriptions.................................................................................................79
zSeries parameters and corresponding IBM i printer file parameters............................................... 80
American National Standard carriage control characters...................................................................82
iv
Machine code carriage control characters.......................................................................................... 83
Troubleshooting mapping problems......................................................................................................... 85
Error message reason codes................................................................................................................85
The diagnostic spool file (PSFTRACE)..................................................................................................85
Requesting the diagnostic spool file.............................................................................................. 85
Format of the diagnostic spool file................................................................................................. 86
Automatically generated PSFTRACE file........................................................................................ 87
User-requested PSFTRACE file.......................................................................................................88
Related information for AFP...................................................................................................................... 90
Notices................................................................................................................95
Programming interface information.......................................................................................................... 96
Trademarks................................................................................................................................................ 96
Terms and conditions.................................................................................................................................97
v
vi
Advanced Function Presentation (AFP)
IBM® i has powerful printing and display functions. With Advanced Function Presentation (AFP) you can
present information using overlays, bar codes, graphics, images, and more. IBM i supports a variety of
powerful printing and presentation solutions.
This information illustrates some of the core IBM i printing functions, and helps you plan for and configure
these functions.
Note: Read the “Code license and disclaimer information” on page 93 for important legal information.
Color Management
Print Services Facility (PSF) is enhanced to provide color management support for IPDS printers. For more
information, see “Color and grayscale printing using AFP” on page 10.
AFP concepts
Use this information to understand how AFP works on IBM i.
Read these topics for an overview of the Advanced Function Presentation (AFP) and related concepts.
Related reference
AFP reference information
Look up information about PSF, such as the form definitions and page definitions included with your
system, here.
AFPDS
AFPDS files can be generated on IBM i as well as many other platforms. These operating systems can
send AFPDS files to each other for printing on AFP-configured printers.
PSF
Print Services Facility (PSF) combines print data with resources to manage and control data transmitted
to AFP printers. PSF accepts various data streams, transforms these data streams into the data stream
required by each printer, and then transmits the data to the printer. PSF uses processing and printing
options specified by the user and the installation during these processes. In addition, PSF does the
following:
• Manages resources.
• Verifies part of the input data stream's syntax (the printer verifies the remainder of the syntax).
• Provides diagnostic aids, which provide information that can be used for problem analysis.
• Reports the status of a printer to the system operator.
• Provides accounting information.
• Provides error-recovery procedures for AFP printers. If a spooled file does not print due to a printer
problem such as a paper jam, PSF retransmits the affected pages when the problem at the printer is
corrected.
To use AFP support on IBM i, typically PSF must be installed. However, if the ASCII data stream is
converted through Host Print Transform, you can use the AFP support without installing PSF.
Related concepts
AFP resources
Advanced Function Presentation (AFP) resource objects contain data and control information.
Determining whether PSF is required
Data streams
Advanced Function Presentation (AFP) applications can generate Advanced Function Printing data stream
(AFPDS), line, or mixed (AFPDS and line) spooled files.
These applications can run on IBM i or on other platforms. IBM i can receive spooled files from other
operating systems.
Line data
Line data is record-oriented readable text.
The generating application can partially format line data by doing one of these:
• Adding carriage control characters to the first column of each record
• Adding blank lines to adjust vertical positioning
• Using skipping and spacing controls (such as on an RPG output specification)
Line data is supported as a device type in the printer file commands through the DEVTYPE(*LINE)
specification. The printer file commands follow:
• Create Printer File (CRTPRTF)
• Change Printer File (CHGPRTF)
• Override with Printer File (OVRPRTF)
For more information about line data, see the AFP Programming Guide and Line Data Reference, which can
be found at the AFP Consortium (AFPC) website http://www.afpcinc.org (http://www.afpcinc.org).
Related concepts
Line and mixed data stream support
Use this information to understand how PSF supports line and mixed data on IBM i.
Mixed data
Mixed data is line data intermixed with AFPDS data.
Mixed data can also be called *AFPDSLINE data. Only certain AFPDS structured fields are allowed to be
intermixed with line data. For more information about mixing line data and AFPDS structured fields, see
the AFP Programming Guide and Line Data Reference, which can be found at the AFP Consortium (AFPC)
website http://www.afpcinc.org (http://www.afpcinc.org).
Related concepts
Line and mixed data stream support
Use this information to understand how PSF supports line and mixed data on IBM i.
AFP resources
Advanced Function Presentation (AFP) resource objects contain data and control information.
This information can be shared by different pages within a spooled file as well as different spooled files.
Examples of resources are fonts, which define the characters used to print text, and page segments,
which can include images and text.
Resources can be stored and accessed from within the operating system being used. By referring to the
name of the stored resource, many data streams can share the same resources. For more information
about resources, see the descriptions of the different resource types.
Related concepts
TrueType and OpenType fonts
There is extensive operating system support for TrueType fonts, and they are popular with PC
applications. Consequentially, TrueType is probably the most prevalent font technology in the industry
today. OpenType is an extension of the TrueType font format.
Resource libraries
Advanced Function Presentation (AFP) resource libraries group resources of the same type.
Ensuring that you have the necessary AFP resources
You need to determine what resources you need for your Advanced Function Presentation (AFP)
application and ensure that they are stored in appropriate locations.
Related tasks
Printing data sent to IBM i from zSeries
PSF can print data that was generated on zSeries. This data might be AFP, AFPDSLINE (AFP data mixed
with line data), or line data. The data might be sent to network files or directly to an output queue.
AFP fonts
A font is a collection of characters of a certain size, typeface, and type style. Advanced Function
Presentation (AFP) fonts, also called Font Object Content Architecture (FOCA) fonts, are the standard
fonts used for Intelligent Printer Data Stream (IPDS) output. AFP fonts are made up of a code page and
a character set. All AFP fonts are encoded as either single-byte or double-byte fonts, depending on the
language for which they are being used.
Each character in a font is identified by a 1-byte (single-byte) or a 2-byte (double-byte) code. The internal
structure of fonts depends on whether the font is for a phonetic or a non-phonetic writing system. An
example of a phonetic writing system is English. An example of a non-phonetic writing system is Kanji.
At least two resources are needed to make up a font: a font character set and a code page. The
relationship between code pages and font character sets is illustrated in Figure 1 on page 6. A third
resource, a coded font, can define a font by naming a font character set and a code page.
Font character set
This resource contains the patterns for each character in the font and associates an 8-byte character
identifier with each pattern. This resource also contains descriptive information for the entire
character set.
Code page
This resource associates code points with character identifiers within a font character set, each
representing a character pattern. A code point is an 8-bit binary number representing one of 256
potential characters.
Coded font
This resource associates one or more code pages with the appropriate font character sets.
Related concepts
Obtaining AFP resources
There are many sources of Advanced Function Presentation (AFP) resources.
AFP font libraries
IBM supplies several AFP font libraries. In addition, you can create a library list that allows AFP to locate
and use other fonts.
TrueType and OpenType fonts
There is extensive operating system support for TrueType fonts, and they are popular with PC
applications. Consequentially, TrueType is probably the most prevalent font technology in the industry
today. OpenType is an extension of the TrueType font format.
Related reference
Specifying an AFP font
There are many different tools you can use to specify Advanced Function Presentation (AFP) fonts in your
document. Each tool has different capabilities.
How TrueType and OpenType fonts differ from AFP fonts
When using TrueType fonts, you will see differences in how the fonts are specified, managed, and
installed when compared to Advanced Function Presentation (AFP) fonts.
Form definitions
A form definition is an Advanced Function Presentation (AFP) resource object that defines the
characteristics of the physical form to be printed on.
Form definitions define these characteristics:
• Overlays to be used
• Position of page data on the form
• Rotation
• Duplexing
• Input drawer
• Formfeed type
• Print quality
• Number of copies of each page and the modifications that apply to each set of copies
• List of Color management resources (CMRs) that might be used
Object containers
Object containers are used to carry non-Object Content Architecture (OCA) objects in an Advanced
Function Presentation (AFP) data stream.
Some such objects are Graphics Interchange Format (GIF) and Tagged Image File Format (TIFF) images.
These non-OCA objects can be wrapped or unwrapped. Wrapped objects are carried in a Mixed Object
Document Content Architecture (MO:DCA) envelope called an object container. Unwrapped objects
are unaltered from their original form. If the object is to be carried in MO:DCA resource groups and
interchanged, it must be wrapped.
Note: Print Services Facility (PSF) does not check an object container's contents. Therefore, it is up to the
user to verify that the printer can handle the type of data in the object container. The Infoprint Server PDF
subsystem works like a printer. For information about the types of images it can accept, see the Infoprint
Server for iSeries: User's Guide.
Object containers, even though they contain non-OCA objects, are similar to other AFP resources in these
ways:
• They can be mapped. A mapped resource is downloaded once per spooled file, no matter how many
times the resource is referenced in the spooled file.
• They can be included on a page.
• They can be captured in the printer.
Using object containers has several benefits:
• You can reference several types of MO:DCA objects in a spooled file without having to include them in
an overlay or page segment. These image types are image data, bar code data and graphics data.
• You can scale and rotate these objects. With page segments and overlays, you need to create one copy
of the object in each orientation needed.
Overlays
Overlays, also known as electronic forms, are a collection of predefined data such as lines, shading, text,
boxes, or logos. They can be merged with variable data on a sheet while a spooled file is being processed.
You can use the licensed program IBM Infoprint Designer for iSeries, the licensed program Advanced
Function Printing Utilities, the licensed program IBM Infoprint Server for iSeries, or the Advanced
Function Presentation (AFP) printer drivers provided for Microsoft Windows to create overlays on IBM
i. Overlays can also be downloaded from other operating systems, such as zSeries.
When overlay data is received from the zSeries system, you place it in a data file. To convert the page
overlay data to a format that can be used by IBM i, use the Create Overlay (CRTOVL) CL command.
Related concepts
Obtaining AFP resources
There are many sources of Advanced Function Presentation (AFP) resources.
Specifying an overlay
To use overlays, specify them in the front and back overlay parameters of the printer file being used with
your application.
Related reference
Create Overlay (CRTOVL) CL command
Page definitions
Page definitions are resources that format and compose line data into logical pages.
A page definition contains printing controls that specify:
• Where data from each input record is to be printed
• Page size (height and width)
• Data fields that can be suppressed
• Print positions for line-data records containing carriage control characters
• Inline printing direction
• Number of lines per inch
• List of page segments that might be used
• List of overlays that might be used
• Record definitions
• Constant data to be printed
Page segments
Page segments are objects containing composed text and images that are prepared before formatting and
included during printing.
For example, you might want to repeat constant data at different positions on a page or overlay. You might
also want to repeat that data on different pages or overlays. You can do this by using a page segment. A
company logo is an example of this type of data.
You can use the IBM Infoprint Designer for iSeries licensed program, the Advanced Function Printing
Utilities licensed program, the IBM Infoprint Server for iSeries licensed program, or the Advanced
Function Presentation (AFP) printer drivers provided with Microsoft Windows 2000 or Windows XP, to
create page segments on IBM i. Page segments can also be downloaded from zSeries systems. The page
segments must be stored in an accessible library.
When page segment data is received from the zSeries system, you place it in a data file. To convert the
page data to a format that can be used by IBM i, use the Create Page Segment (CRTPAGSEG) command.
Related concepts
How page definitions, form definitions, and printer files interact
You can use a printer file to specify some of the same options as you can specify with a page definition
and a form definition. This topic describes how PSF chooses an option when a printer file is used with a
page definition and form definition.
Obtaining AFP resources
There are many sources of Advanced Function Presentation (AFP) resources.
Specifying a form definition
To use or identify a fully qualified form definition, specify a value in the FORMDF parameter with a CL
command.
Specifying a page segment
A page segment object can be built into your application output in a number of ways.
Related reference
Create Page Segment (CRTPAGSEG) CL command
Form definitions included with the operating system
File size
Spooled files with color images in them can have a file size that is much larger than black and white
spooled files. The larger file size can lead to longer processing times and increased traffic on your
network.
Because color images must contain data about each layer of color, the file might contain three to four
times more information than a grayscale file and over 24 times more information than a black and white
file. In addition, ICC profiles are embedded in some file types (such as TIFF images). While ICC profiles by
themselves might not be large, they do increase the size of an image. If you have only one image that is
repeated throughout a spooled file, and if you construct your spooled file so the image is downloaded only
once, the embedded profile is of little concern.
However, if you use various different images, each with an embedded profile, or if you construct your
spooled file so that each image is downloaded every time that it appears, the embedded profiles can add
unnecessary volume to the print job. If you plan to use a wide variety of color images, create or save them
with the same color space so they all use the same ICC profile. You can also install color images in a
resource directory so they can be reused.
Halftones
Grayscale printers apply halftones to spooled files to print them; halftones enable the printer to produce
many shades of gray and high-quality images. Generally, the most important characteristic to consider
for halftones in grayscale printing is line screen frequency, expressed in lines per inch (lpi). Each printer
supports a set of line screen frequencies natively; when you specify the wanted line screen frequency in a
spooled file, the printer chooses the available line screen frequency that best matches it.
Color Management
Images, graphics, and photographs often appear different depending on the monitor or the printer you
use. The colors that are printed by one printer might not match the colors that are printed on another
printer, even if they came from the same source. If it is important that colors stay consistent from camera,
scanner, or monitor to printer, you must use color management practices.
It is virtually impossible to accurately reproduce the colors that you see on your monitor on a printed
page. Because printers typically have smaller color gamuts than other devices, some of the colors must
always be adjusted when images are transformed for printing. With color management, you can control
the adjustments so they are less noticeable than they might be if you use the default settings of your
image creation software, print server, and printer.
Several factors play significant roles in color management, including ICC profiles, rendering intents, and
paper characteristics.
Rendering intents
Rendering intents indicate what you want a printer to do with colors that are outside its gamut.
ICC profiles support these rendering intents:
• Perceptual
If an image includes any colors that are out-of-gamut for the printer, the printer adjusts all the colors
in the image, even the colors that are already in the gamut of the printer, so they are all in-gamut and
maintain their color relationships to each other. The result is an image that is visually pleasing, but is not
colorimetrically accurate. The perceptual rendering intent is useful for general reproduction of images,
particularly photographs.
• Saturation
If a spooled file includes colors that are out-of-gamut for the printer, the printer replaces the out-of-
gamut color with the nearest color in the gamut. It also adjusts the in-gamut colors so that they are
more vivid. Saturation is the least used rendering intent, but it is useful for business graphics, such as
images that contain charts or diagrams.
• Media-relative colorimetric
If a spooled file includes colors that are out-of-gamut for the printer, the printer substitutes the nearest
in-gamut color; in-gamut colors are not adjusted. Colors that are printed on papers with different media
white points might not match visually. The media white point is the color of the paper that the spooled
file is printed on. For example, if you print an image on white paper, on off-white paper, and on blue
paper by using the media-relative colorimetric rendering intent, the printer uses the same amount of ink
or toner for each one and the resulting color is technically the same. However, the images might seem
different because your eyes adjust to the color of the background and interpret the color differently. This
rendering intent is typically used for vector graphics.
• Absolute colorimetric
All colors are mapped by using the same method as the media-relative colorimetric rendering intent,
however, all colors are adjusted for the media white point. For example, if you print an image on white
paper, on off-white paper, and on blue paper by using the absolute colorimetric rendering intent, the
printer adjusts the ink or toner that is used for each one. The resulting color is technically not same, but
the images might look the same because of the way your eyes interpret them in relationship to the color
of the paper. The absolute colorimetric rendering intent is typically used for logos.
Halftone CMR
Halftone CMRs carry the information that a printer uses to convert spooled files into a pattern of dots that
it can put on paper. Halftone CMRs can be used with both color and grayscale spooled files.
Halftone CMRs generally specify the line screen frequency, halftone pattern, and rotation of the halftone
that they carry. Device-specific halftone CMRs might also include the printer resolution.
A printer that uses AFP color management to print color or grayscale spooled files must use a halftone
CMR to convert the spooled file into a format that the printer can reproduce in ink or toner. If a halftone
CMR is not specified in the spooled file, the printer applies a default halftone CMR.
Indexed CMR
Indexed (IX) CMRs map indexed colors in the data to presentation device colors or colorant combinations.
Indexed CMRs provide rules about how to render indexed colors. Indexed CMRs apply to indexed colors
that are specified by using the highlight color space. They do not apply to indexed colors found within
PostScript or other non-IPDS data objects. For Indexed CMRs, both instruction and audit processing
modes are valid. However, only indexed CMRs with an instruction processing mode are used; CMRs
with an audit processing mode are ignored. The tags in the indexed CMR allow the CMR to use various
color spaces in the descriptions. These color spaces can be grayscale, named colorants, RGB, CMYK, or
CIELAB.
Data objects
Presentation data objects contain a single type of data (such as GIF, JPEG, PNG, and TIFF images) and
can be used in your spooled files. These data objects can be placed directly in a page or overlay or can be
defined as resources and included in pages or overlays. Using a data object as a resource is more efficient
when that object is used more than once in a spooled file. Resources are downloaded to the printer once
and referenced as needed.
Data objects can either be included inline with a spooled file or installed in a resource directory by using
software such as AFP Resource Installer. If you install your data objects in a resource directory, you
can associate color conversion CMRs with them. For more information about resource directories, see
“Resource directory management” on page 26.
Related concepts
DDS AFPRSC keyword
AFP fonts are created and managed using the TrueType fonts have no IBM i management
font resource commands: CHGCDEFNT, CHGFNTRSC, commands. Instead, the fonts are installed using the
CRTFNTRSC, DLTFNTRSC, DSPCDEFNT, DSPFNTRSCA, “AFP Resource Installer” on page 28. The generated
and WRKFNTRSC. resource access table resides in the /QIBM file
system.
An AFP font is specified by using the *FNTRSC object TrueType fonts are specified using a font name such as
name such as C0D0GT10. Times New Roman.
AFP fonts can be substituted when the requested font There is no font substitution with TrueType fonts.
is not available.
An AFP font is marked as eligible for capture with the TrueType fonts are marked as eligible for capture by
Change Font Resource (CHGFNTRSC) command. the “AFP Resource Installer” on page 28.
PSF tries to capture AFP fonts only if the PSF PSF always tries to capture TrueType fonts.
configuration object specifies FNTCAPTURE(*YES).
Related concepts
AFP fonts
A font is a collection of characters of a certain size, typeface, and type style. Advanced Function
Presentation (AFP) fonts, also called Font Object Content Architecture (FOCA) fonts, are the standard
fonts used for Intelligent Printer Data Stream (IPDS) output. AFP fonts are made up of a code page and
a character set. All AFP fonts are encoded as either single-byte or double-byte fonts, depending on the
language for which they are being used.
Specifying a TrueType or OpenType font
You can specify a TrueType font anywhere that you can specify an Advanced Function Presentation (AFP)
font. You can also mix references to TrueType and AFP fonts. However, TrueType fonts are referenced
differently than AFP fonts.
Related reference
Specifying an AFP font
Resource libraries
Advanced Function Presentation (AFP) resource libraries group resources of the same type.
For example, a page segment library might contain images of the company logo in several different sizes.
IPDS pass-through
IPDS pass-through allows you to process some SCS and IPDS spooled files more efficiently.
Before printing, SNA character string (SCS) files are converted to Intelligent Printer Data Stream (IPDS)
files. These are then converted to Advanced Function Presentation data stream (AFPDS), and then to
printer-specific IPDS. Also, IPDS files are converted to AFPDS, then are converted to printer-specific
IPDS. The final IPDS files have specific commands for your printer. You can choose to skip the conversion
to AFPDS and to printer-specific IPDS. This is called IPDS pass-through. IPDS pass-through is specified
on a PSF configuration object.
Specifying IPDS pass-through in the PSF configuration object allows only those spooled files eligible for
IPDS pass-through to bypass the extra transforms. Those spooled files not eligible for IPDS pass-through
are still transformed to AFPDS and then to printer-specific IPDS.
Figure 2 on page 34 shows the data stream origination, flow, and conversion for a spooled file when
IPDS pass-through support is enabled.
Application
Writer
System i
Device
AFP printer
RBAFT525-1
Installing PSF
This topic points to instructions for installing PSF and lists installation options.
To install Print Services Facility (PSF) , follow the instructions in the Installing, upgrading, or deleting IBM i
and related software topic.
PSF options
There are three options associated with PSF. Depending on what you purchase, you will be issued a key
for one of these options:
• 36: PSF 1–55 pages per minute license
• 37: PSF 1–100 pages per minute license
• 38: PSF Any speed license
Related tasks
Installing, upgrading, or deleting IBM i and related software
Purchasing fonts
IBM offers several different font products that you can purchase, depending on your needs.
IBM AFP Font Collection for AS/400, v3.1 (Program 5733-B45)
IBM AFP Font Collection for i is the current and recommended AFP font product. It replaces
IBM Infoprint Fonts for Multiplatforms (Program 5648-E77) and the IBM AFP Font Collection for
Workstations and OS/400 (Program 5648-B45).
IBM Advanced Function Printing Fonts for AS/400 (Program 5769-FNT)
This licensed program is only required for compatibility with older font technology.
IBM Advanced Function Printing DBCS Fonts for AS/400 (Program 5769-FN1)
This licensed program is only required for compatibility with older font technology.
There are many sources of TrueType fonts. However, not all TrueType fonts are suitable for use in
Advanced Function Presentation (AFP). In general, a TrueType font that is to be installed and referenced
in an AFP system must be Unicode-enabled. A Unicode-enabled font has these characteristics:
• It must contain a Microsoft Unicode subtable that is identified by platform ID = 3 (Microsoft) and
platform-specific encoding ID = 1 (Unicode, UTF-16).
• It must specify a full font name (Name ID 4) using the same encoding in the naming table.
The TrueType fonts included with IBM i and installed with option 43 Additional fonts are suitable for use in
AFP.
Related concepts
TrueType and OpenType fonts
There is extensive operating system support for TrueType fonts, and they are popular with PC
applications. Consequentially, TrueType is probably the most prevalent font technology in the industry
today. OpenType is an extension of the TrueType font format.
Fonts provided by IBM i
IBM i AFP Compatibility Fonts is included free of charge in the IBM i base operating system.
Related information
IBM AFP Font Collection for i, V3.1
Examples: Using the Work with Network Files (WRKNETF) and Receive Network File
(RCVNETF) commands
Use the Work with Network Files (WRKNETF) and Receive Network File (RCVNETF) commands to receive,
delete, browse, or submit (print) files.
This command lets you work with the network files for USR1 and prints the output with the job's spooled
output. This command can only be issued by USR1, a member of the USR1 group, or a user with security
officer authority.
This command lets you work with the network files for all users and is written to the first member of the
specified database file. If the file exists in a library on the library list, the existing file is used; otherwise,
the file is created in library QGPL. If the file did not exist, or did not contain any members, a member with
the same name as the file is added to the file. Otherwise, the first member of the file is cleared and used.
Only a user with security officer authority can issue this command.
This command receives the network file SCRIPT, member $REPORT, into a physical file named MYFILE in
library MYLIB. The new member in MYFILE is $REPORT.
Related concepts
Sending data from zSeries to IBM i
Use these instructions to receive and print data and resources from zSeries systems to your IBM i.
Related tasks
Printing data sent to IBM i from zSeries
PSF can print data that was generated on zSeries. This data might be AFP, AFPDSLINE (AFP data mixed
with line data), or line data. The data might be sent to network files or directly to an output queue.
Receiving AFP resources from another system
When you receive Advanced Function Presentation (AFP) resource data from an operating system other
than IBM i, you typically cannot change the resource. If you want to change the resource, it must be
changed on the originating operating system and then resent to IBM i.
Related reference
Create Physical File (CRTPF) CL command
Receive Network File (RCVNETF) CL command
Work with Network Files (WRKNETF) CL command
Specifying an overlay
To use overlays, specify them in the front and back overlay parameters of the printer file being used with
your application.
Use one of these commands or keywords:
• Override with Printer File (OVRPRTF) command: Temporarily changes the printer file.
• Change Printer File (CHGPRTF) command: Permanently changes the printer file.
• Change Spooled File Attributes (CHGSPLFA) command: Changes the spooled file before printing.
• Data description specifications (DDS) OVERLAY keyword: For information about this keyword, see
Printer files in the DDS topic of the Programming category.
Related concepts
Overlays
Overlays, also known as electronic forms, are a collection of predefined data such as lines, shading, text,
boxes, or logos. They can be merged with variable data on a sheet while a spooled file is being processed.
Specifying a page segment
A page segment object can be built into your application output in a number of ways.
Related reference
Change Printer File (CHGPRTF) CL command
Change Spooled File Attributes (CHGSPLFA) CL command
Override with Printer File (OVRPRTF) CL command
Notes:
1. To determine the names of the font character sets and coded fonts that are available on your system,
use the WRKFNTRSC command.
2. The TXTRTT keyword only works with fields, not constants.
3. The print data for lines 1 through 10 is constant text and was specified in the DDS source.
4. The print data for lines 11 and 12 is a data field that contains the printed text.
5. By using the code examples, you agree to the terms of the “Code license and disclaimer information”
on page 93.
Related tasks
DDS keyword finder
Related reference
Work with Font Resources (WRKFNTRSC) command
Specifying an AFP font
There are many different tools you can use to specify Advanced Function Presentation (AFP) fonts in your
document. Each tool has different capabilities.
Search order for resources that are not specified by the AFPRSC keyword
When the operating system searches libraries for the resources that are needed to print a spooled file, the
user library list is searched first and then the device library list. By default, the operating system searches
libraries in the following order:
1. System libraries
These libraries are identified in system value QSYSLIBL. System libraries are available to all users; they
are identified in your library list with a Type of SYS.
2. Current® library
The current library is identified in your user profile as the value for the current library (CURLIB)
parameter. In your library list, the current library has a Type of CUR.
3. User libraries
User libraries are identified in system value QUSRLIBL or in a job description. In your library list, these
libraries are identified with a Type of USR.
You can override the system library search list and specify a library search list for a particular device or
user. To do the library search list, use a PSF configuration object. If you create a PSF configuration object,
the defaults for the user and device library lists are the same as the library search described previously.
Search order for resources that are specified by the AFPRSC keyword
When you specify a resource by using the AFPRSC Data description specifications (DDS) keyword, the
operating system uses a different method to search for that resource. Instead, it uses a search order that
involves the environment variable QIBM_AFP_RESOURCES_PATH. The system searches the integrated file
system for those resources as described in the AFPRSC topic.
Creating AFP data by using the AFP printer driver for Windows
The AFP printer driver creates AFP documents, overlays, and page segments from your Windows
applications. For more information about the AFP printer driver or to download the printer driver, see
the InfoPrint Solutions Company web site .
This command prints the member $REPORT in file MYFILE using a form definition of F10101 and all
available exception handling.
Note: By using the code examples, you agree to the terms of the “Code license and disclaimer
information” on page 93.
4. Release the spooled file to a device with device type *AFPDS.
Related reference
Print AFP Data (PRTAFPDTA) CL command
Prerequisites
1. If the PDF file will be sent as e-mail, make sure that IBM i is set up to send e-mail.
For instructions on setting up IBM i to send e-mail, see the Configure e-mail topic.
2. Optional: Write your mapping program.
Refer to the Infoprint Server for iSeries User's Guide for the format.
Prerequisites
1. Set up your PSF configuration object.
The Print Services Facility (PSF) configuration object you use specifies what is done with the PDF file
and other transform options.
2. Optional: Change the input file to create multiple output files or an indexed file.
3. Configure a device for PDF conversion.
Changing the input file to create multiple output files or an indexed file
You can insert group tags into your data before it is transformed. This lets the transform generate one
Portable Document Format (PDF) file for each group or insert an index tag at the beginning of each group.
The action taken depends on the value specified for the Multiple PDF Files (PDFMULT) parameter on
the Print Services Facility (PSF) configuration object. You can also use group tags to send each group as
e-mail to a different recipient. The group name is used as the index tag or mail tag when appropriate. For
information about putting mail tags on the group tags, see the Infoprint Server for iSeries User's Guide.
You can use a utility such as Data description specifications (DDS) or the IBM Infoprint Server for iSeries
Create AFP Data (CRTAFPDTA) command to insert group tags in your data. If you choose to specify
groups, all of the data must be inside a group.
To use DDS to generate groups, use the STRPAGGRP and ENDPAGGRP DDS keywords.
To use CRTAFPDTA to generate groups, follow the instructions in the Infoprint Server for iSeries User's
Guide to index your file. The value specified with Select index for group names (IDXGRP) is the group
name.
Related information
Infoprint Server for iSeries: User's Guide (G544-5775) PDF
The 80 bytes of text can contain a mail address or a tag. The mail exit routine converts tags into a
mail address and an optional message. The MAILSENDER parameter is 10 bytes long and specifies the
name of the user profile that is sending the file. This parameter overrides the PSF configuration object's
PDFSENDER value.
Examples
• To convert a spooled file to an encrypted PDF, send it as e-mail, and write it as an encrypted PDF to the
integrated file system:
1. Specify the stream file distribution option in the PDF map object entry or segment.
2. Specify this parameter on the printer file or spooled file's attributes:
USRDFNDTA('PDFENCRYPT(*STMF)')
• To convert a spooled file to an encrypted PDF and spool it as an encrypted PDF without sending it as
e-mail:
1. Specify the spooled file distribution option in the PDF map object entry or segment.
2. Specify this parameter on the printer file or spooled file's attributes:
USRDFNDTA('PDFENCRYPT(*SPLF *NOMAIL)')
• To convert a spooled file to an encrypted PDF, spool it as a PDF without encryption, and write it as an
encrypted PDF to the integrated file system without sending it as e-mail:
1. Specify the stream file distribution option in the PDF map object entry or segment.
2. Specify the spooled file distribution option in the PDF map object entry or segment.
3. Specify this parameter on the printer file or spooled file's attributes:
USRDFNDTA('PDFENCRYPT(*STMF *NOMAIL)')
Related concepts
Sending the PDF file as email
A mapping program, a mapping object, or the Print Services Facility (PSF) configuration object specifies
that an output Portable Document Format (PDF) file should be sent as email. A mail tag provides the email
address.
Related reference
Change Spooled File Attributes (CHGSPLFA) CL command
Configuring PSF
You can configure Print Services Facility (PSF) by using the printer device description or by using a PSF
configuration object.
Related concepts
PSF configuration objects
Managing PSF
After you configure Print Services Facility (PSF), you can continue to work with your AFP environment.
You can change the PSF configuration object and the printer files as necessary to manage PSF sessions.
PSF examines the third character of the data area to determine whether USRDFNOPT is copied. If the
value of the third character is 'N', then USRDFNOPT is not copied. If the value is 'Y', any other character, or
the data area does not exist, then PSF copies USRDFNOPT.
If you are currently using the QUSRSYS/QPSFVALS data area for another PSF function and want to turn off
the copying of USRDFNOPT, you can do so by entering the following command.
If you want to turn on the copying of USRDFNOPT, use the following command.
Figure 8. Line data with carriage control characters and table reference characters
Related reference
American National Standard carriage control characters
This topic lists the American National Standard carriage control characters for line or mixed data. It also
describes what each is used for.
Machine code carriage control characters
This topic lists the carriage control characters for line or mixed data in IBM machine code. It also
describes what each character is used for.
These commands place the file REPORTS LISTING A into the output queue of USERONE on IBM i with
the node ID AS4002.
Note: By using the code examples, you agree to the terms of the “Code license and disclaimer
information” on page 93.
Related concepts
Receiving fonts from zSeries
Fonts can be downloaded to IBM i from zSeries systems.
Related tasks
Printing data sent to IBM i from zSeries
PSF can print data that was generated on zSeries. This data might be AFP, AFPDSLINE (AFP data mixed
with line data), or line data. The data might be sent to network files or directly to an output queue.
Receiving AFP resources from another system
When you receive Advanced Function Presentation (AFP) resource data from an operating system other
than IBM i, you typically cannot change the resource. If you want to change the resource, it must be
changed on the originating operating system and then resent to IBM i.
Related reference
zSeries parameters and corresponding IBM i printer file parameters
This topic briefly describes the zSeries printer parameters used on VM commands and z/OS JCL
statements and indicates the equivalent IBM i printer file parameters.
Note: The IBM-supplied form definitions do not set the print quality for the 4224, 4230, 4234, and 4247
printers. You must set the print quality on the printer operator panel when using an IBM-supplied form
definition.
Related concepts
Form definitions
A form definition is an Advanced Function Presentation (AFP) resource object that defines the
characteristics of the physical form to be printed on.
Page segments
Page segments are objects containing composed text and images that are prepared before formatting and
included during printing.
Can only be used with the 4224, 4230, 4234, and 4247 printers.
Related concepts
Page definitions
Page definitions are resources that format and compose line data into logical pages.
Create Device Description This command lets you create a device description for a printer
(Printer) (CRTDEVPRT) device. If you have a locally-attached Twinax device and the automatic
configuration (QAUTOCFG) system value is *YES, the system will create
printer device descriptions automatically.
Delete Device Description This command deletes a device description.
(DLTDEVD)
Display Device Description This command lets you display or print the contents of a device
(DSPDEVD) description.
Work with Device Descriptions This command lets a user display and work with device descriptions.
(WRKDEVD)
Related reference
Sharing print sessions
You can specify printer-sharing properties on the PSF configuration object. This lets you limit the amount
of time that you have a connection to the printer, control when the session is released, control when a
new session is started, and specify how many times PSF tries to connect to the printer.
Change Device Description (Printer) (CHGDEVPRT) CL command
Create Device Description (Printer) (CRTDEVPRT) CL command
Delete Device Description (DLTDEVD) CL command
Display Device Description (DSPDEVD) CL command
Work with Device Descriptions (WRKDEVD) CL command
Table 6. VM parameters
zSeries printer IBM i printer file
parameter VM commands Function parameter
BIN PSF Specifies which drawer DRAWER
to take the paper from.
CC PRINT, PSF Specifies control CTLCHAR1
characters.
CHARS SPOOL Specifies a table of AFPCHARS
coded fonts.
COPY SPOOL Specifies the number of COPIES
copies.
DATACK PSF Specifies whether
the printer blocks
print positioning and
incorrect character
errors. Printers will
always block these
unless the printer file
that is used to create
the spooled file specifies
*ABSOLUTE for fidelity.
DEST TAG Specifies node and user
ID.
Related concepts
Sending data from zSeries to IBM i network files
The examples in this topic show how to send print data and resources from a zSeries system to an IBM i
network file.
Related information
Network Job Entry Formats and Protocols PDF
Table 8. American National Standard carriage control characters and their functions
Control character value
(in hexadecimal) Function
X'40' (blank) Space one line, and then print (single spacing).
X'F0' (zero) Space two lines, and then print (double spacing).
X'60' (dash) Space three lines, and then print (triple spacing).
X'4E' (plus sign) Suppress spacing, and then print (type over previous line).
Note: When American National Standard carriage controls are used, only the values that appear in
this table are considered valid by Print Services Facility (PSF). PSF treats any other American National
Standard carriage control value as not valid and uses single spacing to print any data on the line.
Related concepts
Special characters used with line data
There are two types of special characters that can be used with line data; carriage control characters (CC)
and table reference characters (TRC).
Table 9. Carriage control characters in IBM machine code and their functions
Control character value
(in hexadecimal) Function
X'03' No operation.
X'09' Print, and then space one line (single spacing).
X'11' Print, and then space two lines (double spacing).
X'19' Print, and then space three lines (triple spacing).
X'01' Print without spacing.
X'89' Print the data, then skip to the line position defined as Channel 1 (by
convention, the first line on a new page).
X'91' Print the data, then skip to the line position defined as Channel 2.
X'99' Print the data, then skip to the line position defined as Channel 3.
X'A1' Print the data, then skip to the line position defined as Channel 4.
Note: Print Services Facility (PSF) ignores these hexadecimal machine code carriage control characters
and does not print lines containing them: X'02' through X'07', X'0A', X'12', X'23', X'43', X'63', X'6B', X'73',
X'7B', X'EB', X'F3', and X'FB'. PSF treats any other carriage control value as not valid and prints any data
on the line using single spacing.
Related concepts
Special characters used with line data
• The data area must be created before starting the printer writer.
• The data area must be created in QGPL.
• The name of the data area must match that of the printer device description being used for printing.
2. To verify the value in the data area, display the data area using *HEX representation:
DSPDTAARA DTAARA(QGPL/printer_device_name) OUTFMT(*HEX)
The data area must look like this:
E6E6D7C4E3D9C8D9800000000000080000000000
0000000032000000000000000000000000000000
The first eight characters of the value of the data area must be WWPDTRHR.
3. When you no longer need the PSFTRACE file, delete the data area. Enter this command:
DLTDTAARA DTAARA(QGPL/printer_device_name)
Manuals
• Infoprint Server for iSeries: Introduction and Planning Guide, G544-5774 (635 KB)
IBM Redbooks
• IBM eServer™ iSeries Printing VI: Delivering the Output of e-business, SG24-6250 (760 KB)
Web sites
• Ricoh: Software - IBM i (www.infoprintsolutionscompany.com/internet/ipww.nsf/vwWebPublished/
swtp_ibmi_en). This Web site describes all of the IBM i Advanced Function Presentation (AFP) products.
• AFP Consortium (AFPC) (www.afpcinc.org). The AFP Consortium is an open standards body
consisting of hardware and software vendors which define and develop the AFP architecture. The latest
information about the AFP data stream architecture, white papers, and presentations may be found
on the AFP Consortium web site. Refer to the AFPC website for the latest versions of the following
documents:
– AFP Programming Guide and Line Data Reference
– AFPC Font Typeface Registry
– Bar Code Object Content Architecture Reference
– Color Management Object Content Architecture Reference
– Font Object Content Architecture Reference
– Graphics Object Content Architecture for Advanced Function Presentation Reference
– Image Object Content Architecture Reference
– Intelligent Printer Data Stream Reference
– MO:DCA Reference
– Overview of the AFP Color Management Architecture
– Presentation Object Subsets for AFP
– Presentation Text Object Content Architecture Reference
– Using OpenType Fonts in an AFP System
Other information
• DDS for printer files
• IBM i Access for Web
• IBM i Access for Windows
• IBM i NetServer
• Work management
• Working with printer output
• Installing, upgrading, or deleting IBM i and related software
Related reference
PDF files for AFP
You can view and print a PDF file of this information.
IBM grants you a nonexclusive copyright license to use all programming code examples from which you
can generate similar function tailored to your own specific needs.
SUBJECT TO ANY STATUTORY WARRANTIES WHICH CANNOT BE EXCLUDED, IBM, ITS PROGRAM
DEVELOPERS AND SUPPLIERS MAKE NO WARRANTIES OR CONDITIONS EITHER EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, REGARDING THE PROGRAM OR
TECHNICAL SUPPORT, IF ANY.
UNDER NO CIRCUMSTANCES IS IBM, ITS PROGRAM DEVELOPERS OR SUPPLIERS LIABLE FOR ANY OF
THE FOLLOWING, EVEN IF INFORMED OF THEIR POSSIBILITY:
1. LOSS OF, OR DAMAGE TO, DATA;
2. DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES, OR FOR ANY ECONOMIC CONSEQUENTIAL
DAMAGES; OR
3. LOST PROFITS, BUSINESS, REVENUE, GOODWILL, OR ANTICIPATED SAVINGS.
SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF DIRECT, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES, SO SOME OR ALL OF THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT
APPLY TO YOU.
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of
the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this
one) and (ii) the mutual use of the information which has been exchanged, should contact:
IBM Corporation
Software Interoperability Coordinator, Department YBWA
3605 Highway 52 N
Rochester, MN 55901
U.S.A.
If you are viewing this information softcopy, the photographs and color illustrations may not appear.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be
trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at
"Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.
96 Notices
These terms are trademarks or registered trademarks of Ricoh Co., Ltd., in the United States, other
countries, or both:
• Advanced Function Presentation
• Advanced Function Printing
• AFCCU
• AFP
• Bar Code Object Content Architecture
• BCOCA
• Intelligent Printer Data Stream
• InfoPrint
• Infoprint
• IPDS
• Mixed Object Document Content Architecture
• MO:DCA
• Print Services Facility
• Ricoh
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the
United States, other countries, or both.
Other product and service names might be trademarks of IBM or other companies.
Notices 97
98 IBM i: Advanced Function Presentation (AFP)
IBM®