SetSize no funciona
Posted:
Wed Apr 27, 2022 5:34 pm
by horacio
Compañeros
Estoy usando la clase printer y quiero definir el tamaño de una hoja en particular, quise usar oPrn : SetSize() pero no funciona, tampoco tiene mucho efecto oPrn : SetPage()
Hay alguna solución para esto. Uso FWH 20.04, Harbour 3.2 y BCC7. Muchas gracias
Saludos
Re: SetSize no funciona
Posted:
Thu Apr 28, 2022 1:44 pm
by Antonio Linares
Horacio,
Puedes copiar aqui un ejemplo de como lo estás usando ?
gracias
Re: SetSize no funciona
Posted:
Fri Apr 29, 2022 3:18 pm
by horacio
Hola Antonio, aquí va un ejemplo
- Code: Select all Expand view
Printer oPrn Name "Impresión comprobantes Rapipago" Preview
oPrn : lPrvModal := .t.
Define Font oFont1 Name 'Arial' Size 0, -6 Of oPrn
Define Font oFont2 Name 'Arial' Size 0, -6 Of oPrn Bold
Define Font oFont3 Name 'Arial' Size 0, -8 Of oPrn
Define Font oFont4 Name 'Arial' Size 0, -8 Of oPrn Bold
Define Font oFont5 Name 'Arial' Size 0, -10 Of oPrn
Define Font oFont6 Name 'Tahoma' Size 0, -10 Of oPrn Bold
Define Font oFont7 Name 'Arial' Size 0, -6 Of oPrn //Nescapement 900
//oPrn : SetPage( 36 )
oPrn : SetSize( 50, 180 )
aPaperSizes := oPrn : GetPhySize()
Page
oPrn : CmSay( 5, 5, "Hola Mundo" oFont1 )
EndPage
EndPrint
Muchas gracias
Saludos
Re: SetSize no funciona
Posted:
Wed May 04, 2022 12:22 am
by cmsoft
Prueba y comenta si ves los cambios de los diferentes tipos de paginas y tamaños
- Code: Select all Expand view
#include "FiveWin.Ch"
FUNCTION Main()
LOCAL oPrn, oFont1, oFont2
Define Font oFont1 Name 'Arial' Size 60, 95 Of oPrn
Define Font oFont2 Name 'Arial' Size 60, 95 Of oPrn Bold
PRINT oPrn Name "Impresión comprobantes Rapipago A4" Preview
oPrn:SetPortrait()
Page
oPrn:SetPage(9)
@ 0,0 PRINT TO oPrn IMAGE "..\bitmaps\olga1.jpg" SIZE oPrn:nHorzRes(), oPrn:nVertRes() PIXEL GRAY
@ 5, 5 PRINT TO oPrn TEXT "Hola Mundo";
SIZE 18,1 CM FONT oFont1 ALIGN "C"
EndPage
EndPrint
PRINT oPrn Name "Impresión comprobantes Rapipago A5 apaisado" Preview
oPrn:SetLandscape()
Page
oPrn:SetPage(11)
@ 0,0 PRINT TO oPrn IMAGE "..\bitmaps\olga1.jpg" SIZE oPrn:nHorzRes(), oPrn:nVertRes() PIXEL GRAY
@ 5, 5 PRINT TO oPrn TEXT "Hola Mundo";
SIZE 18,1 CM FONT oFont1 ALIGN "C"
EndPage
EndPrint
PRINT oPrn Name "Impresión comprobantes Personalizado" Preview
oPrn:SetPortrait()
Page
oPrn:SetPage(27)
@ 0,0 PRINT TO oPrn IMAGE "..\bitmaps\olga1.jpg" SIZE oPrn:nHorzRes(), oPrn:nVertRes() PIXEL GRAY
@ 5, 5 PRINT TO oPrn TEXT "Hola Mundo";
SIZE 18,1 CM FONT oFont1 ALIGN "C"
EndPage
EndPrint
RELEASE FONT oFont1
RELEASE FONT oFont2
return nil