SetSize no funciona

SetSize no funciona

Postby horacio » Wed Apr 27, 2022 5:34 pm

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
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: SetSize no funciona

Postby Antonio Linares » Thu Apr 28, 2022 1:44 pm

Horacio,

Puedes copiar aqui un ejemplo de como lo estás usando ?

gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: SetSize no funciona

Postby horacio » Fri Apr 29, 2022 3:18 pm

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
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: SetSize no funciona

Postby horacio » Sun May 01, 2022 2:46 am

+1
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: SetSize no funciona

Postby horacio » Tue May 03, 2022 12:13 pm

+1
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: SetSize no funciona

Postby cmsoft » Wed May 04, 2022 12:22 am

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
 
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 29 guests