centrar texto en tickets térmicos

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
edufloriv
Posts: 170
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB
Location: PERU
Has thanked: 8 times
Been thanked: 6 times

centrar texto en tickets térmicos

Post by edufloriv » Fri Jun 14, 2019 2:54 pm

Buenos dias amigos,

Uso esta función para tratar de centrar texto en la impresión de tickets térmicos:

Code: Select all

*>----------------------------------------------------------------------<*
*>----------------------------------------------------------------------<*
*>----------------------------------------------------------------------<*

FUNC ColCentra(cQueText)

LOCAL nLenText , nDotText , nDotInic

   cQueText := ALLTRIM(cQueText)
   nLenText := LEN( cQueText )
   nDotText := nLenText
   nDotInic := INT( (70 - nDotText) / 2 )

RETURN( nDotInic )
Pero no me queda bien:
ticket.png
ticket.png (32.47 KiB) Viewed 418 times
¿ alguno tiene alguna función para realizar esto ?

Agradezco de antemano su valiosa ayuda.


Cordiales saludos,

Eduardo Flores Rivas


LIMA - PERU

User avatar
dragancesu
Posts: 715
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 24 times
Been thanked: 149 times

Post by dragancesu » Fri Jun 14, 2019 3:49 pm

It's simple
Look in documentation PRINT DATA


@ <Row> , <Col> PRINT [ DATA ] <xData>
[ TO <nToRow> , <nToCol> ]
[ FONT <cFontName> ]
[ SIZE <nFontSize> ]
[ BOLD ]
[ ITALIC ]
[ UNDERLINE ]
[ STRIKEOUT ]
[ COLOR <aColor> ]
[ RIGHT | CENTER ]
[ ANGLE <nAngleInDegrees> ]
In your case

@ row, 60 PRINT ALLTRIM(cQueText) CENTER // in case paper width is 120

User avatar
edufloriv
Posts: 170
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB
Location: PERU
Has thanked: 8 times
Been thanked: 6 times

Post by edufloriv » Fri Jun 14, 2019 7:35 pm

Gracias amigo,

Quedo perfecto , saludos. :)
nuevo-tiket.jpg
nuevo-tiket.jpg (54.46 KiB) Viewed 385 times

Att.

Eduardo Flores Rivas


LIMA - PERU

Post Reply