Hello,
I am stil having a problem printing to a 12 inch form. The form is pre-printed so data must be printed in specific parts of the form and must be printed on two consecutive forms. The first page prints OK but the second page starts printing immediately following the last data from the first page which leads me to believe the PrnSetSize( <Width>, <Length> ) does not work. I am using FWH 8.10. Here is the source code, I would be truely grateful if someone had a solution to this problem.
// Init...
nWid := ROUND( 8.5 * 254, 0) // convert to inches to millimeters
nLen := ROUND( 11 * 254, 0)
PrnSetSize(nWid, nLen )
PRINT oPrinter NAME "Form 12" FROM USER PREVIEW
if empty( oPrinter:hDC )
return nil
endif
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-10 OF oPrinter
DEFINE FONT oFont2 NAME "Arial" SIZE 0,-14 OF oPrinter
DEFINE FONT oFont3 NAME "Arial" SIZE 0,-10 OF oPrinter
DEFINE FONT oFont4 NAME "Arial" SIZE 0,-10 OF oPrinter
// Init...
Mwidth = oPrinter:nHorzRes()
Mheight = oPrinter:nVertRes()
Mrow = 0
M_col = 0
nCol = 0
nHgt = oPrinter:GetTextHeight("X", oFont1 )
nCopy = 2
FOR nPrt=1 TO nCopy
/* Start Printing Page */
PAGE
// Init...
Mrow = 0
M_col = 0
// Print data
_IntlAwb( oPrinter, "pfx", @Mrow, @M_col )
M_dat = 'XXX'
oPrinter:Say( Mrow, M_col, M_dat, oFont1 )
// Print more data for length of 12 inch form...
// Bottom of form
_IntlAwb( oPrinter, "awb3" , @Mrow, @M_col )
M_dat = 'XXXX'
oPrinter:Say( Mrow, M_col, M_dat, oFont2 )
// End of Page ------------------------- >>> Should this form feed to next page???
ENDPAGE
NEXT nPrt
ENDPRINT
// Return to letter size paper
nWid := ROUND( 8.5 * 254, 0)
nLen := ROUND( 11 * 254, 0)
PrnSetSize(nWid, nLen )
RELEASE FONT oFont1
RELEASE FONT oFont2
RELEASE FONT oFont3
RELEASE FONT oFont4
RETURN nil
//-----------------------------------------------------------------------------
FUNC _IntlAwb( oPrinter, cField, nRow, nCol )
local nR1 := 0 , ;
nC1 := 0 , ;
nWi := oPrinter:nHorzRes() , ;
nHe := oPrinter:nVertRes()
SysRefresh()
SELECT intlawb
GO TOP
cR1 := cField + "R"
cC1 := cField + "C"
IF TYPE( cR1 ) <> "U"
nR1 := ROUND( nHe * (( intlawb->&cR1 )/100), 1 )
ENDIF
IF TYPE( cC1 ) <> "U"
nC1 := ROUND( nWi * (( intlawb->&cC1 )/100), 1 )
ENDIF
IF (nR1>0.0)
nRow := nR1
ENDIF
IF (nC1>0.0)
nCol := nC1
ENDIF
SysRefresh()
RETURN (.T.)