Imprimir en rollo y matriz de punto

Re: Imprimir en rollo y matriz de punto

Postby cmsoft » Wed Sep 22, 2021 7:37 pm

Todas las impresoras de tickets que manejo con la rutina que te pase, no hacen salto de página al hacer ENDPRINT
Tal vez tendrias que ver las preferencias de impresion y el tamaño de papel que tiene asignado en windows la impresora.
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Imprimir en rollo y matriz de punto

Postby gdeteran » Fri Sep 24, 2021 7:43 pm

José, tengo la impresión que el salto de línea está expresado en pixceles. Intenta que en vez de ++nRow prueba nRow += 10 por ejemplo.
Saludos,
Gonzalo
Puerto Montt - CHILE
FWH 22.12 - Harbour 3.2.0dev (r2008190002) - Borland/Embarcadero C++ 7.0(32-bit)
User avatar
gdeteran
 
Posts: 115
Joined: Fri Oct 14, 2005 7:10 pm
Location: Puerto Montt - CHILE

Re: Imprimir en rollo y matriz de punto

Postby JoseAlvarez » Sat Oct 02, 2021 12:07 am

gdeteran wrote:José, tengo la impresión que el salto de línea está expresado en pixceles. Intenta que en vez de ++nRow prueba nRow += 10 por ejemplo.


Saludos Amigo gdteran.

Muchas gracias por tu ayuda tambien.

al final, me decanté por usar la TdosPrn. El problema con el salto de linea era la clase que yo tenia, no me pregunten porr que, pero use la que gentilmente me paso el Master Joao y funciono a la primera.

Con las otras clases tambien me funciono, pero no pude evitar el salto de pagina al final de la impresion.

Aca dejo el codigo con la TdosPrn. Lo simplifique quitandole muchas cosas de uso propio para hacer el codigo mas legible. Si ven algo que no les cuadra puede deberse a esas partes propias que elimine.

Code: Select all  Expand view

        aDocsVenta // arreglo que viene como parametro y contienes los datos a imprimir

        cDocToPrint := './Preview/'+alltrim(cGetNumeroDoc)+'.txt'

        if nSalida>1
          oPrn:= TDosPrn():New("CUPOM.TXT") // ver la impresion por pantalla
         else
          oPrn:= TDosPrn():New(cDocToPrint) // para ir directo a la impresora
        endif

        oPrn:StartPage() // da inicia la pagina.

             ************************************************************************************
             *                    imprime el encabezado de la factura                           *
             ************************************************************************************

                nRow    := 0
                @ nRow, 00 Say chr(18)+_cCompanyName                        of oPrn ; ++nRow
                @ nRow, 00 Say "R.I.F    :"+_cCompanyRif                    of oPrn ; ++nRow
                @ nRow, 00 Say CHR(15)+_cDireccion1                         of oPrn ; ++nRow
                @ nRow, 00 Say _cDireccion2                                 of oPrn ; ++nRow
                @ nRow, 00 Say "Telf."+_cTelefonos                          of oPrn ; ++nRow
                @ nRow, 00 Say alltrim(_cCiudad)+" - "+alltrim(_cEstado)    of oPrn ; ++nRow
                if !Empty(_cMail)
                  @ nRow, 00 Say "eMail   :"+_cMail                         of oPrn ; ++nRow
                endif
                if !Empty(_cWebSite)
                  @ nRow, 00 Say "WebSite :"+_cWebSite                      of oPrn ; ++nRow
                endif
                @ nRow, 00 Say chr(18)+cDoc+alltrim(subs(cGetNumeroDoc,4,10)) of oPrn ; ++nRow
                @ nRow, 00 Say "Fecha    :"+dtoc(date())                      of oPrn ; ++nRow//; //3
                @ nRow, 00 Say "Hora     :" + subs(TIME(),1,5)                of oPrn ; ++nRow//; //4
                @ nRow, 00 Say "Venta en :" + alltrim(aDocsVenta[1,34])       of oPrn ; ++nRow//; //4
                iif(nCondicion=1,cCondicion:='Contado',cCondicion:='Credito')
                @ nRow, 00 Say "Condicion:" + cCondicion                      of oPrn ; ++nRow//; //4
                @ nRow, 00 Say +"|"+REPLICATE("-",27)+"|"              of oPrn ; ++nRow
                @ nRow, 00 Say CHR(18)+"Cliente:"+chr(15)                                     of oPrn ; ++nRow//; //4
                @ nRow, 00 Say cNombreCliente                                 of oPrn ; ++nRow//; //4
                @ nRow, 00 Say "CI/RIF :" +cGetRif                            of oPrn ; ++nRow//; //4
                if !Empty(cDireclien1)
                  @ nRow, 00 Say cDireclien1                                    of oPrn ; ++nRow//; //4
                endif
                if !Empty(cDireclien1)
                  @ nRow, 00 Say cDireclien2                                    of oPrn ; ++nRow//; //4
                endif
                if !Empty(cTelfCliente)
                  @ nRow, 00 Say "telef. :"+cTelfCliente                        of oPrn ; ++nRow//; //4
                endif
                @ nRow, 00 Say "|"+REPLICATE("-",47)+"|"                      of oPrn ; ++nRow

                ************************************************************************************
                *                    imprime el cuerpo de la factura                               *
                ************************************************************************************

                nCiclo:=1

                Do While nCiclo<=len(aDocsVenta)

                    cDescripcion := aDocsVenta[nCiclo,1]
                    cCantidad    := aDocsVenta[nCiclo,2]
                    cPrecioU     := aDocsVenta[nCiclo,3]
                    cSubTotal    := aDocsVenta[nCiclo,2]*aDocsVenta[nCiclo,3]

                    @ nRow,     00  Say cDescripcion              of oPrn   ; ++nRow // descripcion del articulo
                    @ nRow,     00  Say "Und "                    of oPrn
                    @ nRow,     04  Say cCantidad+ " x "+cPrecioU of oPrn            // cantidad vendida
                    @ nRow,     30  Say cSubTotal                 of oPrn   ; ++nRow // SubTotal

                  nRow  ++

                Enddo

                nCicloHeader:= 1

                cLeyenda1 :=    (cGetFromIni("LeyendasFact" , "Leyenda_Fact1" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))
                cLeyenda2 :=    (cGetFromIni("LeyendasFact" , "Leyenda_Fact2" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))
                cLeyenda3 :=    (cGetFromIni("LeyendasFact" , "Leyenda_Fact3" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))
                cLeyenda4 :=    (cGetFromIni("LeyendasFact" , "Leyenda_Fact4" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))  // leyendas genericas que se colocal al final de todas las facturas
                cLeyenda5 :=    (cGetFromIni("LeyendasFact" , "Leyenda_Fact5" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))  // por ejemplo "esta facura vence a los 30 dias"
                cLeyenda6 :=    (cGetFromIni("LeyendasFact" , "Leyenda_Fact6" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))  // "revise la mercancia antes de salir de la tienda. No se hacen devoluciones

            ************************************************************************************
            *                    se cierra la impresion                                        *
            ************************************************************************************

                @ nRow, 00 Say "|"+REPLICATE("-",47)+"|" of oPrn ; ++nRow
                @ nRow, 02 Say "Sub-Total"         of oPrn
                @ nRow, 30 Say + cSubTotal         of oPrn ; ++nRow
                @ nRow, 02 Say "Excento"           of oPrn
                @ nRow, 30 Say + cExcento          of oPrn ; ++nRow
                @ nRow, 02 Say "Descuentos"        of oPrn
                @ nRow, 30 Say  + cDescuent        of oPrn ; ++nRow
                @ nRow, 02 Say "Base Imponible"    of oPrn
                @ nRow, 30 Say + cBase             of oPrn ; ++nRow
                @ nRow, 02 Say "I.V.A. "+cVarAux   of oPrn
                @ nRow, 30 Say cIva                of oPrn ; ++nRow
                @ nRow, 02 Say "Total "+cVarAux2   of oPrn
                @ nRow, 30 Say cTotal              of oPrn ; ++nRow
                @ nRow, 00 Say "|"+REPLICATE("-",47)+"|" of oPrn ; ++nRow

                if _lPrintLeyend
                    @ nRow, 00 Say cLeyenda1         of oPrn ; ++nRow
                    @ nRow, 00 Say cLeyenda2         of oPrn ; ++nRow
                    @ nRow, 00 Say cLeyenda3         of oPrn ; ++nRow
                    @ nRow, 00 Say cLeyenda4         of oPrn ; ++nRow
                    @ nRow, 00 Say cLeyenda5         of oPrn ; ++nRow
                    @ nRow, 00 Say cLeyenda6         of oPrn ; ++nRow
                endif

                nRow:=nRow+14

                @ nRow, 00 Say "."                   of oPrn   // salto del papel hasta la linea de corte de la impresora
                @ nRow, 00 Say +CHR(18)              of oPrn //; ++nRow  // Modo Draft
                ***********************************************************************************

      oPrn:EndPage()

    oPrn:End()

        if nSalida>1
          ImpSpool( "CUPOM.TXT",, .T. )
        else
            WinExec(("LTFViewr5u.exe "+cDocToPrint))  // si se pide salida por pantalla, se hace el preview con esta utilidad de terceros.
        endif                                       // es gratuita y se descarga de internet.

        RETURN NIL
 
