IBM Support

Creating AFP Resources Using the AFP Printer Drivers

Troubleshooting


Problem

This document describes how to install and configure the AFP drivers provided by Ricoh to create overlays and page segments.

Resolving The Problem

IBM AFP resources such as overlays, medium overlays, or page segments can be created with the AFP printer driver provided by Ricoh. 


Install the AFP Printer Driver
Obtain the latest version of the driver from Ricoh:  AFP Printer Driver Update:  https://www.ibm.com/support/pages/afp-printer-driver-update
Use the Add Printer function in Windows to manually install the AFP print driver provided by Ricoh.
Select to Add a local printer or network printer with manual settings.
Choose the existing Printer Port as FILE:  (Print to File).
During the installation, when prompted to install the printer driver, select Have Disk and browse/choose the installation directory, default C:\AFP Driver
Select the cwbafp.inf file and click OK
Select the driver that you want to use
   If uncertain, the recommendation is to select Generic Infoprint 300 dpi AFP because it is compatible with the widest range of  printers.
Complete the installation

Configuring the AFP Printer Driver
Before using the driver, configure it to match your desired output. For example, if you wish to create an overlay you should configure the driver to output data as an overlay; if creating a page segment, you should configure the driver to output data as a page segment.
Work with the Printing Preferences for the installed Generic Infoprint AFP print driver.
Click on the Output Type field and select your desired output.

AFP driver printing preferences

Printing from a Windows Application

With the AFP driver installed, you can create your overlay or page segment by printing to the AFP driver. This can be done from any Windows application with print capability; however, there are some suggestions you should keep in mind.
1. If you are creating a custom electronic form like a purchase order or invoice that is tailored for your business, you will want to use an application which lets you draw lines and boxes and include text. Typically, full page editing applications like word processors are best at this.
2. If you are creating an electronic form that is an industry standard form, like a government tax form, look for an electronic version of the form to use to create your overlay. Many government forms are available in PDF format online, and the overlay will be of much higher quality if printed through Adobe Acrobat Reader to the AFP driver than if you scan in the form and print it as an image from an imaging application.
3. If you are designing a logo, keep the following in mind. For the most part, the AFP drivers are programmed to output a black and white image. To ensure your resulting AFP source image prints as good as possible, try printing to the AFP driver from both a gray scale or color image and an image which has been converted to a Black and White (1-Bit) palette. The output that is sent to the AFP driver is dependent on your imaging application, so you may want to try printing from different applications to see how it looks.

For more information on using the AFP printer driver to create color overlays, please refer to the following document:

 Generating Color Overlays and Page Segments Through the IBM AFP Print Driver
4. Picture editing applications often do not have the layout options necessary to format a printout. This will cause your overlays and page segments to position incorrectly or be clipped. Try to use another application if possible.
5. When requesting images from co-workers or your company's art or design department, request high quality images in TIFF, GIF, or BMP format if possible. JPEG images, while typically the most commonly used, are lossy image formats, meaning that they do not store an image precisely, but rather try to save space by grouping similarly colored areas of the image. This makes the file smaller, but of low quality when printed. TIFF, GIF, BMP (and some other) image formats are lossless, meaning that each pixel of the image will actually be printed as shown. These image types create much better print output.

Note: The resulting AFP image will be the same size no matter what image type you start with. The size of the resulting AFP file depends on the quality and resolution of the input image.
6. If you wish to create as high quality an image as possible, make your input image match the resolution of your AFP driver. If you will be using the Generic IBM 300dpi AFP driver, your image should be 300 DPI. If using the Generic IBM 600dpi AFP driver to print to an IPDS printer (typically used for signatures for ultra high quality) try to get a 600 DPI input image.
7. If printing using Host Print Transform, use the Generic IBM 300dpi AFP driver. Host Print Transform dithers all AFP resources up to 300 DPI from regardless of the source resolution, so using the 300dpi driver avoids burning CPU cycles at print time.
8. If printing from Adobe Reader, there is an "Advanced" button on the print dialog. Click that button, and then check the "Print as Image" box. If the resulting data is truncated halfway across the page, try going to the Clip Limits of the AFP driver, select 'Unprintable Area", and set the left and right unprintable area to 0.25 inches.

When you are ready to print from your Windows application, click File > Print and select the AFP driver. Click on the Properties button to view the current driver settings:
1. Ensure that your Output type matches your desired output. If you leave it at Document it will not work.
2. If you are creating an overlay that will printing on 8.5 x 11 paper, you can probably safely take all the defaults. To better control the margins, click on Clip Limits and change the default 0.25 top and left margin to 0.00. This will allow the image to print as far to the left and top as possible, and will allow you to define the image margins from the application rather than relying on the driver.
3. If you are creating a page segment, ensure that you select the Output Type of page segment and then click Clip Limits to bring up those options as well. The Help dialog boxes will help you decide how to best clip your image. Remember that page segments do not really relate to page margins. The Clip Limits are really specifying that the AFP driver is selectively choosing which portion of the printed document or image will be used as the page segment. Again, the Help text is very valuable for making clipping decisions.
4. If Print Text as Graphics is set to On, any text included in your overlay or Page Segment will be converted to an image. This is what you want. If you select Off for this option, your printed output will probably not match your Windows application. Save time by leaving this set to On.

