IBM AFP Printer Driver for Windows Creating Resources for AS/400 Printing Applications The IBM AFP Printer Driver for Windows creates AFP documents, overlays, and images (page segments) from any Windows applica- tion. On AS/400, you can create electronic overlays or page seg- ments by sending the file from the IBM AFP Printer Driver to a shared folder, copying to the document to a physical file, and then using the CRTOVL or CRTPAGSEG commands to create the re- quired AS/400 object. The AFP Printer Driver for Windows can create efficient resources for use on your AS/400 with such tech- niques as using compressed image, the mapping of Windows fonts to AFP fonts, and the conversion of overlay elements such as lines and boxes to AFP rule elements (as opposed to creating image). Driver Installation and Use: ____________________________ Instructions can also be found in the "README" file on the IBM AFP Printer Driver diskette. 1. Install the print driver by using "PRINTERS" option of Windows "CONTROL PANEL". There are a number of differ- ent versions of the printer driver. These versions dif- fer in the specific printer characteristics they support - for example, 240 dpi versus 300 dpi, support of com- pressed image, and more. There are versions set up for specific IBM printers that automatically incorporate the printing characteristics of that printer. You can also install the generic versions (240, 300 dpi) and tailor the options yourself. 2. Select "CONNECT" on driver panel, and select "FILE" un- der that option to specify that the driver will create a file, not print to a printer 3. Setup the driver with your Windows program using the normal setup method for that program 4. Review the options of the driver. You first select whether you are creating an overlay or a page segment. Then, set up any options specific to each print re- source: For overlays: _____________ * Type of overlay, "MEDIUM OVERLAY" or "OVERLAY". ME- DIUM OVERLAY assumes the dimensions of the medium, which is the paper size. It provides the ability to specify offsets for printers that have an unprint- able area around the edge. The OVERLAY option pro- vides full control over the overlay dimensions and offsets. This is especially useful if you are plac- ing multiple overlays on a physical page. * Font Mapping. If your overlay contains text, you should consider using Windows fonts (ie. Adobe Type 1 and TrueType) that map directly into AFP fonts. If a font is not mapped, it is converted to image in the creation of the overlay. Mapping your fonts will result in a smaller, higher-performing AFP overlay. For page segments: __________________ * Use the paper size and clip limits to define the di- mensions of the page segment, or . . . * Many Windows programs provide an option to "clip" your image as you "print" it with the driver. Note: If you are using the same options each time you use the printer driver, you should specify the options under the Windows Control Panel. 5. When ready, you "print" with the driver and it prompts you for a filename - this can be on a shared folder drive. Object Creation on AS/400: __________________________ Once the overlay or page segment file has been created, use the following commands to create the AS/400 object. It is assumed that the file created by the IBM AFP Printer Driver is in an AS/400 shared folder. For an overlay document called "myovl.ovl": 1. Create a temporary physical file on AS/400 to copy into: CRTPF FILE(library/WORKF) RCDLEN(8201) LVLCHK(*NO) 2. Copy the overlay or segment file from folder to physical file: CPYFRMPCD FROMFLR(folder) TOFILE(library/WORKF) FROMDOC(MYOVL.OVL) TRNTBL(*NONE) TRNFMT(*NOTEXT) 3. Create the overlay: CRTOVL OVL(lib/MYOVL) FILE(lib/WORKF) MBR(MYOVL) For a page segment document called "mypsg.psg": 1. Create a temporary physical file on AS/400 to copy into: CRTPF FILE(library/WORKF) RCDLEN(8201) LVLCHK(*NO) 2. Copy the overlay or segment file from folder to physical file: CPYFRMPCD FROMFLR(folder) TOFILE(library/WORKF) FROMDOC(MYPSG.PSG) TRNTBL(*NONE) TRNFMT(*NOTEXT) 3. Create the page segment: CRTPAGSEG PAGSEG(lib/MYPSG) FILE(lib/WORKF) MBR(MYPSG) Note: The above processes are automated with the OVERLAY and SEGMENT commands. These commands are available as part of the AS/400 Printing Programming Sampler library. This library can be downloaded from the IBM Printers home page at: http:www.can.ibm.com/ibmprinters Or, send a note to wshaffer@vnet.ibm.com requesting the Sampler library. Using Overlays in AS/400 Applications: ______________________________________ Overlays can be used in AS/400 printing applications with many different techniques, including: * specified with the front and back overlay parameter in the printer file * specified directly with the OVERLAY keyword in DDS * specified within the print definition of Advanced Print Utility (APU) * specified within a page and form definition * specified using the APIs of AFP Toolbox * placed in a print application with Print Format Utility * used with an Officevision/400 document Officevision/400 document * used as cover sheet in Facsimile Support Overlays with Printer Files: You can add electronic overlays to an existing application by specifying the overlay and any offsets in the printer file. Printer files can be created (CRTPRTF), revised/changed (CHGPRTF), and overridden (OVPPRTF) in order to effect this implementation. The key parameters in the printer file are: Unit of Measure _______ *INCH, *CM Front side overlay (FRONTOVL) Overlay *NONE Name, *NONE Library *LIBL Name, *LIBL, *C Offset down _______ 0-57.790 Offset across _______ 0-57.790 Back side overlay (BACKOVL) Overlay *FRONTOVL Name, *NONE Library *LIBL Name, *LIBL, *C Offset down _______ 0-57.790 Offset across _______ 0-57.790 Overlays with DDS: Building your application output with DDS gives you the most control and flexibility in the final form/document. Over- lays are specified with the OVERLAY keyword. The format is: OVERLAY (library/overlay position-down position-across) The overlay name and positioning can be dynamic; that is, the values can be variables and be passed from the applica- tion program. Overlays with Advanced Print Utility (APU) APU is an end-user print formatting system with robust sup- port for electronic forms. You specify overlays interac- tively. See the APU User's Guide for details. Overlays with Page and Form Definitions: Page definitions and form definitions are a print formatting language that map line-at-a-time output to full electronic pages while adding such elements as electronic forms, image, and copies. Page and form definitions are specified di- rectly in the AS/400 printer file (with V3R2 and V3R7). PPFA is the compiler that creates AS/400 page and form defi- nition objects from source statements. Page and form defi- nitions can also be graphically generated with printing solutions from ISIS and Elixir. Overlays with AFP Toolbox AFP Toolbox provides a complete set of high-function pro- gramming objects to build AFP documents. With this tools for complex document applications, customers and developers have complete control over the selection and placement of overlays. Overlays with Print Format Utility This module of AFP Utilities/400 allows you to build com- plex, electronic printing applications from a database file. It provides user displays to select and print overlays. Overlays with Facsimile Support: There are two methods which can be used: * Create your own printer file with the name QPFFCVP and replace the original printer file in the library QFAX * Implement an AFP electronic overlay by changing the printer file QPFFCVP with the CHGPRTF command. You can use one or the other or a combination of the two. If you create your own print file, retrieve the file infor- mation from QFAX/QPFFCVP and make sure that the fields in the new file match the fields in the existing file. You can change the print position of each field but be careful not to change the buffer position of each field. When creating the file, specify DEVTYPE(*IPDS) and LVLCHK(*NO). Also be sure that the new print file does not generate more than one printed page or the SNDFAX command will fail. If you use an overlay with the cover page, you must use the CHGPRTF command to include the overlay in the print file. The OVRPRTF command will not work for this purpose. Once the cover page has been created and/or changed, the new cover page will be used for all subsequent outbound faxes for which a cover page is requested. You have to be sure that your library list includes the li- braries that contain the AFP resources (page segments, fonts) that your overlay requires. Overlays with Officevision/400: Once you have created your AFP overlay, use the following steps to use it: * Identify the overlay in a printer file * Specify in the OV/400 Print Options the name of the printer file and FORM TYPE = $OVL * Ensure that your AS/400 printer is configured for AFP Printing Front/Back (Odd/Even) Page Overlays Today, you can print a page overlay on front sides of a two-sided (duplexed), multi-page OV/400 document and print a different page overlay on the back sides of the document. This format is beneficial for 'publishing' applications in which the finished document is bound on the left edge or placed in a notebook. EXAMPLE: A company's procedures manual is a multi- page, duplexed OV/400 document. The front/odd pages (e.g. 1, 3, 5, etc.). have the company logo in the up- per right corner, but the back/even pages (e.g. 2, 4, 6, etc.) have the company logo in the upper left cor- ner. 1. Preparation assumptions: * The front and back page overlays are already avail- able on the AS/400 * A printer file exists specifying the name of the front page overlay and the back page overlay 2. At print time specify in the OV/400 Print Options: * the name of the printer file containing the names of the front and back page overlays * the type of page printing is duplex (two-sided) RESULTS: The front overlay prints on the odd-numbered pages and the back overlay prints on the even-numbered pages when using a duplex-capable, AFP-configured printer. Printing Letterhead Overlay Only on Page 1 of a 4-Page Letter EXAMPLE: Barbara Brown has her own letterhead contain- ing her name, the company name, address, and logo. Her letterhead is used for page 1 only of her letters. Subsequent pages use plain paper. 1. Preparation assumptions: * Her letterhead page overlay is already available on the AS/400 * A printer file exists specifying the name of her letterhead page overlay as the front page overlay and *NONE as the back page overlay 2. At print time specify in the OV/400 Print Options: * the name of the printer file containing the name of her letterhead page overlay * the FORM TYPE is "$OVL". Specifying "FORM TYPE = $OVL" is the KEY to printing letterhead page over- lays. "$OVL" is the TRIGGER that causes the front page overlay specified in the printer file to be used for page 1 only. RESULTS: Page 1 of Barbara's letter prints with a let- terhead. The remaining 3 pages of the letter use plain paper. Using Image in AS/400 Applications: ___________________________________ The image in AS/400 page segment objects can be built into your application output in a number of ways, including: * placed within an electronic form using Overlay Utility * specified directly with PAGSEG keyword in DDS * specified within the print definition of Advanced Print Utility * specified within a page and form definition * specified using the APIs of AFP Toolbox * placed in a print application with Print Format Utility * used within an Officevision/400 document Page Segments with DDS: You can specify the printing of a page segment with the PAGSEG keyword in DDS. The format of the keyword is: PAGSEG (library/page-segment position-down position-across) All parameters - page segment name and positioning - can be dynamic; that is, the values can be variables and can be passed from the application program. This allows you to dy- namically specify which page segment to print, and where to print it. Page Segments with Overlay Utility: Page segments can be placed within an overlay using Overlay Utility. Refer to the AFP Utilities/400 Reference manual or online help for specific instructions. Page Segments with Advanced Print Utility APU is an end-user print formatting system with robust sup- port for electronic forms. You specify page segments inter- actively. See the APU User's Guide for details. Page Segments with Page and Form Definitions: Page definitions and form definitions are a print formatting language that map line-at-a-time output to full electronic pages while adding such elements as electronic forms, image, and copies. Page and form definitions are specified di- rectly in the AS/400 printer file (with V3R2 and V3R7). PPFA is the compiler that creates AS/400 page and form defi- nition objects from source statements. Page and form defi- nitions can also be graphically generated with printing solutions from ISIS and Elixir. Page Segments with AFP Toolbox: AFP Toolbox provides a complete set of high-function pro- gramming objects to build AFP documents. With this tool for complex document applications, customers and developers have complete control over the selection and placement of over- lays. Page Segments with Print Format Utility: Page segments can be placed within a electronic document that is built by Print Format Utility, a module of AFP Utilities/400. Refer to the AFP Utilities/400 Reference manual or online help for specific instructions. Page Segments with Officevision/400: OV/400 supports the use of images within OV/400 documents. The OV/400 office editor will support two image file types - IOCA and RFT. Normally, the IOCA file type will most likely have a file extension of ".IMG" or "ICA". Use the following steps to implement page segments in your OV/400 documents: 1. Start the OV/400 editor by entering WRKDOC on the com- mand line or by using menu options. 2. Either create a new document or revise an existing one. 3. We will first store the image in the document. This is done by pressing "F5=Goto" and then entering "gg" for Get Graphic. On this Get Graphic screen you will be entering the file and folder name information. Make sure the folder that contains the image is the one listed on the folder name prompt. Press "F4" for a list of images in that folder. From this list, select which image you want to include in your document. You may have both IOCA and RFT images in this folder and will notice that RFT image types may contain more than one image. Select your choice and press enter. You will now return to the Get Graphic screen, press enter again. You should receive a message at the bottom of the edit screen that reads "Graphic ?????? copied suc- cessfully". 4. At this point we have now saved the image in the docu- ment but have not told it where to physically place it for printing. To place it for printing, position your cursor at the location you want to print the image. After you have positioned the cursor, press "F5=Goto" and then enter ".gr", which will bring up the Graphic Instruction screen. On this Graphic Instruction screen you will be specifying the image name, graphic type, size, margin, and instruction length information. Be- cause it is possible to have more than one image in a document, you will need to supply the image name. Press "F4" at this time to list the image names that are in this document. Select the image you want to print in the document. You will return to the "Graphic Instruc- tion" screen by pressing enter. Graphic Type would be "2=Image", "Width & Length" will be the size of your im- age, "Print with text Y or N" is if you intend to have text and image on the same printed page, "Indent from paper edge" is the amount from the left edge of the pa- per, and "Instruction length" is the length of the graphic instruction you want to display on the edit screen. 5. You can view the image by pressing "F5=View graphic". After you have entered the information requested by the Graphic Instruction screen, press enter to place the in- struction in the document. Your image must be saved as compressed in order to view it on the screen. 6. You may now exit, save and print the document. Again if you print this document with image, it must be printed on an IPDS type printer. Note: You can have text and image on the same printed page but this text must be above and/or below the image. Text on the sides of the image in not supported. Additional Information: _______________________ The starting point for learning about AS/400 printing applica- tions is the AS/400 Guide to Advanced Function Presentation and Print Services Facility (S544-5319). AS/400 Printing publica- tions include: Publication Order# AS/400 Guide to AFP and PSF S544-5319 AS/400 Advanced Print Utility User's Guide S544-5351 Page Printer Formatting Aid User's Guide S544-5284 AFP Toolbox for AS/400 User's Guide S544-5368 SAP R/3 AFP Print User's Guide S544-5412 AS/400 Printer Device Programming (V3) SC41-3713 AS/400 Guide to Programming for Printing (V2) SC41-8194 AS/400 DDS Reference SC41-4712 AS/400 CL Reference SC41-3722 AFP Utilities for AS/400 S544-5349 AS/400 Printing Redbook II GG24-3704 AS/400 Printing Redbook III GG24-4028 AS/400 Printing Redbook IV GG24-4389 Setting Up and Printing in an OV/400 Environment SH21-0511 Facsimile Support/400 User's Guide SC41-0300 Current product information and additional AS/400 printing tools can be accessed from the IBM Printing Home Page at: http://www.printers.ibm.com