Every printer driver has a different vertical and horizontal resolution. In order to be consistent on your text resolution, you have to calculate your line and page placement. You are on the right track .. Please consider this code :
Code: Select all | Expand
oFont8b := TFont():New( "Times New Roman", 0,-8, .F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont10 := TFont():New( "Times New Roman", 0,-10,.F.,.F. , , , ,.F.,,,,,,, oPRINT, )
oFont10b := TFont():New( "Times New Roman", 0,-10,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont12ib := TFont():New( "Times New Roman", 0,-12,.F.,.T. , , , ,.T.,,,,,,, oPRINT, )
oFont12b := TFont():New( "Times New Roman", 0,-12,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont14b := TFont():New( "Times New Roman", 0,-14,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont24b := TFont():New( "Times New Roman", 0,-24,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
nLines := 0
nPages := 1
nRowStep := oPrint:nVertRes() / 55 // pixel per line = 57.65 @ 55
nColStep := oPrint:nHorzRes() /130 // columns
oPRINT:StartPage()
nMargin := Int(oPrint:nLogPixelX()*0.5) // *0.2
LINE := nMargin
...
...
// company
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cOwner, oFONT12b )
oPRINT:SayBitMap( LINE,(oPrint:nHorzRes()*.81), "CUMMING.BMP", 600,300 ) //600,300
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAdd1 , oFONT12b )
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAdd2 , oFONT12b )
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), alltrim(cCity1)+", "+cState1+" "+cZip1, oFONT12b )
Line += oFont24b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"PO Number", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),cPo, oFONT10b )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Vendor Id", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),cVendorId, oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"PO Date", oFONT10b ) // 775
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),dtoc( dOrdered ), oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Date Expected", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),dtoc( dExpected ), oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Invoice Numb", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),cInvoice, oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Terms", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),cTerms, oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Contact", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),cContact, oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Contact Phone", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.805),":", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82),cPhone, oFONT10 )
Line += oFont12b:nHeight
Line -= oFont12b:nHeight
Line -= oFont12b:nHeight
Line -= oFont12b:nHeight
Line -= oFont12b:nHeight
// 1216.67 reset line
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cVendor, oFONT12b )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAddress1, oFONT12b )
Line += oFont12b:nHeight
If cAddress2 = " "
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), substr(cCcity+", "+cSstate+" "+cZip+space(50),1,50), oFONT12b )
Line += oFont12b:nHeight
Else
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAddress2, oFONT12b )
Line += oFont12b:nHeight
Endif
If cVaddress2 = " "
Else
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), substr(cCity+", "+cState+" "+cZip+space(50),1,50), oFONT12b )
Endif
Line += oFont24b:nHeight
Line += oFont24b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.02), line, (oPrint:nHorzRes()*.9792), oPen1 )
Line += oFont12b:nHeight
Line -= oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.04), "Qty", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.1), "Description", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.531), "Location", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.78), "Cost", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9), "Extended", oFONT10b )
Line += oFont14b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.02), line, (oPrint:nHorzRes()*.9792), oPen1 )
Line += oFont12b:nHeight
Line -= oFont10b:nHeight
Notice placement is a calculation of the printer nHorzRez() and nVertRez() ( which it appears you are doing ) .. also Line spacing is
by the font:nHeight .. not very pretty, but it works with just about any printer and places your text and pictures in the same position each time regardless of the printer.
Hope that helps ..