Just prints graphics files grouped by 4 on HP PCL type printers
/* Just prints graphics files grouped by 4 on HP PCL type printers */
/* Parameters: axf - file mask (*.JPG) */
/* Notes: use C: disk to create temporal files */
/* Use ALCHOS2.EXE for file convertion */
/* See line 48 for "empty" spaces filling */
ARG axf
axf=STRIP(axf,"B")
a1 = 'tt300a4.pcl'
out_file = 't3001.pcl'
/* number of images on X-axis */
D_DX=2
/* number of images on Y-axis */
D_DY=2
D_DG=D_DY*D_DX
DPI_X=(2370)/D_DX
DPI_Y=(3360)/D_DY
rc1 = SysFileTree(axf,src_files,"FT")
DO i=1 TO src_files.0
/*------------------extract directory info -----*/
PARSE VALUE src_files.i WITH src_files.i.date src_files.i.size src_files.i.attrib src_files.i.fullname
src_files.i.fullname=STRIP(src_files.i.fullname)
IF LASTPOS('\',src_files.i.fullname)>0 THEN src_files.i.name=STRIP(SUBSTR(src_files.i.fullname,LASTPOS('\',src_files.i.fullname)+1))
ELSE src_files.i.name=src_files.i.fullname
PARSE VALUE src_files.i.name WITH src_files.i.sname '.' src_files.i.extension
/* SAY src_files.i.date src_files.i.fullname */
PARSE UPPER VALUE src_files.i.name WITH t_name
filename=src_files.i.fullname
END
DO J=0 TO ((src_files.0-1)/D_DG)
DO K=0 TO D_DG-1
dd1 = K
t11='t300_'||dd1||'.pcl'
rc1=SysFileDelete(t11)
dd2 = J*D_DG+K+1
IF dd2>src_files.0 THEN src_files.dd2.fullname='O:\avi\PRINT\whites.tif'
'@alchos2 -+ -Xb'||FORMAT(DPI_X)||' -Yb'||FORMAT(DPI_Y)||' -t -o -D 600 600 "'||src_files.dd2.fullname||'" c:\temp.tif >nul 2>nul'
'@alchos2 -+ -Xb2x -Gi1.0 -Go2.0 -P 100 -o -b -d1 -c2 -Zd 600 600 c:\temp.tif c:\temp.pcl >nul 2>nul'
'@copy c:\temp.pcl '||t11||' >nul 2>nul'
SAY J||'/'||K src_files.dd2.fullname
END
out_file='t3001.pcl'
ss2="*p0X*p0Y*r1A"
ss4 = "E%-12345X"
ss5 = "*t600R"
call SysFileDelete out_file
CALL STREAM out_file,'C','OPEN WRITE'
/* ------------- trailer -------- */
ss1f = 't300_0.pcl'
CALL STREAM ss1f,'C','OPEN READ'
ss1=charin(ss1f,,CHARS(ss1f))
CALL STREAM ss1f,'C','CLOSE'
rc=charout(out_file,SUBSTR(ss1,1,POS(ss5,ss1)-1))
/* ------------ okay, files ----------*/
DO K=0 TO D_DY-1
DO L=0 TO D_DX-1
dd1 = K*D_DY+L
t11='t300_'||dd1||'.pcl'
ss3="*p"||FORMAT(DPI_X*L)||"X*p"||FORMAT(DPI_Y*K)||"Y*r1A"
CALL STREAM t11,'C','OPEN READ'
ss1=charin(t11,,CHARS(t11))
ss1 = SUBSTR(ss1,1,POS(ss4,ss1)-1)
CALL STREAM t11,'C','CLOSE'
dd3 = POS(ss2,ss1)
SAY J||'/'||K||'/'||L t11
IF DD3>0 THEN DO
ss1 = DELSTR(SS1,dd3,LENGTH(ss2))
ss1 = INSERT(ss3,ss1,dd3-1)
END
rc=charout(out_file,SUBSTR(ss1,POS(ss5,ss1)) )
rc1=SysFileDelete(t11)
END
END
/* ----------- tail ------------ */
rc=charout(out_file,ss4)
CALL STREAM out_file,'C','CLOSE'
'copy /b '||out_file||' prn '
rc1=SysFileDelete(out_file)
END
EXIT