Is this code still working for you, on any printer?
I not be able to obtain the same look on other printers.
Thanks.
Spanish:
Hola rick
¿Este código sigue funcionando para usted en cualquier impresora?
No puedo obtener el mismo aspecto en otras impresoras.
Gracias.
The example takes advantage of the horizontal and vertical properties of the print driver to allow the output to resolve and look ( almost ) identical on any printer.
- Code: Select all Expand view RUN
- 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, )
DEFINE FONT oFont10d NAME "Courier New" SIZE 0,-10 of oPRINT
DEFINE PEN oPen1 WIDTH 5 //10
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
nPage := 1
...
...
// company
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cOwner, oFONT14b )
Line += oFont8b:nHeight
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cDivision , oFONT12b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),cInvoiceType, oFONT12b )
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAdd1 , oFONT12b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"INVOICE", oFONT24b )
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAdd2 , oFONT12b )
Line += oFont10b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), alltrim(cCity)+", "+cState+" "+cZip, oFONT12b )
Line += oFont12b:nHeight
Line -= oFont8b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),cRepairNumber, oFONT14b )
Line += oFont24b:nHeight
Line += oFont24b:nHeight
Line += oFont8b:nHeight
Line += oFont12b:nHeight
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cCustName, oFONT12b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Cust Id :", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.79),cCustomerId, oFONT10 )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cCustAdd1, oFONT12b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Bill Date :", oFONT10b ) // 775
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.79),dtoc( dInvDate ), oFONT10 )
Line += oFont12b:nHeight
...
...