* First add binding directory entry for service program QIMBCIMG service program found in QSYS. H BNDDIR('YOURDIRECTORYOFCHOICE') H DftActGrp(*NO) D RunCommand PR 10I 0 Extproc('system') D CmdString * Value D Options(*String) *********** * * DESCRIPTION OF FIELDS CAN BE FOUND HERE. * http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/apis/QIMGCVTI.htm?lang=en * *********** D QImgCvtImg PR ExtProc('QimgCvtImg') D Control * value options(*string) D Input * value options(*string) D MainInputStor * value options(*string) D Output * value options(*string) D MainOutptStor * value options(*string) D FeedBack * value options(*string) D ErrorCode * value options(*string) * Format IMGC0100 D Control DS Qualified D Length 1 4B 0 Inz(100) D Format 5 12 Inz('IMGC0100') D Operation 13 16B 0 Inz(0) D MultiPageOutput... D 17 48 Inz(*LOVAL) D SpaceForFeedBack... D 49 52B 0 Inz(0) D FeedBackStructure... D 53 60 Inz('IMGF0100') D Reverse 61 64B 0 Inz(0) D ColorReduction... D 65 68B 0 Inz(0) D Resize 69 72B 0 Inz(0) D Stretch 73 76B 0 Inz(0) D HorizontalJustify... D 77 80B 0 Inz(0) D VerticalJustify... D 81 84B 0 Inz(0) D KeepColor 85 88B 0 Inz(0) D KeepQuality 89 92B 0 Inz(1) D CancelOnError 93 96B 0 Inz(1) D SeverityLevel 97 100B 0 Inz(30) * Format IMGI0100 D Stream DS Qualified D Length 1 4B 0 Inz(94) D Format 5 12 Inz('IMGI0100') D Reserved1 13 32 Inz(*LOVAL) D DataStreamFormat... D 33 36B 0 Inz(0) D PhotometricInterpretation... D 37 40B 0 Inz(0) D ResolutionUnits... D 41 44B 0 Inz(0) D HorizontalResolution... D 45 48B 0 Inz(0) D VerticalResolution... D 49 52B 0 Inz(0) D InputObjectType... D 53 56B 0 Inz(0) D OffsetToInputObjectName... D 57 60B 0 Inz(68) D LengthOfInputObjectName... D 61 64B 0 Inz(26) D Reserved2... D 65 68B 0 Inz(0) D InputObjectName... D 69 94 Inz('/home/xxxxxxx/image.gif') * Format IMGO0200 D Output DS Qualified D Length 1 4B 0 Inz(200) D Format 5 12 Inz('IMGO0200') D DestinationImageConfig... D 13 22 Inz('*DEV') D Reserved1... D 23 32 Inz(*LOVAL) D DataStreamFormat... D 33 36B 0 Inz(0) D PhotometricInterpretation... D 37 40B 0 Inz(0) D ResolutionUnits... D 41 44B 0 Inz(0) D HorizontalResolution... D 45 48B 0 Inz(0) D VerticalResolution... D 49 52B 0 Inz(0) D SizeUnits... D 53 56B 0 Inz(0) D HorizontalSize... D 57 64P 5 Inz(0) D VerticalSize... D 65 72P 5 Inz(0) D CompressionType... D 73 76B 0 Inz(0) D CompressionQuality... D 77 80B 0 Inz(0) D BitsPerSample... D 81 84B 0 Inz(0) D PaperSize... D 85 88B 0 Inz(0) D UserPaperSizeUnits... D 89 92B 0 Inz(0) D HorizontalUserPaperSize... D 93 100P 5 Inz(0) D VerticalUserPaperSize... D 101 108P 5 Inz(0) D PaperOrientation... D 109 112B 0 Inz(-1) D LeftUnprintableBorder... D 113 116B 0 Inz(-1) D RightUnprintableBorder... D 117 120B 0 Inz(-1) D TopUnprintableBorder... D 121 124B 0 Inz(-1) D BottomUnprintableBorder... D 125 128B 0 Inz(-1) D OutputDevice... D 129 138 Inz('YOUR PRINTER') D OutputQueue... D 139 148 Inz('*DEV') D OutputQueueLib... D 149 158 Inz('*LIBL') D PrinterFile... D 159 168 Inz('QSYSPRT') D PrinterFileLib... D 169 178 Inz('*LIBL') D UserData... D 179 188 Inz('*INOBJ') D Copies... D 189 192B 0 Inz(0) D Save... D 193 196B 0 Inz(0) D RequestSpooledFeedback... D 197 200B 0 Inz(1) D Feedback DS Qualified D Multipage 1 32 D SpoolFile 33 42 D JobName 43 52 D JobUser 53 62 D JobNumber 63 68 D SpoolNumber 69 72B 0 D IntJobID 73 88 D IntSpoolID 89 104 D OutputDataLen 105 108B 0 D SysName 109 116 D SpoolDate 117 123 D Reserved 124 124 D SpoolTime 125 130 D Reserve2 131 132 DQUSEC DS D QUSBPRV 1 4B 0 INZ D QUSBAVL 5 8B 0 INZ D QUSEI 9 15 INZ D QUSERVED 16 16 INZ D QUSED01 17 144 INZ D inputbuf s 65535a D outputbuf s 65535a /Free runcommand('OVRPRTF QSYSPRT DEVTYPE(*USERASCII)'); // Since I'm using a stream file, these two values must be *LOVAL X'00' for all inputBuf = *LOVAL; outputbuf = *LOVAL; QImgCvtImg( Control :Stream :InputBuf :Output :OutputBuf :Feedback :QUSEC ); RunCommand('DLTOVR FILE(QSYSPRT)'); *InLR = *On; Return; /End-Free