08/10/2008, 09:36
|
| | | Fecha de Ingreso: octubre-2008 Ubicación: La ciudad de la esperanza
Mensajes: 133
Antigüedad: 16 años, 1 mes Puntos: 3 | |
Respuesta: Imprimir Ticket con Visual Basic 2005 Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Drawing.Printing
Imports System.IO
Public Class ticket
Public LineasDeLaCabeza As ArrayList = New ArrayList()
Public LineasDeLaSubCabeza As ArrayList = New ArrayList()
Public Elementos As ArrayList = New ArrayList()
Public Totales As ArrayList = New ArrayList()
Public LineasDelPie As ArrayList = New ArrayList()
Private headerImagep As Image
Public contador As Integer = 0
Public CaracteresMaximos As Integer = 35
Public CaracteresMaximosDescripcion As Integer = 20
Public imageHeight As Integer = 0
Public MargenIzquierdo As Double = 10
Public MargenSuperior As Double = 13
Public NombreDeLaFuente As String = "Lucida Console"
Public TamanoDeLaFuente As Integer = 9
Public FuenteImpresa As Font
Public ColorDeLaFuente As SolidBrush = New SolidBrush(Color.Black)
Public gfx As Graphics
Public CadenaPorEscribirEnLinea As String = ""
Private WithEvents DocumentoAImprimir As New PrintDocument
Public Sub Ticket()
End Sub
Public Property HeaderImage() As Image
Get
Return headerImagep
End Get
Set(ByVal value As Image)
'If headerImagep.Width <> value.Width Then
'End If
headerImagep = value
End Set
End Property
Public Property MaximoCaracter() As Integer
Get
Return CaracteresMaximos
End Get
Set(ByVal value As Integer)
If (value <> CaracteresMaximosDescripcion) Then CaracteresMaximosDescripcion = value
End Set
End Property
Public Property MaximoCaracterDescripcion() As Integer
Get
Return CaracteresMaximosDescripcion
End Get
Set(ByVal value As Integer)
If (value <> CaracteresMaximosDescripcion) Then CaracteresMaximosDescripcion = value
End Set
End Property
Public Property TamanoLetra() As Integer
Get
Return TamanoDeLaFuente
End Get
Set(ByVal value As Integer)
If (value <> TamanoDeLaFuente) Then TamanoDeLaFuente = value
End Set
End Property
Public Property NombreLetra() As String
Get
Return NombreDeLaFuente
End Get
Set(ByVal value As String)
If (value <> NombreDeLaFuente) Then NombreDeLaFuente = value
End Set
End Property
Public Sub AnadirLineaCabeza(ByVal linea As String)
LineasDeLaCabeza.Add(linea)
End Sub
Public Sub AnadirLineaSubcabeza(ByVal linea As String)
LineasDeLaSubCabeza.Add(linea)
End Sub
Public Sub AnadirElemento(ByVal cantidad As String, ByVal elemento As String, ByVal precio As String)
Dim NuevoElemento As OrdenarElementos = New OrdenarElementos()
'''''items.Add(newitem.
Elementos.Add(NuevoElemento.GenerarElemento(cantid ad, elemento, precio))
End Sub
Public Sub AnadirTotal(ByVal Nombre As String, ByVal Precio As String)
Dim NuevoTotal As OrdernarTotal = New OrdernarTotal
' OrderTotal(newtotal)
Totales.Add(NuevoTotal.GenerarTotal(Nombre, Precio))
End Sub
Public Sub AnadeLineaAlPie(ByVal linea As String)
LineasDelPie.Add(linea)
End Sub
Private Function AlineaTextoaLaDerecha(ByVal Izquierda As Integer) As String
Dim espacios As String = ""
Dim spaces As Integer = MaximoCaracter() - Izquierda
Dim x As Integer
For x = 0 To spaces
espacios += " "
Next
Return espacios
End Function
Private Function DottedLine() As String
Dim dotted As String = ""
Dim x As Integer
For x = 0 To MaximoCaracter()
dotted += "="
Next
Return dotted
End Function |