subo cambiosvineconsefe1
This commit is contained in:
+11
-3
@@ -98,7 +98,7 @@ namespace compabetov2.Ventas
|
||||
}
|
||||
|
||||
|
||||
private void ImprimirContenidoEnvio(PrintPageEventArgs e)
|
||||
private void ImprimirContenidoEnvio(PrintPageEventArgs e, int paginasImpresas)
|
||||
{
|
||||
|
||||
string responsable = envio.responsable;
|
||||
@@ -163,11 +163,19 @@ namespace compabetov2.Ventas
|
||||
return direccion; // Devuelve la dirección sin cambios si no es necesario ajustarla
|
||||
}
|
||||
|
||||
public void ImprimirTicketEnvio()
|
||||
private void ImprimirTicketEnvio()
|
||||
{
|
||||
using (PrintDocument documentoImpresion = new PrintDocument())
|
||||
{
|
||||
documentoImpresion.PrintPage += (sender, e) => ImprimirContenidoEnvio(e);
|
||||
int paginasImpresas = 0;
|
||||
|
||||
documentoImpresion.PrintPage += (sender, e) =>
|
||||
{
|
||||
ImprimirContenidoEnvio(e, paginasImpresas);
|
||||
paginasImpresas++;
|
||||
e.HasMorePages = paginasImpresas < 2; // Indica que hay más páginas por imprimir
|
||||
};
|
||||
|
||||
using (PrintDialog printDialog = new PrintDialog())
|
||||
{
|
||||
printDialog.Document = documentoImpresion;
|
||||
|
||||
Reference in New Issue
Block a user