Eso lo hace bien, pero no puedo modificar el punto de inicio de la impreción.
Esta siempre se inicia en 10x10 y yo quiero que empiece mas a la izquierda, como puedo modificer los margenes?
uso el siguiente codigo.
Código vb:
La ipresión lo hace en papel continuo de 25cm de ancho por 20,30cm de alto.Ver original
Private Sub pd1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd1.PrintPage Dim c, piey, totalx, seniax, saldox, desp, presx, presy, direx, direy, apynx, apyny, fecx, fecy, entrex, entrey, barriox, barrioy, telx, tely, listx, listy As Integer Dim aux As Double Dim Ini As CIniClass Ini = New CIniClass c = 0 Ini.Archivo = System.AppDomain.CurrentDomain.BaseDirectory() & "configuracion.ini" aux = Val(Ini.LeeIni("Printer", "trans")) desp = Val(Ini.LeeIni("Printer", "desp")) * aux presx = Val(Ini.LeeIni("Printer", "pres-x")) * aux presy = Val(Ini.LeeIni("Printer", "pres-y")) * aux direx = Val(Ini.LeeIni("Printer", "dire-x")) * aux direy = Val(Ini.LeeIni("Printer", "dire-y")) * aux apynx = Val(Ini.LeeIni("Printer", "apyn-x")) * aux apyny = Val(Ini.LeeIni("Printer", "apyn-y")) * aux fecx = Val(Ini.LeeIni("Printer", "fec-x")) * aux fecy = Val(Ini.LeeIni("Printer", "fec-y")) * aux entrex = Val(Ini.LeeIni("Printer", "entrec-x")) * aux entrey = Val(Ini.LeeIni("Printer", "entrec-y")) * aux barriox = Val(Ini.LeeIni("Printer", "barrio-x")) * aux barrioy = Val(Ini.LeeIni("Printer", "barrio-y")) * aux telx = Val(Ini.LeeIni("Printer", "tel-x")) * aux tely = Val(Ini.LeeIni("Printer", "tel-y")) * aux listx = Val(Ini.LeeIni("Printer", "lis-x")) listy = Val(Ini.LeeIni("Printer", "lis-y")) piey = Val(Ini.LeeIni("Printer", "pie-y")) * aux totalx = Val(Ini.LeeIni("Printer", "total-x")) * aux seniax = Val(Ini.LeeIni("Printer", "senia-x")) * aux saldox = Val(Ini.LeeIni("Printer", "saldo-x")) * aux '************************************************************** e.Graphics.PageUnit = GraphicsUnit.Millimeter e.Graphics.DrawString(Format(NFactura, "0000-00000000"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, presx, presy) e.Graphics.DrawString(Format(NFactura, "0000-00000000"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, presx + desp, presy) e.Graphics.DrawString("Fecha y Hora: " & Now(), New Font("Arial", 9, FontStyle.Regular), Brushes.Black, fecx, fecy) e.Graphics.DrawString("Fecha y Hora: " & Now(), New Font("Arial", 9, FontStyle.Regular), Brushes.Black, fecx + desp, fecy) e.Graphics.DrawString("Entregar: " & Me.txtEntregar.Text, New Font("Arial", 9, FontStyle.Regular), Brushes.Black, fecx, fecy + 3) e.Graphics.DrawString("Entregar: " & Me.txtEntregar.Text, New Font("Arial", 9, FontStyle.Regular), Brushes.Black, fecx + desp, fecy + 3) e.Graphics.DrawString("Vuelto: " & Me.txtVuelto.Text, New Font("Arial", 9, FontStyle.Regular), Brushes.Black, fecx, fecy + 6) e.Graphics.DrawString("Vuelto: " & Me.txtVuelto.Text, New Font("Arial", 9, FontStyle.Regular), Brushes.Black, fecx + desp, fecy + 6) '************************************************************** e.Graphics.DrawString(Me.txtNombre.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, apynx, apyny) e.Graphics.DrawString(Me.txtNombre.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, apynx + desp, apyny) e.Graphics.DrawString(Me.cmbDireccion.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, direx, direy) e.Graphics.DrawString(Me.cmbDireccion.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, direx + desp, direy) e.Graphics.DrawString(Me.txtECalles.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, entrex, entrey) e.Graphics.DrawString(Me.txtECalles.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, entrex + desp, entrey) e.Graphics.DrawString(Me.txtBarrio.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, barriox, barrioy) e.Graphics.DrawString(Me.txtBarrio.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, barriox + desp, barrioy) e.Graphics.DrawString(Me.txtTelefono.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, telx, tely) e.Graphics.DrawString(Me.txtTelefono.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, telx + desp, tely) While Me.lvwPresupuesto.Items.Count > c e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(0).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(0).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + desp, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(1).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + 14, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(1).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + 14 + desp, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(2).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + 67, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(2).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + 67 + desp, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(3).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + 82, listy + (c * 5)) e.Graphics.DrawString(Me.lvwPresupuesto.Items(c).SubItems(3).Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, listx + 82 + desp, listy + (c * 5)) c = c + 1 End While e.Graphics.DrawString(Format(Val(Me.txtTotalT.Text), "0.00"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, totalx, piey) e.Graphics.DrawString(Format(Val(Me.txtSenia.Text), "0.00"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, seniax, piey) e.Graphics.DrawString(Format(Val(Me.txtTotalT.Text) - Val(Me.txtSenia.Text), "0.00"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, saldox, piey) e.Graphics.DrawString(Format(Val(Me.txtTotalT.Text), "0.00"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, totalx + desp, piey) e.Graphics.DrawString(Format(Val(Me.txtSenia.Text), "0.00"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, seniax + desp, piey) e.Graphics.DrawString(Format(Val(Me.txtTotalT.Text) - Val(Me.txtSenia.Text), "0.00"), New Font("Arial", 12, FontStyle.Regular), Brushes.Black, saldox + desp, piey) End Sub
Si corro el papel bien hacia la derecha, me recorta del lado derech del papel.
El formulario continuo no puede ser modificado.
Con printer de VB 6.0 funcionaba.