*********************************************** This readme is from the previous version of the SAMPLER library. The SAVE file contains the QSAMPLER library. Enjoy *********************************************** Version: April 1996 AS/400 Advanced Printing Programming Sampler =========================================== This diskette provides a "sampler" of DDS programming techniques that can be used to create advanced electronic output on AS/400. Much of the power of Advanced Function Printing (AFP) is easily accessible with simple DDS keywords and parameters. Sample programs include: BARSMP Sample Bar Codes using DDS BIGLTR Sampler with BIG scalable fonts DDSFUN DDS Functionality INVNEW1 Super Sun Seeds Invoices - Example 1 Electronic Invoice INVNEW2 Super Sun Seeds Invoices - Example 2 Adds Duplex and Copies INVNEW3 Super Sun Seeds Invoices - Example 3 Floating Invoice INVPRE Super Sun Seeds Invoices - Original SCS Version OVERLAY Overlay Copy/Create/Print (from folder) PNETLBL Postnet Labels SEARS Sears Mailing Label SEGMENT Page Segment Copy/Create/Print (from folder) WELCDDS Welcome page using DDS The library that you will create on your AS/400 (QSAMPLER) also contains the image and overlay resources used by the sample applications. The source for the overlays and the Print File Utility samples is included. Working with these overlays or Print File Utility definitinos would require Advanced Function Printing Utilities (AFPU/400). Also included are the OVERLAY and SEGMENT commands. These commands automate the upload and creation of overlays and page segments. You can use a variety of programs to create overlays and page segments on the client (including the IBM AFP Print Driver for Windows - see end of README for more information) and place the file in a shared folder. The OVERLAY and SEGMENT commands take over from there, creating AS/400 resources, printed proofs, and optionally, a dynamic interface to the Client Access/400 Viewer. Most of the programming techniques used in this AS/400 Advanced Printing Sampler utilize DDS. Although the DDS printer file is external to the application program, it is functionally integrated with the program. This provides for high-function, customized documents that are based on the application data. Invoicing examples INVNEW1, INVNEW2, and INVNEW3 demonstrate this application integration. Enhancements to DDS to provide dynamic placement of document elements (ie. overlays, images, bar code, boxes, lines, text) allow for document design that is based on the application data. INVNEW1 produces the Super Sun Seeds electronic invoice utilizing a number of different page formats. INVNEW2 adds copies, data suppression, and duplex function. INVNEW3 adds a floating document where the electronic form is no longer static, but is custom-built based on the type and number of each customer's transactions. There are a number of other solutions for building electronic printing applications. IBM has announced AS/400 support for page and form definition formatting. Page and form definitions can be built to describe how an existing application's print records should be remapped and an electronic document built. The page and/or form definition is then plugged into the job's printer file and the application is instantly transformed from printing simple SCS records to full-page electronic output. Page and form definitions has less integrated functionality than DDS, but have the advantage of being an application-independent solution. Page and form definition support will be delivered in mid-1996. There are also a variety of packaged solutions that reformat existing application output into advanced electronic output, transforming SCS output into AFP documents. The programs in this Programming Sampler are samples. No warranties, expressed or implied, are made for use of these programming techniques. Installation: ============ This diskette contains the QSAMPLER library in save file database format. To install, the save file database (SAMPPF) and two REXX procedures (SAVFIN and SAVFIN2) are first copied to a shared folder. Then, the REXX procedures are copied to a physical file, and executed. Please note that this sample code is copied to library QSAMPLER. Ensure that you do not have a library with the same name on your system (this library is not deleted . . . programs and files are simply added). *********************** **** INSTALL STEPS **** *********************** All commands, unless otherwise noted, are on the AS/400: 1. Create temporary shared folder: --> CRTFLR FLR(QSAMPLER) 2. On the PC, copy SAMPPF save file database to shared folder: --> COPY A:SAMPPF I:\QDLS\QSAMPLER 3. On the PC, copy SAVFIN file to shared folder: --> COPY A:SAVFIN I:\QDLS\QSAMPLER 4. On the PC, copy SAVFIN2 file to shared folder: --> COPY A:SAVFIN2 I:\QDLS\QSAMPLER 5. Create a temporary source file for the REXX procedures. The file name and library is not important. We are using QREXSRC in QUSRSYS: --> CRTSRCPF FILE(QUSRSYS/QREXSRC) 6. Copy SAVFIN file from folder to source physical file: --> CPYFRMPCD FROMFLR(QSAMPLER) TOFILE(QUSRSYS/QREXSRC) FROMDOC(SAVFIN) TOMBR(SAVFIN) TRNTBL(*NONE) TRNFMT(*NOTEXT) 7. Copy SAVFIN2 file from folder to source physical file: --> CPYFRMPCD FROMFLR(QSAMPLER) TOFILE(QUSRSYS/QREXSRC) FROMDOC(SAVFIN2) TOMBR(SAVFIN2) TRNTBL(*NONE) TRNFMT(*NOTEXT) 8. Run the REXX procedure SAVFIN. This will create the library QSAMPLER, create the work files SAMPPF and SAMPSAVF, copy the SAMPPF data from the folder, write the save object records from SAMPPF to SAMPSAVF, and then do a RSTOBJ from the new constituted SAMPSAVF save file: --> STRREXPRC SRCMBR(SAVFIN) SRCFILE(QUSRSYS/QREXSRC) QSAMPLER Operation: ================== The QSAMPLER programs will run on OS/400 releases V2R3 and later. New function, such as dynamic positioning of overlays and page segments, will only work on releases V3R1 and later. Programs like DDSFUN would need to be changed and recompiled in order to use this function. Your library list needs to include QSAMPLER as well as the referenced font libraries: - QGDDM for scalable fonts - QFNTxxxx (Font Collection) libraries. For 300 dpi printers, you would have: QFNT300CPL QFNT300LA1 QFNTCF_LA1 QFNTCDEPAG Print Services Facility/400 (PSF/400) is required for AFP printing on releases V3R1 and later. The sample programs can be run by simple calls. For example, you can run the DDS Functionality demo (DDSFUN) by: CALL DDSFUN The output will be routed to the output queue assigned to your job. QSAMPLER Library Contents: ========================= BARSMP *PGM RPG Sample Bar Codes with DDS BIGLTR *PGM RPG Test big letters 3935 DDSFUN *PGM RPG DDS Functionality INVNEW1 *PGM RPG SSS Invoices - Example 1 INVNEW2 *PGM RPG SSS Invoices - Example 2 INVNEW3 *PGM RPG SSS Invoices - Example 3 INVPRE *PGM RPG SSS Invoices - Preprinted Version OVERLAY *PGM CLP Overlay Copy/Create/Print OVER01 *PGM RPG Print Overlay PNETLBL *PGM RPG Mailing Address Labels with postne SEARS *PGM RPG Bar Code on Mailing Label - DDS SEGMENT *PGM CLP Segment COpy/Create/Print SEG01 *PGM RPG Print Page Segment (SEGCL) WELCDDS *PGM RPG Welcome page using DDS BARSMP *FILE PRTF Bar Code Sample BEANLTR *FILE PRTF Printer file for bean letter (OV/400) DDSFUN *FILE PRTF DDS Functionality INVNEW1 *FILE PRTF New SSS Invoice - Example 1 INVNEW2 *FILE PRTF New SSS Invoice - Example 2 INVNEW3 *FILE PRTF New SSS Invoice - Example 3 INVPRE *FILE PRTF Original SSS Invoice (ie preprinted) OVER01 *FILE PRTF Printer File for OVERLAY command PNETLBL *FILE PRTF Mailing labels with postnet QCLSRC *FILE PF CL Source File QCMDSRC *FILE PF CMD Source File QDDSSRC *FILE PF DDS Source File QOVLSRC *FILE PF Overlay Source File QPFDDEF *FILE PF Print File Utility Source File QREXSRC *FILE PF REXX Source File QRPGSRC *FILE PF RPG Source File SEARS *FILE PRTF Sears Shipping Label SEEDCUST *FILE PF Super Sun Seeds Customer Master SEEDDETL *FILE LF Super Sun Seeds Invoicing LF SEEDDETP *FILE PF Super Sun Seeds Invoicing PF SEEDITEM *FILE PF Super Sun Seeds Item Master SEEDSOLE *FILE PF Contact Master SEG01 *FILE PRTF Printer File for SEGMENT print WELCDDS *FILE PRTF Welcome document using DDS OVERLAY *CMD Create/print overlay from folder SEGMENT *CMD Create/print page segment from folder BEANS *PAGSEG Page segment for Bean Letterhead BETLNB *PAGSEG Beetle, no box, 300-pel FLWRNB *PAGSEG Flower, no box, 300-pel IBMLOGO *PAGSEG IBM Logo IBMLOGOT *PAGSEG IBM Logo IBMSMALL *PAGSEG IBM Logo SONNY *PAGSEG Sonny Sunn Signature STRWNB *PAGSEG Strawberry, no box, 300-pel SUNLOGO *PAGSEG Sun Seeds Logo, 300-pel TREENB *PAGSEG Tree, no box, 300-pel BEANLTR *OVL Bean Letter letterhead CUST3006 *OVL Grey bar, 300 pel, *COR DDSOVL1 *OVL DDS Functionality Overlay 1 DDSOVL2 *OVL DDS Functionality Overlay 2 DDSOVL3 *OVL DDS Functionality Overlay 3 GRID *OVL Grid Overlay - 10CPI/6LPI INVALL *OVL Invoice: All on one page INVBAC *OVL Invoice Ts and Cs INVFAX *OVL Fax Cover Sheet INVFST *OVL Invoice: First page INVHEAD *OVL Invoice: Full Header Only INVHEAD2 *OVL Invoice: Shortened Header Only INVLST *OVL Invoice: Last page INVMID *OVL Invoice: Middle page INVPAY *OVL Invoice: Payment coupon SAM3006 *OVL Grey bar, 300 pel, *COR overlay Reference Information: ===================== Programming reference materials for AS/400 include: Printer Device Programming (V3) SC41-3713 Guide to Programming for Printing (V2) SC41-8194 DDS Reference (V3) SC41-3712 DDS Reference (V2) SC41-9620 AFP Utilities/400 User Guide (V3) SC41-3640 AFP Utilities/400 User Guide (V2) SH18-2416 AS/400 Printing Redbook IV GG24-4389 AS/400 Printing Redbook III GG24-4028 AS/400 Printing Redbook II GG24-3707 Officevision Printing Redbook SH41-0511 AFP Font Summary G544-3810 AFP Printer Information G544-3290 Additional product information can be obtained from the IBM Printers Home Page: http://www.can.ibm.com/ibmprinters You can also download the IBM AFP Printer Driver for Windows. This driver allows you to create overlays and images (page segments) with any Windows application for use on your AS/400. You can use the OVERLAY and SEGMENT commands in this Sampler to automate the processing of those overlays and images. Feedback: ======== Comments or input can be sent to: wshaffer@vnet.ibm.com