Eddie,
It can be done, see below for a very messy version.
WINAPP
OPTIONS (INTL)
PROGRAM PRINTER_DOC
implicit real*8 (a-h,o-z)
INCLUDE <WINDOWS.INS>
EXTERNAL Prin_FUNCTION,print_driver
common/driver_data/nrow,ncol,xchar,ychar,scale,icol,angle,imode
character*2000 outputstring
common/last_string/outputstring
ncol = 80
nrow = 60
xchar = 6d0
ychar = 2d0
icol = rgb@(128,128,128)
angle = 0d0
imode = 0
open(unit=50,driver=print_driver)
I = WINIO@('%ca[PD tester]%mn[Print]',Prin_FUNCTION)
close(unit=50)
END
INTEGER FUNCTION PRIN_FUNCTION()
implicit real*8 (a-h,o-z)
INCLUDE <WINDOWS.INS>
CHARACTER*(30) CWS
common/driver_data/nrow,ncol,xchar,ychar,scale,icol,angle,imode
CALL SET_CLEARWIN_STRING@ ('PRINTER_DOCUMENT','Anything but')
itest = open_printer@(0)
if(itest .ne. 0)then
call SELECT_GRAPHICS_OBJECT@( 0 )
i=USE_RGB_COLOURS@( 0, .true. )
call get_graphical_resolution@( ixxx, iyyy )
c
c set pixel paper size
call set_paper_size(ixxx,iyyy)
c
c get the text size for the main body of the text
call get_text_scale(ncol,nrow,scale,imode)
c call set_mode(imode)
angle = 0d0
call scale_font@(scale)
call set_text_offset(0,0)
call set_scale(scale)
CWS = CLEARWIN_STRING@ ('PRINTER_DOCUMENT')
WRITE(50,*) 'Printer document name = '//CWS
WRITE(50,*) 'Printer document name = '//CWS
WRITE(50,*) 'Printer document name = '//CWS
CALL CLOSE_PRINTER@ (0)
endif
PRIN_FUNCTION = 1
END
subroutine print_driver(buffer,bsize,blen,action,ifail)
implicit real*8 (a-h,o-z)
include <windows.ins>
integer*2 bsize,buffer(bsize),blen,action,ifail
integer*2 substring_int
character*2000 outputstring
common/last_string/outputstring
character*2 substring
equivalence(substring,substring_int)
common/driver_data/nrow,ncol,xchar,ychar,scale,icol,angle,imode
if(action .eq. 2)then
c
c formatted write only
call SELECT_GRAPHICS_OBJECT@( 0 )
iout = 1
outputstring = ' '
do i=1,blen
substring_int = buffer(i)
outputstring(iout:iout+1) = substring
iout = iout + 2
enddo
c
c move to next row on page
ychar = ychar + 1d0
c
c close and print this page when full or when first character is
c a 1 - i.e. old form feed rule
if(ychar .gt. nrow .or. outputstring(1:1) .eq. '1')then
ychar = 1d0
CALL CLOSE_PRINTER@ (0)
i = open_printer1@(0)
call SELECT_GRAPHICS_OBJECT@( 0 )
i = USE_RGB_COLOURS@( 0, .true. )
endif
call select_font@('SYSTEM FIXED FONT')
call draw_text_at(outputstring(2:blen),xchar,ychar,
& scale,icol,angle,imode)
endif
end
Continued