AFP Toolbox for Multiple Operating Systems, Version 1
Windows Feature Installation Readme


Contents

Requirements and prerequisites

  • Restrictions
  • Installing AFP Toolbox for Windows

  • Modifying AFP Toolbox for Windows
  • Repairing AFP Toolbox for Windows
  • Uninstalling AFP Toolbox for Windows
  • Using AFP Toolbox for Windows

  • Running the sample program
  • Compiling and running programs
  • How to use and add fonts
  • FLIPLIST
  • FLIPUPDT: Updating your font index
  • Using IBM Infoprint Fonts with AFP Toolbox for Windows
  • Troubleshooting
  • AFP Toolbox documentation corrections

  • Begin Paragraph
  • Define Field
  • Put Text
  • AFP Toolbox updates

  • QR Code bar code data
  • Function
  • Syntax
  • Input parameters
  • Return Codes
  • Sample Function Call
  • CODE93 bar code data
  • Define Field Color
  • Function
  • Syntax
  • Input Parameters
  • Return Codes
  • Sample function call
  • Set Field Color
  • Function
  • Syntax
  • Input parameters
  • Return Codes
  • Sample function call
  • Notices

  • Programming Interfaces
  • Trademarks
  • Copyright

  • Requirements and prerequisites

    The Toolbox DLL has been tested on Windows 2000 and Windows XP platforms using the Microsoft Visual C++ development environment (Version 6.0).

    You must have installed the AFP Font Collection, Version 2.1, Licensed Program 5648-B45, or IBM Infoprint Fonts for Multiplatforms V1.1, 5648-E77, or both before the AFP Toolbox for Windows is installed.


    Restrictions

    The AFP Toolbox for Windows supports the C functions documented in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 with the exception of any function involving Double-Byte Character Set (DBCS) text (see below). This manual is available online from the Printing Systems digital library at:

    http://www.printers.ibm.com/R5PSC.NSF/Web/afpm

    or the Printing Systems Information Center at:

    http://publib.boulder.ibm.com/printer/psindex.htm

    A printed copy of this publication can be ordered from the IBM Publications Center web site at:

    http://w3.ehone.ibm.com/public/applications/publications/cgibin/pbi.cgi

    The following DBCS functions are not supported:

    Define Double-Byte Font By Attribute (AFPDefineDbFontByAttr)
    Write Double-Byte String (AFPWriteDbString)
    Put Double-Byte Text (AFPPutDbText)
    Translate And Measure Double-Byte String (AFPXlateAndMeasureDbString)
    Measure Double-Byte String (AFPMeasureDbString)
    Set Text Double-Byte Codeset (AFPSetTextDbCodeset)
    Set Input Double-Byte Codeset (AFPSetInputDbCodeset).

    A return code of "rcDBCS_NOT_SUPPORTED_YET" (value 205) is returned by these functions if they are called.


    Installing AFP Toolbox for Windows

    This section contains information about installing AFP Toolbox in the Windows environment:

    1. Download the "AFPToolbox.exe" install file into a temporary directory.
    2. Double click on the "AFPToolbox.exe" file to begin installing AFP Toolbox for Windows.
    3. Select the "Next" button in the AFP Toolbox for Windows dialog box.
    4. To continue installation, select "I accept the terms of the license agreement".
    5. Select the "Next" button.
    6. To change the default directory, select the "Browse" button.
    7. Select the "Next" button.
    8. Select the "Install" button.
    9. Select the "Finish" button to complete the installation.

    Modifying AFP Toolbox for Windows

    This section contains information about modifying AFP Toolbox for Windows. You will need to modify the Toolbox if you install or remove a font product. A backup copy of your previous INI file is created and stored in the <TargetDir> and named "afrfmstr.ini.bak." There are 2 methods for modifying AFP Toolbox for Windows:

    1. From the "Add/Remove Programs" dialog box:
      1. Select "Add/Remove Programs" in your computer's "Control Panel" window.
      2. Select "AFP Toolbox for Windows" from the list of programs.
      3. Select the "Change/Remove" button.
      4. Select "Modify".
      5. Select the "Next" button.
      6. Select the "Yes" button.
    2. In the directory in which you downloaded the AFP Toolbox for Windows program:
      1. Double click on the "AFPToolbox.exe" icon.
      2. Select "Modify".
      3. Select the "Next" button.
      4. Select the "Yes" button.
    Note:
    The option is not available if the "AFPToolbox.exe" file has been deleted.

    Repairing AFP Toolbox for Windows

    This section contains information about repairing AFP Toolbox for Windows. The Repair option reinstalls and recreates the AFP Toolbox files. You may need to use repair if a file is deleted or corrupted. There are 2 methods for repairing AFP Toolbox for Windows:

    1. From the "Add/Remove Programs" dialog box:
      1. Select "Add/Remove Programs" in your computer's "Control Panel" window.
      2. Select "AFP Toolbox for Windows" from the list of programs.
      3. Select the "Change/Remove" button.
      4. Select "Repair".
      5. Select the "Next" button.
      6. Select the "Yes" button.
    2. In the directory in which you downloaded the AFP Toolbox for Windows program:
      1. Double click on the "AFPToolbox.exe" icon.
      2. Select "Repair".
      3. Select the "Next" button.
      4. Select the "Yes" button.
      Note:
      The option is not available if the "AFPToolbox.exe" file has been deleted.

    Uninstalling AFP Toolbox for Windows

    This section contains information about uninstalling AFP Toolbox for Windows. There are 2 methods for uninstalling AFP Toolbox for Windows:

    1. From the "Add/Remove Programs" dialog box:
      1. Select "Add/Remove Programs" in your computer's "Control Panel" window.
      2. Select "AFP Toolbox for Windows" from the list of programs.
      3. Select the "Change/Remove" button.
      4. Select "Remove".
      5. Select the "Next" button.
      6. Select the "Yes" button.
    2. In the directory in which you downloaded the AFP Toolbox for Windows program:
      1. Double click on the "AFPToolbox.exe" icon.
      2. Select "Remove".
      3. Select the "Next" button.
      4. Select the "Yes" button.
      Note:
      The option is not available if the "AFPToolbox.exe" file has been deleted.

    Using AFP Toolbox for Windows

    This section contains information about using AFP Toolbox for Windows:


    Running the sample program

    There is a sample program included with AFP Toolbox for the C language.

    You should compile and run this sample program, both as an exercise to familiarize yourself with AFP Toolbox and as a verification of the installation procedures. See Chapter 2.0 in the "AFP Toolbox for Multiple Operating Systems User's Guide", "Using AFP Toolbox" for examples of the output from the sample program and a description of the function calls.

    Use "Microsoft Visual C++ 6.0" to open the sample project file "atxctest.dsw" in the <TargetDir>\Samples directory. If the project ran correctly, the file named "CTEST.AFP" is created. To view or print the "CTEST.AFP", you must make the "wsllogo.psg" file available to AFP Workbench or Infoprint Manager. The page segment is located in the <TargetDir>\Samples directory.


    Compiling and running programs

    To compile and run a C language program, you need to create a project in "Microsoft Visual C++ 6.0" that makes use of IBM AFP Toolbox library for Windows 2000/XP.

    1. Create a new project (for example "Win32 Console Application") with "Microsoft Visual C++ 6.0".
    2. From the "Project" menu, select "Settings" to open the "Project Settings" dialog box.
    3. Select the "C/C++" tab.
    4. From the "Category:" pull-down menu in the "C/C++" tab, select "Code Generation".
    5. From the "Use run-time library:" pull-down menu, select either "Debug Multithreaded DLL" or "Multithreaded DLL" depending on whether you want to build the Debug or Release version.
    6. From the "Category:" pull-down menu, select "Preprocessor".
    7. In the "Preprocessor definitions:" entry field, enter the following text:
      _WINDOWS,USING_AOCL,USING_FM
      
    8. In the "Additional include directories:" field, add the paths where the AFP Toolbox header files are installed:
      <TargetDir>\document
      <TargetDir>\fontmstr
    9. Select the "Link" tab in the "Project Settings" dialog box.
    10. From the "Category:" pull-down menu in the "Link" tab, select "Input".
    11. In the "Object/library modules:" entry field, enter the name of the module:
      afptoolbox.lib
      
    12. In the "Additional library path:" entry field, enter the path where "afptoolbox.lib" is installed (the same directory in which you installed AFP Toolbox for Windows).
    13. Press the "OK" button.
    14. Add your C program that calls the AFP Toolbox to your project.
    15. Build an executable module from your project and run it.

    How to use and add fonts

    FLIPLIST

    The FLIPLIST utility is the font library index program list tool. It is used to display the list of fonts that are currently defined on your system. The parameters for the FLIPLIST command are as follows:

       Usage: fliplist [-i fin_file] [-o file] [-?]
         		-i fin_file 	Produce listing of this font index file
                           default: AFRCORE.FIN (with the full path
                           taken from the INI file or searched in the
                           same folder with afptoolbox.dll)
         		-o file     	Write listing to the named file
                           default: STDOUT
      	   	-?          	Prints the help message
    

    If the fin_file and file parameters contain blanks, they must be enclosed in double quotes. For example:

    fliplist -i "c:\Program Files\IBM\AFPToolbox\afrcore.fin" -o c:\temp\fontListing.txt
    

    The output from the FLIPLIST tool defines the valid input combinations for the Define Font By Attribute and Define Font By Name function calls in AFP Toolbox. Here are a few lines of output from the FLIPLIST tool:

    <TargetDir>\utils\fliplist\fliplist.exe
     
    

    Typeface Name Weight Style Width Deci- Points Char Set AFM File Pat Tech
    BOLDFACE LATIN1 Bold Roman Medium 120 C08400B0 BFC Raster
    BOOKMASTER LATIN1 Medium Roman Medium 50 C0B20050 EDFBL Raster
    BOOKMASTER LATIN1 Medium Italic Medium 50 C0B30050 EDFBLI Raster
    BOOKMASTER LATIN1 Bold Roman Medium 50 C0B40050 EDFBLB Raster
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .

    FLIPUPDT: Updating your font index

    By default, AFP Toolbox is set up to use the fonts provided with the AFP Font Collection, Version 2.1, Licensed Program 5648-B45. The font index file, AFRCORE.FIN (in the <TargetDir> shipped with AFP Toolbox), matches the fonts in the AFP Font Collection, Version 2. FLIPLIST provides a human-readable listing of these fonts. The parameters for FLIPUPDT are as follows:

       Usage: flipupdt [-f Font_index_file] [-i Input_file] [-o Output_file] [-v] [-?]
     
                        -f Font_index_file   modifies this font index file
                        -I Input_file        read input records from named file
                        -o Output_file       writes new FIN to the named file
                        -v                   verbose debug messages
                        -?                   prints the help message
     
    
    Note:
    See Using IBM Infoprint Fonts with AFP Toolbox for Windows for more font information.
    By default, FLIPUPDT reads data from the standard input, modifies the AFRUSER.FIN index file, and writes to AFRUSER.FIN.

    To update your font index by adding or deleting font definitions, follow these steps:

    1. To add a font definition, create AFP character set and code page objects for printing your font on AFP printers. You can use IBM's Type Transformer program (part of IBM AFP Font Collection) to create AFP font members from your Adobe Type 1 font and build the appropriate files.
    2. Create a flat file that contains the information for your updates. The first seven fields are separated by blanks and the last five by slashes ( / ). The pattern technology flag in the last entry field is optional. This file has 12 input fields (0-11):
      Field 0
      Indicates whether to add (a) this font to or delete (d) it from the font index.
      Field 1
      The point size as an integer in deci-points (point size times ten). The point size should be 0 for an outline font.
      Field 2
      The weight of the font as a number in the range 1-9 where 1 is ultra light, 5 is medium, and 9 is ultra bold. The possible weight values (column two) are:
      1 = ULTRA_LIGHT_WT
      2 = EXTRA_LIGHT_WT
      3 = LIGHT_WT
      4 = SEMI_LIGHT_WT
      5 = MEDIUM_WT
      6 = SEMI_BOLD_WT
      7 = BOLD_WT
      8 = EXTRA_BOLD_WT
      9 = ULTRA_BOLD_WT
      Field 3
      The width of the font as a number in the range 1-9 where 1 is ultra condensed, 5 is medium, and 9 is ultra expanded. The possible width values (column three) are:
      1 = ULTRA_CONDENSED_WD
      2 = EXTRA_CONDENSED_WD
      3 = CONDENSED_WD
      4 = SEMI_CONDENSED_WD
      5 = MEDIUM_WD
      6 = SEMI_EXPANDED_WD
      7 = EXPANDED_WD
      8 = EXTRA_EXPANDED_WD
      9 = ULTRA_EXPANDED_WD
      Field 4
      The font style as a hex number representing two bytes of information. Currently only the high order bit is defined, so specify either 0x8000 for italic or 0x0000 for roman. The possible style flag encoding values (column four) are:
      0X0000 = NORMAL_FS
      0X0800 = OVERSTRUCK_FS
      0X1000 = OUTLINE_FS
      0X4000 = UNDERSCORE_FS
      0X8000 = ITALIC_FS
      Field 5
      The name of the AFM file (file containing the Adobe Type 1 metrics). You must specify a value for this parameter, even if there is no AFM file.
      Field 6
      The name of the character set file. You must specify a value for this parameter, even if there is no character set file.
      Field 7
      The typeface or descriptive name of the font from the character set, to be used on the Define Font call.
      Field 8
      Font Family, from the Adobe font. If this is not an Adobe font, specify TypefaceName again.
      Field 9
      FontName, from the Adobe font. If this is not an Adobe font, specify TypefaceName again.
      Field 10
      FullName, from the Adobe font. If this is not an Adobe font, specify TypefaceName again.
      Field 11
      Pattern Technology is an optional field and defaults to a SBCS raster font. Supported fonts are SBCS Outline or Outline, Raster, and DBCS Outline.
    3. Run the FLIPUPDT program to build a new font index file for your fonts. A file called AFRUSER.FIN is created or modified. Move the AFRUSER.FIN to the <TargetDir> directory which contains the AFRCORE.FIN file.
    4. Run FLIPLIST to produce a listing and ensure your new font is shown as valid for AFP Toolbox.
    5. When you run your application, make sure that AFP Toolbox has access to your new font index file.

    Using IBM Infoprint Fonts with AFP Toolbox for Windows

    To use IBM Infoprint Fonts, Version 1.1, Licensed Program 5648-E77, with AFP Toolbox for Windows, you must first define them using the FLIPUPDT program. An example of the input to the FLIPUPDT program is as follows:

    a 0 5 5 0x0000 none CZ420L COURIER LATIN/COURIER LATIN/COURIER LATIN/COURIER LATIN/OUTLINE
     
    

    The complete set of the input needed for using the Infoprint Fonts is available in the "flipupdtInput.sample" file in the <TargetDir>\Samples\ directory.


    Troubleshooting


    AFP Toolbox documentation corrections

    The following are corrections to the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04:


    Begin Paragraph

    Chapter 3, page 94 change the "For the AFP Toolbox C Library:" syntax diagram from:

    int AFPBgnPgraph(
                     TBHANDLE         in_pageHandle,
                     ushort           in_paragraph_width
                     AlignmentOption  in_text_alignment,
                     ushort           in_linespacing,
                     ushort           in_max_pdepth
                    );
    

    to

    int AFPBgnPgraph(
                     TBHANDLE         in_pageHandle,
                     long             in_paragraph_width
                     AlignmentOption  in_text_alignment,
                     long             in_linespacing,
                     long             in_max_pdepth
                    );
    

    Define Field

    Chapter 3, page 121 change the "For the AFP Toolbox C Library:" syntax diagram from:

    int AFPDefineField(
                       TBHANDLE         in_docHandle,
                       AlignmentOption  in_format,
                       long             in_alignpos,
                       VertAlignOption  in_vertform,
                       long             in_leftmargin,
                       long             in_rightmargin,
                       long             in_linespacing,
                       TextOrientation  in_txtorient,
                       uint             in_shadingintensity,
                       short far*       out_fieldid
                      );
    

    to

    int AFPDefineField(
                       TBHANDLE         in_docHandle,
                       AlignmentOption  in_format,
                       long             in_alignpos,
                       VertAlignOption  in_vertform,
                       long             in_leftmargin,
                       long             in_rightmargin,
                       long             in_linespacing,
                       TextOrientation  in_txtorient,
                       uint             in_shadingintensity,
                       long             in_topthick,
                       long             in_botthick,
                       long             in_leftthick,
                       long             in_rightthick,
                       short far*       out_fieldid
                      );
    

    Put Text

    Chapter 3, page 211 change the "For the AFP Toolbox C Library:" syntax diagram from:

    int AFPPutText (TBHANDLE     in_pageHandle,
                    char*        in_textstring,
                    FontID       in_textfont,
                    char*        outp_remainstr
                    );
    

    to

    int AFPPutText (TBHANDLE     in_pageHandle,
                    char*        in_textstring,
                    FontID       in_textfont,
                    char**       outp_remainstr,
                    boolean      in_addblank
                    );
    

    AFP Toolbox updates

    The following support has been added to the AFP Toolbox for Multiple Operating System, but has not been added to the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04:


    QR Code bar code data

    Function

    Adds data to a QR Code bar code object previously started with Begin Bar Code.

    Syntax

    Figure 1. C syntax

    int AFPQRCode(TBHANDLE             in_bcocaHandle,
                  ushort               in_bcsymxpos, 
                  ushort               in_bcsymypos,
                  boolean              in_bce2a, 
                  boolean              in_bcescape,
                  short                in_bccodepage, 
                  short                in_bcversion,
                  short                in_bceclevel,
                  short                in_bcseqcount, 
                  short                in_bcseqind,
                  byte                 in_bcparity,
                  DMSPECIALFUNCTIONS   in_bcspecfunc,
                  byte                 in_bcapplind, 
                  char*                in_bcdata);
     
    

    Input parameters

    BCOCA Handle
    The handle for the bar code object to contain this data. BCOCA handle is returned by the Begin Bar Code call.
    Symbol X and Y position
    Specifies the X and Y offsets from the presentation space origin to the top left corner of the beginning of the bar code symbol. Valid range is from 1 to 32767 1440ths. Zero is NOT valid for X or Y.
    EBCDIC to ASCII translation
    This flag indicates whether the bar code date should be converted from EBCDIC to ASCII encoding. In order to print correctly the data must be encoded in ASCII code page 897. In general, if you are running on a host platform such as z/OS or iSeries your data is EBCDIC by default. So you should specify "true" for this parameter and then choose one of the following sub-parameters to specify which EBCDIC code page your data is in:
    1 "CP500" - The data is in EBCDIC Code Page 500.
    2 "CP290" - The data is in EBCDIC Code Page 290.
    3 "CP1027" - The data is in EBCDIC Code Page 1027.
    Ignore Escape Sequence
    This flag indicates whether a backslash character (ASCII X'5C' or EBCDIC X'E0') within the bar code data should be treated as an escape sequence or not. Specify "false" if the backslash should be treated as an escape, and "true" if the backslash should be treated as character data.
    Version
    The version is a direct indication of the size in rows and columns of the bar code symbol. All symbols are square; that is the number of rows are the same as the number of columns. Valid values for this parameter are from 0 to 40. The value 0 specifies that an appropriate row/column size be chosen based on the amount of symbol data. The other values/sizes start with 1 which gives a symbol 21 by 21 rows/columns and increments by four in size for each increase of version. For example:

    Version
    Size (rows by columns)

    0
    smallest necessary

    1
    21 x 21

    2
    25 x 25

    3
    29 x 29

    ...
    ...

    40
    177 x 177
    Error Correction Level
    This parameter specifies the level of error correction to be used for the symbol. Each higher level of error correction causes more error correction code words to be added to the symbol and therefore leaves fewer code words for the data. Refer to the particular bar code symbology specification for more information. Four different levels of Reed-Solomon error correction can be selected:
    0 - Level "L" allows recovery of 7% of symbol code words.
    1 - Level "M" allows recovery of 15% of symbol code words.
    2 - Level "Q" allows recovery of 25% of symbol code words.
    3 - Level "H" allows recovery of 30% of symbol code words.
    Sequence Count and Total Number of Sequences
    Multiple Data Matrix bar code symbols can be logically linked together to encode large amounts of data. This is called a structured append sequence. The logically linked symbols can be printed separately and then logically recombined after they are scanned. From 2 to 16 Data Matrix symbols can be linked together. The Sequence Count specifies the number of symbols to be linked. The Sequence Indicator specifies for each bar code symbol where it fits logically into the sequence (a number from 1 to 16). The Sequence Indicator must be 1 if the Sequence Count is 1.
    Parity
    This parameter specifies a Parity byte for the entire collection of linked structured-append symbols. The parity byte is the same for each symbol in the collection and is obtained by byte-to-byte Exclusive ORing all the ASCII data in all symbols of the collection. If this symbol is not a structured-append symbol the parameter is ignored.
    Special Functions
    These are special functions which can be used with QR Code symbols.

    128 "FNC1UCC"
    UCC/EAN FNC1 alternate data type identifier. The symbol indicates that the symbol conforms to the UCC/EAN application identifiers.

    64 "FNC1IND"
    Industry FNC1 alternate data type identifier. The symbol indicates that the symbol conforms to the specific industry or application specifications previously agreed with AIM International. When this standard is selected, an application indicator must be specified.
    Application Indicator
    When Industry FNC1 data type is specified, this parameter specifies an Application Indicator. It is ignored for other bar code data types. The application indicator is a one byte value (0 to 256) that either represents a numeric number between 0 and 99 (X'00' to X'63') or an upper or lower case alphabetic character (a - z, A - Z). To compute the number represented by an alphabetic character, add 100 to the ASCII code point value of the character. Some examples:
    "a" = ASCII value X'61' + 100 decimal = X'C5' or 197
    "z" = ASCII value X'7A' + 100 decimal = X'DE' or 222
    "A" = ASCII value X'41' + 100 decimal = X'A5' or 165
    "Z" = ASCII value X'5A' + 100 decimal = X'BE' or 190 numeric 99 = X'63' or 99
    DATA
    The string of characters to be encoded as bar code data. For the QR Code 2D bar code, a single symbol can encode up to 7089 characters depending on the type of data.

    Return Codes

    1
    Missing handle

    100
    The X or Y position is not in the range 1 to 32767

    103
    The Sequence or Total are not in range or in error

    109
    Bar code type is not for QR Code

    110
    The code page is not 500, 290, or 1027

    111
    The Version is not in the range of 1 to 40

    112
    The Error correction level is not 0 through 3

    Sample Function Call

    Create a QR Code bar code:

    C Programming Language:

    rc = AFPBgnBarCode(PageH, "BCOCA 1", MM_2_U1440(70),
                           MM_2_U1440(80), DEG_0,
                           QRCODE_BC, 0x02,
                           DEFAULT_BCFONT,
                           BLACK, DEFAULT_BCMODWIDTH,
                           -1, 1, -1, &BCH);
     
     
        if (rc)
        {
         printf("\nError In Return Code for AFPBgnBarCode: %d", rc);
         return(rc);
        }
     
        rc = AFPQRCode(BCH,
                       MM_2_U1440(1), MM_2_U1440(1),
                       TRUE, TRUE, CP500,
                       1, L, 0, 0, 0,
                       FNC1IND, 0x63,
         "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG 0123456789");
        rc = AFPEndBarCode(PageH, &BCH);
    

    CODE93 bar code data

    Adds data to a CODE93 bar code object previously started with Begin Bar Code.

    Add the following information to the "AFP Toolbox for Multiple Operating Systems User's Guide":


    Define Field Color

    Function

    Defines the default background color for a field.

    Syntax

    Figure 2. C Syntax

    int AFPDefineFieldColor (TBHANDLE     in_docHandle,
                             uint         in_fieldid,
                             ColorSpace   in_colortype,
                             MODCAColors  in_color,
                             ulong        in_colspec1,
                             ulong        in_colspec2,
                             ulong        in_colspec3,
                             ulong        in_colspec4
                             );
    

    Input Parameters

    Document Handle
    The handle for the current document returned from the Begin Document call.
    Field ID
    The ID of the field returned from the associated Define Field call.
    Color Type
    The type of color space to generate. See Begin Color in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 for a full description of this parameter.
    Color
    Any of the defined MODCA color values. See Begin Color in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 for a full description of this parameter.
    Color Specification 1-4
    Usage depends on the color space type. See Begin Color in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 for a full description of this parameter.

    Return Codes

    3
    The document handle is missing or is not valid. Make sure you have called Begin Document before issuing this call.

    25
    The field ID is invalid. Make sure you have called Define Field before issuing this call.

    69
    You have defined both shading and color for this field. Remove one of the definitions. If you specify Shading on the DefineRow and then call SetFieldColor or DefineFieldColor you will get this error.

    Sample function call

    Define color for field 3.

    C Programming Language

    colorType = CMYK_COLOR;
      color     = 0;
      colSpec1  = 50;
      colSpec2  = 00;
      colSpec3  = 00;
      colSpec4  = 00;
     
      RetCode =  AFPDefineFieldColor( docHandle,
                                      fieldID3,
                                      colorType,
                                      color,
                                      colSpec1,
                                      colSpec2,
                                      colSpec3,
                                      colSpec4);
    

    Set Field Color

    Function

    Sets the default background color for a field. Only this instance of the field will be presented with this color. This call overrides any Define Field Color call for this field. If this function is not called, the default is to the Define Field Color for this field or to no color if none is defined.

    Note:
    Toolbox will not allow both shading and color to be defined for the same field.

    Syntax

    Figure 3. C Syntax

    int AFPSetFieldColor  (TBHANDLE    in_pageHandle,
                           uint        in_fieldid,
                           ColorSpace  in_colortype,
                           MODCAColors in_color,
                           ulong       in_colspec1,
                           ulong       in_colspec2,
                           ulong       in_colspec3,
                           ulong       in_colspec4
                          );
    

    Input parameters

    Page Handle
    The handle for the current page returned from the Begin Page call.
    Field ID
    The ID of the field returned from the associated Define Field call.
    Color Type
    The type of color space to generate. See Begin Color in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 for a full description of this parameter.
    Color
    Any of the defined MODCA color values. See Begin Color in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 for a full description of this parameter.
    Color Specification 1-4
    Usage depends on the color space type. See Begin Color in the "AFP Toolbox for Multiple Operating Systems User's Guide", S544-5292-04 for a full description of this parameter.

    Return Codes

    4
    The page handle is missing or is not valid. Make sure you have called Begin Page before issuing this call.

    25
    The field ID is invalid. Make sure you have called Define Field before issuing this call.

    Sample function call

    Set color for field 3.

    C Programming Language

    colorType = CMYK_COLOR;
      color     = 0;
      colSpec1  = 50;
      colSpec2  = 00;
      colSpec3  = 00;
      colSpec4  = 00;
     
      RetCode =  AFPSetFieldColor( pageHandle,
                                   fieldID3,
                                   colorType,
                                   color,
                                   colSpec1,
                                   colSpec2,
                                   colSpec3,
                                   colSpec4);
    

    Notices

    This information was developed for products and services offered in the U.S.A.

    IBM(R) may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property rights may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

    IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to:

    IBM Director of Licensing
    IBM Corporation
    North Castle Drive
    Armonk, NY 10504-1785 U.S.A.

    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) 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.

    For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to:

    IBM World Trade Asia Corporation
    Licensing
    2-31 Roppongi 3-chome, Minato-ku
    Tokyo 106, Japan

    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
    Department 11PA Building 002S
    PO Box 1900
    Boulder CO 80301 USA

    Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee. The licensed program described in this document and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement or any equivalent agreement between us.

    Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurement may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.

    Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

    All IBM prices shown are IBM's suggested retail prices, are current and are subject to change without notice. Dealer prices may vary.

    This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.

    COPYRIGHT LICENSE:

    This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing application programs conforming to IBM's application programming interfaces.

    Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows:

    (C) (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. (C) Copyright IBM Corp. _enter the year or years_. All rights reserved.

    You are responsible for payment of any taxes, including personal property taxes, resulting from this authorization.

    Your failure to comply with the terms above terminates this authorization. Upon termination, you must destroy your machine readable documentation.


    Programming Interfaces

    This publication includes documentation of intended Programming Interfaces that let the customer write programs to obtain the services of the AFP Toolbox for Multiple Operating Systems.


    Trademarks

    The following terms are trademarks of the IBM Corporation in the United States or other countries:

    IBM(R)
    Infoprint(R)
    Advanced Function Presentation (AFP)(TM)

    The following terms are trademarks of other companies as follows:

    Windows(R), Windows 2000(R), and Windows XP(R) are registered trademarks of Microsoft, Corp.


    Copyright

    (C)Copyright International Business Machines Corporation 1995, 2004. All rights reserved.
    US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.