Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: scavdr en 27 Enero 2016, 18:00 pm



Título: imprimir imagen en impresora pos(ticket)
Publicado por: scavdr en 27 Enero 2016, 18:00 pm
que tal comunidad, veran tengo una duda y haber si es posible, tengo un pequeño sistema que imprime un recibo a una impresora pos(ticket), la impresora acepta impresion de imagenes y cod. barras, pero a la hora de enviar la impresion me tirra error, los tipos no son compatibles

Código
  1.  
  2. Private Sub CmdPrintSave_Click()
  3. On Error GoTo Err
  4.  
  5.    Dim TITLE01 As String
  6.    Dim TITLE02 As String
  7.    Dim TITLE03 As String
  8.    Dim TITLE04 As String
  9.    Dim TITLE05 As String
  10.    Dim TITLE06 As String
  11.    Dim TITLE07 As String
  12.    Dim TITLE08 As String
  13.    Dim TITLE09 As String
  14.    Dim TITLE10 As String
  15.    Dim TITLE11 As String
  16.    Dim TITLE12 As String
  17.    Dim TempDinero01 As String * 6
  18.    Dim TempDinero02 As String * 6
  19.    Dim TempDinero03 As String * 6
  20.    Dim TempDinero04 As String * 6
  21.    Dim TextoExtra As String
  22.    Dim TextoExtraDiferenciado As String
  23.    Dim NombreExtra As String
  24.    Dim NombreExtraDiferenciado As String
  25.  
  26.    If MsgBox("¿DESEA IMPRIMIR Y GUARDAR EL RECIBO ACTUAL?", vbQuestion + vbYesNo, App.Title) = vbYes Then
  27.        TITLE01 = 41 - Len(MTrim(SCHOOLNAME))
  28.        TITLE02 = TITLE01 / 2
  29.        TITLE03 = 41 - Len(MTrim(DIRECTION))
  30.        TITLE04 = TITLE03 / 2
  31.        TITLE05 = 41 - Len(MTrim(RESOLUTION))
  32.        TITLE06 = TITLE05 / 2
  33.        TITLE07 = 41 - Len(MTrim(PHONES))
  34.        TITLE08 = TITLE07 / 2
  35.        Printer.FontName = "Consolas"
  36.        Printer.FontSize = 9
  37.        Printer.FontBold = False
  38.  
  39. '----------AQUI TIRRA EL ERRORR---------------        
  40. Printer.PaintPicture LoadPicture(App.Path & "\images\logo.jpg"), 0, 0, 128, 43
  41. '----------AQUI TIRRA EL ERRORR---------------        
  42.  
  43.  
  44.        Printer.Print Space(TITLE02) & MTrim(SCHOOLNAME)
  45.        Printer.Print Space(TITLE04) & MTrim(DIRECTION)
  46.        Printer.Print Space(TITLE06) & MTrim(RESOLUTION)
  47.        Printer.Print Space(TITLE08) & MTrim(PHONES)
  48.        Printer.Print String(11, Chr(45)) & "[ DATOS PERSONALES ]" & String(11, Chr(45))
  49.        Printer.Print "NOMBRE:"
  50.        If Len(LblNombre_Alumno.Caption) > 41 Then
  51.            NombreExtraDiferenciado = Len(LblNombre_Alumno.Caption) - 41
  52.            NombreExtra = Right(LblNombre_Alumno.Caption, CLng(TextoExtraDiferenciado))
  53.            Printer.Print MTrim(LblNombre_Alumno.Caption) '<-Nombre del estudiante
  54.            Printer.Print MTrim(NombreExtra) '<-Nombre del estudiante
  55.        Else
  56.            Printer.Print MTrim(LblNombre_Alumno.Caption)
  57.        End If
  58.        Printer.Print
  59.        Printer.Print "CÓDIGO PERSONAL:" & Space(17) & "CARNÉ #:" '<-COL33
  60.        Printer.Print Space(4) & MTrim(LblCod_Personal.Caption) & Space(23) & MTrim(LblNOCarne.Caption)  '<-Código Personal y # de Carné
  61.        Printer.Print String(41, Chr(61))
  62.        Printer.Print
  63.        Printer.Print String(7, Chr(45)) & "[ DESCRIPCIÓN DEL RECIBO ]" & String(8, Chr(45))
  64.        If ChkPagoInscripcion.value = 1 Then
  65.            TempDinero01 = Len(TxtImporte01.Text)
  66.            TITLE09 = 6 - TempDinero01
  67.            Printer.Print "PAGO INSCRIPCIÓN" & String(17, ".") & "Q " & Space(TITLE09) & TxtImporte01.Text '<-Pago Inscripción
  68.        End If
  69.        If ChkPagoColegiatura.value = 1 Then
  70.            TempDinero02 = Len(TxtImporte02.Text)
  71.            TITLE10 = 6 - TempDinero02
  72.            Printer.Print "PAGO COLEGIATURA" & String(17, ".") & "Q " & Space(TITLE10) & TxtImporte02.Text '<-Pago Colegiatura
  73.            Printer.Print Space(5) & "MES: [ " & CboMeses.Text & " ]"
  74.        End If
  75.        If ChkOtros.value = 1 Then
  76.            TempDinero03 = Len(TxtImporte03.Text)
  77.            TITLE11 = 6 - TempDinero03
  78.            Printer.Print "OTROS PAGOS" & String(22, ".") & "Q " & Space(TITLE11) & TxtImporte03.Text '<-Otros pagos
  79.            Printer.Print MTrim(TxtDescripcionPago.Text)
  80.        End If
  81.        TempDinero04 = Len(LblTotal.Caption)
  82.        TITLE12 = 6 - TempDinero04
  83.        Printer.Print Space(9); "TOTAL A PAGAR" & String(11, ".") & "Q " & Space(TITLE12) & LblTotal.Caption  '<-Dinero a pagar
  84.        Printer.Print
  85.        Printer.Print "EN LETRAS:"
  86.        If Len(LblImporteenLetras.Caption) > 41 Then
  87.            TextoExtraDiferenciado = Len(LblImporteenLetras.Caption) - 41
  88.            TextoExtra = Right(LblImporteenLetras.Caption, CLng(TextoExtraDiferenciado))
  89.            Printer.Print MTrim(LblImporteenLetras.Caption) '<-Importe en letras
  90.            Printer.Print MTrim(TextoExtra) '<-Importe en letras
  91.        Else
  92.            Printer.Print MTrim(LblImporteenLetras.Caption)  '<-Importe en letras
  93.        End If
  94.        Printer.Print String(41, Chr(61))
  95.        Printer.Print
  96.        Printer.Print
  97.        Printer.Print
  98.        Printer.Print
  99.        Printer.Print
  100.        Printer.Print
  101.        Printer.Print
  102.        Printer.Print Space(4) & String(33, Chr(45)) & Space(4)
  103.        Printer.Print Space(5) & "FIRMA Y SELLO DEL ADMINISTRADOR" & Space(5)
  104.        Printer.Print Space(4) & "COMPROBANTE DE PAGO, NO CONTABLE"
  105.        Printer.Print
  106.        Printer.Print Space(11) & "GRACIAS POR SU PAGO" & Space(11)
  107.        Printer.Print
  108.        Printer.Print "[ " & Format(Now, "Short Date") & "-" & Format(Now, "Short Time") & " ]" & "[ RECIBO #: " & MTrim(LblNORecibo.Caption) & " ]"
  109.        Printer.EndDoc
  110.  
  111.  

es una epson tm-20ii, gracias


Mod: No escribir en mayúsculas