AFP driver advanced document properties

AFP driver clip limits


When the settings are set properly, click OK on the Properties screen and click Print or OK from the application to send the document to the driver. Because the driver is configured to output to FILE, a small dialog box will pop up asking you to save the file.

You can save your AFP source file as whatever you want. The extension does not matter, but we recommend saving overlays as .OVL and page segments as .PSG. This helps you better organize your AFP files, and has the additional benefit of allowing you to configure the AFP Workbench Viewer to be able to automatically load and preview your AFP resources before you transfer them to the IBM i and convert them into AFP objects. Double-click on your resulting .OVL or .PSG file, and you will be prompted to select the application that will open the files by default.

Open With dialogue box


Transferring the PC File to the IBM i

Now that you have created your AFP resource file, you are ready to transfer the file to the IBM i. Most commonly, the AFP Manager in Navigator for i is used to automate the entire process. If that is not available, you may use FTP, IBM i Access Client Solutions, or Netserver to manually transfer the file.
    • - Automated transfer with AFP Manager
      1. Launch Navigator for i for the desired system.
      2. Locate AFP Manager and select the appropriate resource being uploaded, Overlay or Page Segment.  The remaining steps assume an overlay is being imported.
      3. Select ACTIONS / IMPORT
      4. Browse for the source file name, which is the name of the file that you generated when you "printed" through the AFP printer driver from your Windows application.
      5. Type the resource name, which is the name you want to use for the overlay.
      6. Browse for the library where you want the resource stored.
      7. Type a description, which will be the text description used for the *OVL object.
      8. Specify an object authority (the default is "library create"), leave the data type set to AFPDS, and click OK.
      9. Once the Import dialog box has disappeared, verify that the object has been created. This can be done by looking for the resource under AFP Manager, or by utilizing the WRKOBJ command on the System i.
      • - Manual transfer with FTP


        A physical file must be created in the operating system before the AFPDS resource can be created. The physical file should be created with a record length of 32766 and a record format level check of *NO for the resource to be created properly. 
        CRTPF FILE(QGPL/AFPRES) RCDLEN(32766) MAXMBRS(*NOMAX) LVLCHK(*NO)

        To begin the FTP, do the following:

        1. At the Windows Command Prompt:

        ftp system_name

        Press the Enter key.
        2. Log in to the IBM i system
        3. Change to binary mode:

        bin

        Press the Enter key.
        4. Change to the library where the physical file is on the IBM i:

        cd library

        where library is the name of the library. Press the Enter key.
        5. Change to the directory on the PC where the AFP resource is located:

        lcd directory

        where directory is the name of the directory. Press the Enter key.
        6. Transfer the PC file:

        put PC_file_name OS400_file_name.OS400_member_name

        where PC_file_name is the name of the file on the PC and OS400_file_name.OS400_member_name is the file and member name on the IBM i system. Press the Enter key.
        7.
        End the FTP session:
        QUIT
        Press the Enter key.
        Here is what a successful FTP might look like:

        C:\>ftp systemname
        Connected to system.com.
        220-QTCP at SYSTEM.
        220 Connection will close if idle more than 20 minutes.
        User (system.com:(none)): USERID
        331 Enter password.
        Password: XXXXXX
        230 USERID logged on.
        ftp> bin
        200 Representation type is binary IMAGE.
        ftp> cd qgpl
        250 "QGPL" is current library.
        ftp> lcd c:\
        Local directory now C:\.
        ftp> put logo.ovl overlays.logo
        200 PORT subcommand request successful.
        150 Sending file to member LOGO in file OVERLAYS in library QGPL.
        250 File transfer completed successfully.
        ftp: 4531 bytes sent in 0.00Seconds 4531000.00Kbytes/sec.
        ftp> quit
        221 QUIT subcommand received.

        Creating the Operating System Resource
        Once the source file has been FTPed to a physical file, the AFP resource must be created..

        Use the Create Overlay (CRTOVL) command for overlays and medium overlays. 
        CRTOVL OVL(QGPL/OVERLAY) FILE(QGPL/AFPRES) MBR(OS400_member_name)
               DATATYPE(*AFPDS) TEXT('Overlay created using the AFP driver')

        Use the Create Page Segment (CRTPAGSEG) command for page segments. 
        CRTPAGSEG PAGSEG(QGPL/PSEGMENT) FILE(QGPL/AFPRES) MBR(OS400_member_name)
                  TEXT('Page Segment created using the AFP driver')
       
        • - Transfer with IBM i Access Client Solutions and QDLS File System
        • NOTE:  This example is for a page segment.  For this method, the AFP file on the PC needs to have DOS name format (8.3), for example file.prn.  Rename the file to have the extension of .prn instead of .ovl or .psg.  Additionally, authority to /QDLS is required.

        • Create a folder or use an existing one:
          CRTFLR FLR(TEST)

        • From IBM i Access Client Solutions (ACS) Integrated File System, upload the PC file to '/QDLS/TEST'.  

        • Create a physical file to house the AFP resource:
          CRTPF FILE(QGPL/AFPRES) RCDLEN(32766) MBR(*NONE) TEXT('OVERLAY FILE') MAXMBRS(*NOMAX) LVLCHK(*NO)

        • Copy the AFP resource from /QDLS/TEST to the physical file:
          CPYFRMPCD FROMFLR(TEST) TOFILE(QGPL/AFPRES) FROMDOC(file.prn) TOMBR(PAGSEG) TRNTBL(*NONE) TRNFMT(*NOTEXT)

          Create the page segment using the Create Page Segment (CRTPAGSEG) command:
          CRTPAGSEG PAGSEG(LibraryName/PageSegmentName) FILE(QGPL/AFPRES) MBR(PAGSEG)

          • - Transfer with Netserver

            Create a physical file to hold the AFP data:
            CRTPF FILE(QGPL/AFPRES) RCDLEN(32766) MAXMBRS(*NOMAX) LVLCHK(*NO)

            A shared folder must be assigned or a network drive must be mapped.  For example:
            \\IBMi_NetServer\QSYS.LIB\QGPL.LIB\AFPRES.FILE

            Specify, for example, Y:\MYOVRLAY.MBR, where Y is the drive that was mapped and MYOVRLAY is the name of the member in the physical file to create. The name must follow standard IBM i member naming convention, and the extension must be .MBR.
            Press the Enter key.

            Create the AFPDS Resource using the Create Overlay (CRTOVL). For example:
            CRTOVL OVL(MYLIB/MYOVRLAY) FILE(QGPL/AFPRES) MBR(MYOVRLAY)


          Testing your new file

          Advanced Function Printing Utilities (AFPU), if installed, can be used to test the overlay or page segment.
            • - Testing an Overlay with AFPU
              1. Use the Start AFP Utilities (STRAFPU) command to start the Advanced Function Printing Utilities (AFPU).
              2. Select Option 22 (Work with overlays).
              3. Find the overlay to be tested by using the Library, Overlay and/or Position to prompts on the Work with Overlays screen.
              4. Select Option 6 (Print) next to the overlay.
              5. The output queue prompt should be set to the name of an output queue where the spooled file is to be created. AFPU will generate an *AFPDS spooled file that contains the overlay and will place that spooled file in the output queue that is specified.
              • - Testing a Page Segment with AFPU
                1. Use the Start AFP Utilities (STRAFPU) command to start the Advanced Function Printing Utilities (AFPU).
                2. Select Option 23 (Work with page segments).
                3. Find the page segment to be tested by using the Library, Overlay and/or Position to prompts on the Work with Page Segments screen.
                4. Select Option 6 (Print) next to the page segment.
                5. The output queue prompt should be set to the name of an output queue where the spooled file is to be created. AFPU will generate an *AFPDS spooled file that contains the page segment and will place that spooled file in the output queue that is specified.
              Without AFPU an overlay can be tested by setting the name in the FRONTOVL field of an *AFPDS spooled file. For example, OVRPRTF FILE(QPDSPNET) DEVTYPE(*AFPDS) FRONTOVL(YOURLIB/YOUROVL), followed by DSPNETA OUTPUT(*PRINT). A page segment, however, would require an externally-described printer file that uses the PAGSEG (Page Segment) DDS keyword and an RPG, C, or COBOL program that generates a spooled files using the externally-described printer file.
               

              Uploading using the ACS Integrated File System (IFS) Interface 

              To transfer the AFP resource to your physical file, you can use the ACS IFS Interface.  This is a complete example of using that process to create an overlay on my system called AFPSTUFF:

              1. Create a new physical file:
                CRTPF FILE(QGPL/AKSCHROE/AFPSTUFF) RCDLEN(32766) MAXMBRS(*NOMAX) LVLCHK(*NO)
              2. Use the AFP driver on your PC to create an AFP resource file. After creating the AFP file and checking it ion the AFP Viewer, rename it to match the new physical file member. Mine was AFPSTUFF.MBR.
              3. Navigate to the physical file member in the ACS IFS Interface using this naming convention:
                /QSYS.LIB/LIBRARY.LIB/PHYSICALFILE.FILE
              4. Upload the AFPSTUFF.MBR file into the physical file, using the option to replace the existing file.
                IFS Upload of AFP resourceRFile into a Physical File
              5. Create the Overlay using the CRTOVL command:
                CRTOVL OVL(KSCHROE/AFPSTUFF) FILE(KSCHROE/AFPSTUFF)
              Video Resources for Installing and Using the AFP Driver.

              These videos show how to install and configure the AFP driver, and how to use the AFP Driver to crate a high quality page segment.
               
              This video demonstrates how to take a high resolution scanned image and convert it to a vector graphic so that you can create a page segment at exactly the right size and high quality you need.

              [{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

              Historical Number

              5184341

              Document Information

              Modified date:
              08 August 2024

              UID

              nas8N1018625