Printer class question - RESOLVED
Posted: Tue Oct 20, 2020 9:11 am
I wanted to know if there was a function in the printer class that would automatically print a text and a box for example:
coordinates are
first text
x 1
y 5.5
width 4.5
height 0.8
Box very fine black colour gray color background
Font Arial 6
Left alignment top position
second text
x 1
y 5.5
width 4.5
height 0.8
Font Arial 12
Bottom position centered alignment
I tried with
CmSay( nRow, nCol, cText, oFont, nWidth, nClrText, nBkMode, nPad, lO2A )
but it's no god
My result
coordinates are
first text
x 1
y 5.5
width 4.5
height 0.8
Box very fine black colour gray color background
Font Arial 6
Left alignment top position
second text
x 1
y 5.5
width 4.5
height 0.8
Font Arial 12
Bottom position centered alignment
I tried with
CmSay( nRow, nCol, cText, oFont, nWidth, nClrText, nBkMode, nPad, lO2A )
but it's no god
Code: Select all
#include "fivewin.ch"
#define PAD_LEFT 0
#define PAD_RIGHT 1
#define PAD_CENTER 2
function Main()
local oPrn, oFont, oPen
Local nLinI, nColI, nLinF, nColF
PRINT oPrn NAME "TEST...." PREVIEW
DEFINE FONT oFont NAME "Arial" SIZE 0, -6 OF oPrn
DEFINE FONT oFont2 NAME "Arial" SIZE 0, -12 OF oPrn
DEFINE PEN oPen WIDTH 1 OF oPrn
oPrn:SetPage(9) // A4
oPrn:SetPortrait() //Vertical
PAGE
nLinI := 1.00
nColI := 5.5
nLinF := 0.8
nColF := 4.5
oPrn:Box(nLinI, nColI, nLinF, nColF, oPen, CLR_GRAY,,"CM" )
oPrn:cmSay( 1, 5.5, "Tipo documento", oFont,4.5,CLR_BLACK,,PAD_LEFT )
oPrn:cmSay(1,5.5, "DESCRIZIONE DOCUMENTO", oFont2,4.5,CLR_BLACK,,PAD_CENTER )
ENDPAGE
ENDPRINT
return nil