Creating barcodes with AFP Enhancer

AFP Enhancer lets you create barcodes in AFP files.

The barcode must be a consistent size and in a consistent position on every page. If text, an image, or another barcode already exists in the area where you want to create a barcode, first hide the area so that the existing text, image, or barcode does not print.

To determine the exact origin and size of the barcode area, work from a copy of the sample AFP file printed on the production printer. Start at the top-left corner of the page and measure the distance to the top-left corner of the barcode area. The horizontal distance is the X position; the vertical distance is the Y position. For BCOCA barcode objects, also measure the width and height of the area to determine where to place the bottom-right corner. The X position of the bottom-right corner is the X position of the top-left corner plus the width. The Y position of the bottom-left corner is the Y position of the top-left corner plus the height.

Note: In RICOH Visual Workbench you can display measurement units in inches or millimeters. To change the measurement unit, click View Units.
To create a barcode:
  1. In RICOH Visual Workbench, open a sample AFP file.
  2. If the file does not contain page groups or index tags for variable values (such as ZIP codes) that you want to use in barcode data, use AFP Indexer to create page groups and index tags.
  3. If you want the barcode to include data from a document property and an index tag is not mapped to the document property, use Document Property Designer (DPD) to link the index tag to the document property.
  4. Click Mode AFP Enhancer.
  5. Navigate to the page where you want to create the barcode:
    • To place a barcode on the same page in every page group, navigate to that page in any page group.
    • To place a barcode on multiple pages (for example, on even pages in every page group), navigate to one of the pages in any page group.
  6. Position your cursor at the top-left corner of the barcode area. While pressing the left mouse button, draw a box the approximate size of the barcode area.

    In a later step, you specify the exact position and size of the barcode area.

  7. Right-click anywhere in the AFP file and click Create barcode.
  8. On the Type tab, type a name for the barcode area.
  9. Select the barcode type.

    The table shows the valid characters for each barcode type.

    Valid characters for barcodes

    Barcode type Valid characters Total number of characters
    Code 39 0123456789 ABCDEFGHIJKLM NOPQRSTUVWXYZ - . $ / + % space character 0 to 50 characters
    Interleaved 2-of-5 0123456789 0 to 50 characters
    Data Matrix Any one-byte character, or binary data 0 to 3116 characters
    POSTNET 0123456789 The number of digits depends on the barcode property selected on the Type tab:
    • ZIP Code: 5 digits
    • ZIP Code + 4: 9 digits
    • Advanced Bar Code (ABC): 11 digits
    • Variable-length barcode: 0 to n digits (barcode receivers support at least 50 digits)
    QR Code Any one-byte character, or binary data 0 to 3116 characters
    Intelligent Mail barcode 0123456789 20 to 31 characters

  10. Select a generation method:
    • BCOCA objects

      This object follows the Bar Code Content Object Architecture (BCOCA).

      Generic barcodes

      This object guarantees compatibility on all IPDS printers.

      Font barcodes

      A Presentation Text Object Content Architecture (PTOCA) object with transparent text represents the content. The referenced font resource must be available when printing.

      DrawRule barcodes

      A PTOCA object uses rules to represent the content.

  11. Specify the content of the barcode using Content Expression Language (CEL).

    AFP Enhancer provides several CEL examples for you to select and modify. For more information, see the related reference topic on supplied CEL examples in the RICOH ProcessDirector information center.

      Note:
    • You can type carriage return control characters in the Content area. The carriage returns are removed when you export your enhancements to an EnhanceAFP control file.

    • You can copy CEL expressions from other sources and paste them into the Content area.

    • AFP Enhancer does not validate CEL syntax.

  12. Specify properties for the type of barcode you selected.
    The table describes the properties for each barcode type.

    Barcode properties

    Barcode type Property and description
    Code 39 and Interleaved 2-of-5 Include check digit: A check digit ensures data integrity during the bar coding reading process. If you select Yes, a check digit is included in the barcode symbol.
    Data Matrix Number of rows: If you select Auto, an appropriate number of rows is used for the amount of data in the barcode symbol.
    Row size: If you select Auto, an appropriate row size is used for the amount of data in the barcode symbol.
    POSTNET ZIP Code barcode: The barcode symbol consists of a leading frame bar, the encoded ZIP Code data, a correction digit, and a trailing frame bar. The ZIP Code data is a 5-digit number.
    ZIP Code+4 barcode: The barcode symbol consists of a leading frame bar, the encoded ZIP+4 data, a correction digit, and a trailing frame bar. The ZIP+4 data is a 9-digit number.
    Advanced Bar Code (ABC): The barcode symbol consists of a leading frame bar, the encoded ABC data, a correction digit, and a trailing frame bar. The ABC data is an 11-digit number.
    Variable-length barcode: The barcode symbol consists of a leading frame bar, the encoded data, a correction digit, and a trailing frame bar. The encoded data is variable length.
    QR Code Size: The size of the barcode symbol, represented by the number of modules in each row and column. The values are 21x21 to 177x177, or smallest, which indicates the smallest size that can include all data.
    Intelligent Mail barcode None
  13. Click the Location tab.
  14. Specify the location of the barcode area:
    • In the Location fields, specify the X and Y positions of the top-left corner.
    • In the Right Location fields, specify the X and Y positions of the top-left corner on right-hand pages.
        Note:
      • If you do not specify values for the Right Location fields, AFP Enhancer uses the values in the Location fields for all pages.

      • Use values in both the Location and Right Location fields if 2–up is enabled and the Page Placement value is All Fronts Left And Right.

    AFP Enhancer lets you specify decimal values for the X and Y positions or use CEL expressions. For example, a CEL statement can position a barcode to the right of indexed data that varies in each document.

    Note: To specify an orientation of 90, 180, or 270 degrees, you edit the EnhanceAFP control file manually after you save the barcode in the Visual Workbench control file. Then you export the EnhanceAFP control file.

  15. Specify the pages on which to place the barcode in each page group.
  16. Optional: Specify a trigger using a CEL expression.

    Examples:

    • You want to place a barcode on every document with two or more pages. Use this expression:

      total_pages_in_mp != 1

    • You want to place a barcode on each document sent to California that has yes as the value of the Doc.Custom.PolicyDiscount document property. Use this expression:

      and(Doc.State == CA, Doc.Custom.PolicyDiscount == yes)

  17. Click the Preview tab.

    The Origin of area values show the X and Y positions of the upper-left corner of the barcode area you drew. The Size of area values show the width and height of the barcode area.

    Note: The values on the Preview tab are used to display the barcode in RICOH Visual Workbench. They do not change when you change the values on the Location tab. The values on both tabs are saved in the Visual Workbench control file. Only the values on the Location tab are exported to the EnhanceAFP control file and used to place the barcode on the documents in the AFP file.

  18. Type sample barcode data in the Sample Text field.
    If you leave the field blank, the barcode symbol does not display in RICOH Visual Workbench.
    Note: Intelligent Mail barcodes are an exception. They display even when the Sample Text field is blank.
  19. Click OK.
    You see the barcode symbol in the AFP file.
      Note:
    • Preview displays the barcode on the same relative page in each page group. If you drew the barcode area on page 1 of one document, Preview displays the barcode on page 1 of all the documents. The page placement and trigger values on the Location tab specify barcode placement on the pages of the documents in jobs in the workflow.

    • If you created a text IMB but do not see the barcode symbol, identify the resource directory that contains the AFP IMB font to RICOH Visual Workbench (Resources Specify Resource Directories). The AFP IMB font is installed in the aiw/aiw1/plugins/EditAFP (Linux) or C:\aiw\aiw1\plugins\EditAFP (Windows) directory.

  20. Click File Save Control File to save the barcode in the Visual Workbench control file.
  21. When you are ready to use the enhancements in the Visual Workbench control file (including the new barcode) in your workflow, click Tools Export EnhanceAFP Control File and choose a directory for the exported file.
  22. To specify an orientation of 90, 180, or 270 degrees, add this line to the EnhanceAFP control file with a text editor:

    #Afp.barcode_type.Orientation[barcode_name]=Degrees90

    where barcode_type is the type of barcode in the EnhanceAFP control file and barcode_name is the name that identifies a barcode, text insertion, or hidden area.

    For example:#Afp.LinearBarcode.Orientation[IMB-Verify]=Degrees90

    Note: When you edit an EnhanceAFP control file manually, the edits are not saved in the Visual Workbench control file. If you make additional enhancements and save them in the Visual Workbench control file, you must export the EnhanceAFP control file to make the new enhancements available to the workflow. Then you must manually edit the new EnhanceAFP control file to add the edits that you made in the original EnhanceAFP control file.

    This figure shows four barcode areas with different orientations (0, 90, 180, 270 degrees) of the barcode symbol.

    Barcode areas with four orientations of barcode symbol

    Image showing 4 barcodes with symbols in different orientations