Adhemar, muchas gracias estimado.
Code: Select all | Expand
// C:\FWH\SAMPLES\PRINTADH.PRG - By Adhemar.
#include "FiveWin.ch"
FUNCTION Main()
LOCAL oPrn, oFont, oBold, n, nAncho, nAlto, nLinea, nColumn
// 60 caracteres en el maximo
LOCAL cTxt1 := "Lo que quiero es imprimir un informe en hoja A4 y que se"
LOCAL cTxt2 := "respete el tamaño sin que tenga en cuenta la impresora "
LOCAL cTxt3 := "predeterminada. El tema es que se usa en varias pc y "
LOCAL cTxt4 := "tienen distintas impresoras y tamaños de papel "
LOCAL cTxt5 := "predeterminados y sale en algunas bien y en otras mal, "
LOCAL cTxt6 := "porque no se respeta el A4 que necesito. "
LOCAL cTxt7 := "Cómo imprimir en centímetros en cualquier impresora "
LOCAL cTxt8 := " jpcavagnaro - Jorge"
nLinea := 2.0
nColumn := 1.5
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 10 OF oPrn
DEFINE FONT oBold NAME "TAHOMA" SIZE 0, - 18 OF oPrn BOLD
oPrn:SetPage( 9 ) //-> A4 //9
oPrn:SetPortrait() //-> Vertical(Retrato)
nAncho := oPrn:PageWidth("CM")
nAlto := oPrn:PageHeight("CM")
PAGE
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt2 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt3 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt4 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt5 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt6 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt7 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 2.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt2 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt3 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt4 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt5 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt6 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt7 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 2.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt2 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt3 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt4 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt5 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt6 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt7 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 3.00
nColumn := nColumn + 4.50
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt8 SIZE nAncho, nAlto CM ;
FONT oBold
IF nLinea >= 27 // nueva pagina
nLinea := 2.0
nColumn := 1.5
ENDPAGE
PAGE
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt2 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt3 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt4 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt5 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt6 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt7 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 2.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt2 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt3 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt4 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt5 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt6 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt7 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 2.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt2 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt3 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt4 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt5 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt6 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 1.00
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt7 SIZE nAncho, nAlto CM ;
FONT oBold
nLinea := nLinea + 3.00
nColumn := nColumn + 4.50
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt8 SIZE nAncho, nAlto CM ;
FONT oBold
ENDIF
ENDPAGE
ENDPRINT
RELEASE FONT oFont, oBold
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.