ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

printing with AFPDS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • printing with AFPDS

    I need to print a report where different content uses different fonts; some uses 12 cpi new time romans, some 10 cpi OCR-A. I know I need to set the CDEFNT and FONT parameters in my PRTF, what I don't know is the respective values for each Font. Can anyone help?

    Thanks for the help.

  • #2
    Re: printing with AFPDS

    Welcome deweyiu

    here is an example of a AFPDS print file. You can use *POINTSIZE to control
    the size of the font......

    I will find you a list of all font types (i have it in the attic somewhere)

    You can download a savefile with this program/Printfile running



    Display FONT set
    QSYS/DSPFNTTBL FNTTBL(*SYSHPCP)

    Code:
    A*%%***********************************************************************
         A*%%TS  RD  20010621  102326  JAMIEF      REL-V4R4M0  5769-PW1
         A*%%FI+10660100000000000000000000000000000000000000000000000000
         A*%%FI       0000000000000000000000000000000000000000000000000
         A*%%***********************************************************************
          *
          * 
          *
          * DESCRIPTION: SAMPLE AFP KEYWORD USAGE
          *
          * CREATE COMMAND: CRTPRTF FILE(mylib/printfile)
          *                         SRCFILE(mylib/QDDSSRC)
          *                         DEVTYPE(*AFPDS)
          *
          * DRAW A BOX
          *
         A          R DRAWBOX
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%***********************************************************************
         A                                      BOX(&STRY &STRX &ENDY &ENDX &LW)
         A            STRY           5S 3P
         A            STRX           5S 3P
         A            ENDY           5S 3P
         A            ENDX           5S 3P
         A            LW             5S 3P
          *
          * DRAW A HORIZONTAL LINE
          *
         A          R HRZLINE
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%***********************************************************************
         A                                      LINE(&STRY &STRX &LLEN *HRZ &LW)
         A            STRY           5S 3P
         A            STRX           5S 3P
         A            LLEN           5S 3P
         A            LW             5S 3P
          *
          * DRAW A VERTICAL LINE
          *
         A          R VRTLINE
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%***********************************************************************
         A                                      LINE(&STRY &STRX &LLEN *VRT &LW)
         A            STRY           5S 3P
         A            STRX           5S 3P
         A            LLEN           5S 3P
         A            LW             5S 3P
          *
          * DRAW TEXT USING A CODED FONT
          *
         A          R TEXTFONT
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%***********************************************************************
         A            P1PRJ         30A
         A                                      FONT(16951 (*POINTSIZE 36))
         A                                      POSITION(&Y &X)
         A            Y              5S 3P
         A            X              5S 3P
          *
          * DRAW TEXT ROTATED 90 DEGREES
          *
         A          R ROTTEXT
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%***********************************************************************
         A            TEXT          30A
         A                                      TXTRTT(90)
         A                                      FONT(2304 (*POINTSIZE 16))
         A                                      POSITION(&Y &X)
         A            Y              5S 3P
         A            X              5S 3P
         A*
         A*  REPORT
         A*
         A          R REPORT
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%FS 004
         A*%%***********************************************************************
         A                                      FONT(2304 (*POINTSIZE 15))
         A                                  5  8
         A                                      'Code400 IT Projects'
         A*
         A                                      FONT(2304 (*POINTSIZE 20))
         A            P1PROJECT      6A  O  5 65
         A*
         A* Programmer
         A*
         A                                      FONT(2304 (*POINTSIZE 20))
         A                                 12  8
         A                                      'Assigned To:'
         A                                      FONT(2304 (*POINTSIZE 15))
         A            P1USER        10A  O 12 21
         A                                      FONT(2304 (*POINTSIZE 15))
         A*
         A* Notes:
         A*
         A                                 14  8
         A                                      'Notes:'
         A                                      FONT(16951 (*POINTSIZE 25))
         A            P1NOTE1       50A  O 16  8
         A                                      FONT(16951 (*POINTSIZE 15))
         A            P1NOTE2       50A  O 17  8
         A                                      FONT(16951 (*POINTSIZE 15))
         A            P1NOTE3       50A  O 18  8
         A                                      FONT(16951 (*POINTSIZE 15))
         A            P1NOTE4       50A  O 19  8
         A                                      FONT(16951 (*POINTSIZE 15))
         A            P1NOTE5       50A  O 20  8
         A                                      FONT(16951 (*POINTSIZE 15))
         A            P1NOTE6       50A  O 21  8
         A                                      FONT(16951 (*POINTSIZE 15))
         A*
         A* Start the defining fields section
         A*
         A                                 26  8
         A                                      'Project Definition'
         A                                      FONT(16951 (*POINTSIZE 25))
         A                                 26 42
         A                                      'Comments:'
         A                                      FONT(16951 (*POINTSIZE 25))
         A*
         A*  Project definition - all fields:
         A*
         A                                 29  8
         A                                      'Category . . . . :'
         A                                      FONT(2304 (*POINTSIZE 10))
         A            P1CAT         10A  O 29 20
         A                                      FONT(2304 (*POINTSIZE 10))
         A*
         A                                 31  8
         A                                      'Department . . . :'
         A                                      FONT(2304 (*POINTSIZE 10))
         A            P1DEPT        10A  O 31 20
         A                                      FONT(2304 (*POINTSIZE 10))
         A*
         A                                 33  8
         A                                      'Date Assigned  . :'
         A                                      FONT(2304 (*POINTSIZE 10))
         A            P1ADATE        8  0O 33 20
         A                                      FONT(2304 (*POINTSIZE 10))
         A                                      EDTWRD('  /  /    ')
         A*
         A                                 35  8
         A                                      'Date Due . . . . :'
         A                                      FONT(2304 (*POINTSIZE 10))
         A            P1DDATE        8  0O 35 20
         A                                      FONT(2304 (*POINTSIZE 10))
         A                                      EDTWRD('  /  /    ')
         A*
         A                                 37  8
         A                                      'Priority . . . . :'
         A                                      FONT(2304 (*POINTSIZE 10))
         A            P1PTY          2  0O 37 20
         A                                      FONT(2304 (*POINTSIZE 10))
         A*
         A* The last 4 approval fields
         A*
         A                                 40  7
         A                                      'Date Complete:'
         A                                      FONT(2304 (*POINTSIZE 08))
         A*
         A                                 43  7
         A                                      'QC Approved:'
         A                                      FONT(2304 (*POINTSIZE 08))
         A*
         A                                 46  7
         A                                      'User Approval:'
         A                                      FONT(2304 (*POINTSIZE 08))
         A*
         A                                 49  7
         A                                      'Date Installed:'
         A                                      FONT(2304 (*POINTSIZE 08))
         A*%%***********************************************************************
         A*%%SS
         A*%%SN P1PROJECT  xxxxxx
         A*%%CL 007
         A*%%CL 002
         A*%%CL 002
         A*%%CL 001
         A*%%CL 001
         A*%%CL 001
         A*%%CL 001
         A*%%CL 001
         A*%%CL 005
         A*%%CL 003
         A*%%CL 002
         A*%%CL 002
         A*%%***********************************************************************
         A*
          *
          * EJECT THE CURRENT PAGE
          *
         A          R PAGEND
         A*%%***********************************************************************
         A*%%RI 00000
         A*%%***********************************************************************
         A                                      ENDPAGE
         A*%%***********************************************************************
         A*%%CP+999CRTPRTF
         A*%%CP+    FILE(JJFLIB/APFP)
         A*%%CP+    DEVTYPE(*SCS)
         A*%%CP     PAGESIZE(*N       198      *N     )
         A*%%***********************************************************************

    List of fonts till I can get them Identified
    Code:
    Character value, 2, 002, 3, 003, 5, 005, 8, 008, 10, 010, 11, 011, 12, 012, 13, 013, 18, 018, 19, 019, 20, 020, 21, 021, 25, 025, 26, 026, 30, 030, 31, 031, 36, 036, 38, 038, 39, 039, 40, 040, 41, 041, 42, 042, 43, 043, 44, 044, 46, 046, 49, 049, 50, 050, 51, 051, 52, 052, 55, 055, 61, 061, 62, 062, 63, 063, 64, 064, 66, 066, 68, 068, 69, 069, 70, 070, 71, 071, 72, 072, 74, 074, 75, 075, 76, 076, 78, 078, 80, 080, 84, 084, 85, 085, 86, 086, 87, 087, 91, 091, 92, 092, 95, 095, 96, 096, 98, 098, 99, 099, 101, 102, 103, 109, 110, 111, 112, 154, 155, 157, 158, 159, 160, 162, 163, 164, 167, 168, 173, 174, 175, 178, 179, 180, 181, 182, 183, 186, 187, 188, 189, 190, 191, 194, 195, 204, 205, 211, 212, 221, 222, 223, 225, 226, 229, 230, 232, 233, 234, 244, 245, 247, 248, 249, 252, 253, 254, 255, 256, 258, 259, 279, 281, 282, 285, 290, 300, 304, 305, 306, 307, 318, 319, 400, 404, 416, 420, 424, 428, 432, 434, 435, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 1051, 1053, 1056, 1351, 1653, 1803, 2103, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 4407, 4427, 4535, 4919, 4939, 5047, 5067, 5687, 5707, 5815, 5835, 5943, 6199, 6219, 6327, 6347, 8503, 8523, 8631, 8651, 8759, 8779, 8887, 8907, 12855, 12875, 16951, 16971, 17079, 17099, 33335, 33355, 33463, 33483, 33591, 33601, 33719, 33729, 34103, 34123, 34231, 34251, 37431, 41783, 41803

    Example from IBM
    Code:
    |...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
         A*
         A          R REC1                      FONTNAME('Monotype Sans Duospace WT' +
         A                                      (*POINTSIZE 15.1) +
         A                                      (*CODEPAGE USERLIB/CDP1))
         A*
         A            FLD1A         14G     3  8FONTNAME('Monotype Sans WT' +
         A                                      (*POINTSIZE 10.0))   +
         A                                      CCSID(13488 *NOCONVERT)
         A*
         A            FLD2A          6A     4  8FONTNAME('Monotype Sans Duospace WT' +
         A                                      (*POINTSIZE 99.9) +
         A                                      (*CODEPAGE USERLIB/&DATA1))
         A            DATA1          8A  P
         A*
         A            FLD3A         10G     5  8FONTNAME('Times New Roman WT J' +
         A                                      (*POINTSIZE 5.0 3.0) +
         A                                      (*ROTATION 270) +
         A                                      (*IGCCODEPAGE +
         A                                       USERLIB/IGCCDP1))
         A*
         A            FLD4A         10O     7  8FONTNAME('Times New Roman WT J' +
         A                                      (*POINTSIZE 7.0 5.0) +
         A                                      (*ROTATION 270) +
         A                                      (*CODEPAGE USERLIB/CDP2) +
         A                                      (*IGCCODEPAGE +
         A                                       USERLIB/IGCCDP2)) +
         A                                      TTXRTT(90)
         A*
         A            FLD5A          8A     8  8



    The following fonts are shipped with OS/400 (installed with option 43 - Additional fonts):

    Code:
    Monotype Sans WT 
    Monotype Sans WT J 
    Monotype Sans WT K 
    Monotype Sans WT ME 
    Monotype Sans WT SC (see note) 
    Monotype Sans WT TC 
    Monotype Sans Duospace WT 
    Monotype Sans Duospace WT J 
    Monotype Sans Duospace WT K 
    Monotype Sans Duospace WT ME 
    Monotype Sans Duospace WT SC (see note) 
    Monotype Sans Duospace WT TC 
    Monotype Sans Duospace Ext B (see note) 
    Times New Roman WT 
    Times New Roman WT J 
    Times New Roman WT K 
    Times New Roman WT ME 
    Times New Roman WT SC 
    Times New Roman WT TC 
    Thorndale Duospace WT 
    Thorndale Duospace WT J 
    Thorndale Duospace WT K 
    Thorndale Duospace WT ME 
    Thorndale Duospace WT SC 
    Thorndale Duospace WT TC
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: printing with AFPDS

      hi,
      i have a question about AFPDS printing.
      I have an application that prints text-data on a white A4-paper.
      Now i like to know if it should be possible to print my data on a LOGO-Colored A4paper that has been scanned on a PC.
      In other words: can i "load" that scanned file in memory and "paste" my as400 data into it with an AS400-program in HLL ?
      Can i also on the same "logo-paper" place other scanned-in drawings ?
      If possible can i see a code example of this ?


      Thanks for your reply.

      Comment


      • #4
        Re: printing with AFPDS

        Yes this is possible...No I dont have an example......

        You have to create an overlay......

        Here is one example I found
        Code:
        How to create an overlay (with IPDS printers)
        
        1.  Download AFP Drivers for the PC (currently 1.62a) and follow the
        Readme.txt instructions.
        The site with the most updated drives is the Client Access site not the IBM
        Printing site.
        
        [SIZE=2]I stored the AFPToolkit in case IBM changes their site AGAIN!!!!!
        [/SIZE]     
        
        [URL]http://www.code400.com/downloads/AFP.zip[/URL]
        
        
        
        
        ====> For windows 2000+
        [URL=ftp://ftp.software.ibm.com/as400/products/clientaccess/win32/afpprinter/]FTP Site[/URL]
        This is a wizard that will help you set up AFP printers on you PC.  I would
        set up at least the 240, 300 and 600 DPI printers. (For PORT use "File".)
        
        If you already have drivers and get errors use the above set of drivers.
        Just delete all AFP printers first and do a selective install on Client
        Access removing AFP drivers.
        
        You may find drivers for other OS's at the IBM printing site:
        ===>[URL=http://www-1.ibm.com/support/docview.wss?rs=95&uid=psd1P4000385] AFP tool kit  [/URL]
        
        
        
        2.  Design the overlay using a PC application.  Microsoft Word works fine.
        If the form is on paper you can scan the form using Acrobat.  In either
        case, print  to one of the afp printers that were created in Step 1.  Use
        the Properties => Advance tab to make sure "Output Type" is Overlay (default
        is document).  If this is changed on the printer it shouldn't have to be
        changed each time you print.  If you save the AFP output file to c:\ it will
        save typing later.  Use 8.3 file names.
        
        3. Create a PF on the iSeries.  I would create one for each application or
        each DPI. Example: AFP600 or PAYROLL.  Also create it without a member.
        
        CRTPF FILE(library/file) RCDLEN(32766) MBR(*NONE) MAXMBRS(*NOMAX)
        LVLCHK(*NO)
        =====>One file can be used for several overlays
        =====>RCDLEN(8201)  didn't work.
        
        4.   Add a member for the overlay to be created.:
        
        =====>(new member for each overlay)
        ADDPFM FILE(library/file) MBR(member) TEXT(description)
        
        
        5.   ftp file to the iSeries or copy to the IFS.  Directions to ftp are:
        
        From a Command Prompt (Start=>Run=>Type "CMD")
        
             ftp iSeriesname
             bin
             cd library                                        ====>iSeries Library
             lcd directory                                     ====>PC directory
             put pcfilename iSeriesfilename.membername         ====>iSeries file
        name
        
        6.   Create the overlay on the iSeries using the following command:
        CRTOVL OVL(library/overlay) FILE(library/file) MBR(member) DATATYPE(*AFPDS)
        
        If the overlay fails to create, see Step 1.
        Most of the time the overlay fails to create because there is no data in the
        file (bad ftp) or the wrong driver was used.
        
        7.   Override the print file or job with at least the DEVTYPE(*AFPDS) and
        FRONTOVL(library/overlay) options.
        
        Example Override: This includes a Constant backside overlay that doesn't
        require backside programming.
        
        OVRPRTF FILE(QPDZDTALOG) TOFILE(*FILE) DUPLEX(*YES)
        FRONTOVL(library/overlay) BACKOVL(library/overlay 0 0 *CONSTANT)
        ====> For a fast test print  I use =>job OVRPRTF (Qpdzdtalog) =>STRDFU
        =>Option 5=> update a record and get a log print.
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: printing with AFPDS

          Thanks for your reply.
          I think your solution will do the printing-work on a PC-workstation.
          However what i am looking for is the following scenario:
          1- Scan in a colored A4-page with logo and other pictures on a PC-harddisk.
          2- Copy the scan-file(s) into the IFS-system
          3- Create a PRTF (AFPDS) in which we could use:

          1-the LOGOpage
          2-Define on this page the place where pictures should be printed
          3-Define the AS400-Data that should be printed (in different Font-sizes)
          4- Print that all using an HLL on AS400.

          Is this possible ? I saw a time ago an IBM-example with OVERLAY-keyword in the PRTF.

          Kind Regards.

          Comment


          • #6
            Re: printing with AFPDS

            The above steps shows how to convert a PC graphic to an as400 convertable image. It is then stored in a table you create.
            Code:
            CRTPF FILE(library/file) RCDLEN(32766) MBR(*NONE) MAXMBRS(*NOMAX)
            LVLCHK(*NO)
            Then use the command
            Code:
            CRTOVL OVL(library/overlay) FILE(library/file) MBR(member) DATATYPE(*AFPDS)

            .......etc


            If you download the APF.zip file it contains RPG example.


            I believe all info to get this running on the Iseries, I5......is here...I just havent done it myself.

            I know you have to define a printer on your PC this is for graphic conversion only and required.

            The different font sizes is easy check out




            Thanks
            Jamie
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment

            Working...
            X