"Los errores en programación, siempre están entre la silla y el teclado..."

Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin

Carora, Estado Lara, Venezuela.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm

Re: Imprimir en rollo y matriz de punto

Postby artu01 » Sat Oct 02, 2021 6:36 pm

no llames al oPrn:EndPage() al final solo cuando llames al encabezado del reporte
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
artu01
 
Posts: 397
Joined: Fri May 11, 2007 8:20 pm
Location: Lima

Re: Imprimir en rollo y matriz de punto

Postby karinha » Sat Oct 02, 2021 8:32 pm

artu01 wrote:no llames al oPrn:EndPage() al final solo cuando llames al encabezado del reporte


És más fácil con un pequeño ejemplo, tiens? Podrias poner algo?

Muchas gracias.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir en rollo y matriz de punto

Postby JoseAlvarez » Sat Oct 02, 2021 8:59 pm

artu01 wrote:no llames al oPrn:EndPage() al final solo cuando llames al encabezado del reporte


Saludos artu01.

Podrias explicarme el punto por favor?
Quizás haya algo que no he visto.

La impresion es de una factura sobre un rollo continuo de papel, el encabezado se imprime una sola vez.

Encabezado, cuerpo de la factura y totales. Todo seguido sin pausas ni saltos de pagina.
"Los errores en programación, siempre están entre la silla y el teclado..."

Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin

Carora, Estado Lara, Venezuela.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm

Re: Imprimir en rollo y matriz de punto

Postby artu01 » Sun Oct 03, 2021 2:07 am

jose no lei bien tu correo pero creo que ya solucionaste tu problema de salto de pagina al final?
en todo caso sino es asi:
Code: Select all  Expand view


//oPrn:StartPage() // si lo comentas
.
.
.

// oPrn:EndPage() //y si lo comentas estas lineas no imprime?
 
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
artu01
 
Posts: 397
Joined: Fri May 11, 2007 8:20 pm
Location: Lima

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests