Hi
I'm printing labels in a laser printer with win32prn.
The routine has 2 arrays of coordinates for fields which are not modified while printing.
As printing moves down the page, the fields are slightly moved to the right although same X coordinate is passed to textoutat method for each label (actually more than 2 size 8 chars to the right along an A4 sheet).
Any idea? Below is a self contained example.
Thanks
Claudio H
///// CODE /////
#include "
WINGDI.CH"
FUNCTION Main ()
LOCAL cPrinter := GetDefaultPrinter()
LOCAL oPrinter
LOCAL nX, aX:={1,951,1901,2851,3801}
LOCAL nY, aY:={171,971,1771,2571,3371,4171,4971,5771}
oPrinter := Win32Prn():new( cPrinter )
oPrinter:formType := DMPAPER_A4
oPrinter:create()
oPrinter:startDoc( "test" )
FOR nY:=1 TO LEN(aY)
FOR nX:=1 TO LEN(aX)
WITH OBJECT oPrinter
:setFont("Courier New",8,{0,0},FW_NORMAL)
:textOutAt(aX[nX],:topmargin+aY[nY]+ 0,"|12345678901234567890")
:textOutAt(aX[nX],:topmargin+aY[nY]+ 85,"|12345678901234567890")
:textOutAt(aX[nX],:topmargin+aY[nY]+ 370,"|12345678901234567890")
END
NEXT nX
NEXT nY
oPrinter:endDoc()
oPrinter:destroy()
RETURN NIL
///// ENDCODE /////