Hola gracias por responder, pude solucionarlo con :
oPrn:setpage(1)
t := oPrn:GetPhySize()
? t[1], t[2]
oPrn:setpage(5)
t := oPrn:GetPhySize()
? t[1], t[2]
oPrn:setpage(5)
t := oPrn:GetPhySize()
? t[1], t[2]
Con esto si devuelve el tamaño de hoja que se estableció, de esta forma resolví mi problema
Muchas Gracias
No logro definir tamaño de papel
-
- Posts: 155
- Joined: Tue Oct 11, 2016 1:02 pm
- Location: Luján, bs. as.
Re: No logro definir tamaño de papel resuelto
Jorge
Saludos.
Saludos.
Re: No logro definir tamaño de papel
Estimado jpcavagnaro
Si va a usar Centimetros
Intente con:
Tambien puede usar CMSay, CMLine...
Si va a usar Centimetros
Intente con:
Code: Select all | Expand
nAncho:=oPrn:PageWidth("CM")
nAlto:=oPrn:PageHeight("CM")
@1.0,5.9 PRINT TO oPrn TEXT "PRUEBA" SIZE nAncho,nAlto CM
Saludos,
Adhemar C.
Adhemar C.
Re: No logro definir tamaño de papel
Adhemar, muchas gracias estimado.
Regards, saludos.
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
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: No logro definir tamaño de papel
De nada estimado Joao
Para evitar ésto nLinea := nLinea + 1.00
Usa: LASTROW nLinea
Para evitar ésto nLinea := nLinea + 1.00
Usa: LASTROW nLinea
Code: Select all | Expand
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM FONT oBold LASTROW nLinea
// nLinea := nLinea + 1.00 //ya no es necesario
Saludos,
Adhemar C.
Adhemar C.
Re: No logro definir tamaño de papel
Gracias estimado. Simplesmente PERFECTO!! Thank you very much!acuellar wrote:De nada estimado Joao
Para evitar ésto nLinea := nLinea + 1.00
Usa: LASTROW nLineaCode: Select all | Expand
@ nLinea, nColumn PRINT TO oPrn TEXT cTxt1 SIZE nAncho, nAlto CM FONT oBold LASTROW nLinea // nLinea := nLinea + 1.00 //ya no es necesario
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341