RPGIV @ Work

A unique site for RPG and System i Lovers


Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Printing Signatures from RPG Print E-mail
User Rating: / 1
Written by Chamara Withanachchi   
Printing Signatures from RPG

To print signatures from a RPG program I’m using Page Segments in side a printer file, bellow are the steps how to achieve it.

First of all let’s see what a Page Segment is
A page segment is a concept in AFP for internal and external resources. A page segment is an object that is defined once and invoked multiple times in a document. Typical page segments are:
  • Company Logo (wrapped in a Page Segment)
  • Facsimile Signatures (wrapped in a Page Segment)
How to Create a Page Segment
Step 1
Print the selected signature using IBM AFP Printer, in the “Printing Reference” select property as bellow.
Paper size as 26mm by 25.4mm
Output Type as Page Segment
Then enter a name to be saved and proceed with printing
Step 2
Import to AFP Manager in your IBM i Server
Drill down AFP Manager -> Resources and select Page Segments
Drill Down
To import new Page Segment, right click and select Import. Then browse for the created Page Segment and select Open
Specify the resource name and library and a description for the Page Segment and select OK to import.
Import Cont....
You are done with importing now lets look how the Printer file and you RPG program
        A          R SIGN                                                          
A*%%RI 00000                                                              
A                                      PAGSEG(&MYLIB/&PAGSN1  &OFFD &OFFA)
A            MYLIB         10A  P                                         
A            PAGSN1         8A  P                                         
A            OFFD           5S 3P                                         
A            OFFA           5S 3P                                         
Compile your printer file with following keyword
RPG Program
        C                   eval      PAGSN1 = ‘CHAMARA’
C                   eval      OFFD = 5.24
C                   eval      OFFA = 3.25
C                   eval      MYLIB = ‘CHAMARA’

C                   write     SIGN
For more information about creating Page Segments


<Previous   Next>