Imprimir un archivo .bmp

08/11/2004 - 22:58 por Galia | Informe spam
tengo el siguiente codigo q funciona en proyecto
system.windows.forms pero no funciona en un proyecto web
porq no carga el dll correspondiente.

////////////////////////////////////////
private void lbImpresion_Click(object sender,
System.EventArgs e)
{
try
{
// Assumes the default printer.
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandle
(this.pd_PrintPage);
pd.Print();
}
catch(Exception ex)
{
}
}
}



private void pd_PrintPage(object sender,
PrintPageEventArgs ev)
{
// Draw a picture.
ev.Graphics.DrawImage(System.Drawing.Image.FromFile
("C:\\MyFile.bmp"), ev.Graphics.VisibleClipBounds);

// Indicate that this is the last page to print.
ev.HasMorePages = false;
}

///////////////////////////////////////////

como podria hacer para que funcione este codigo en mi
proyecto web.

Preguntas similare

Leer las respuestas

#1 Jorge Serrano [MVP VB]
09/11/2004 - 12:48 | Informe spam
Galia,

el funcionamiento de una aplicación Windows y una aplicación Web no es el
mismo.

En el sistema Web, puede haber código que se ejecute en el lado del servidor
en lugar del lado del cliente. Cuando se desarrollan aplicaciones Web, es
necesario tener claro este concepto, porque podrías estar haciendo una acción
determinada que bloqueara el funcionamiento del servidor en algún momento, o
que no le llegara al cliente la respuesta idónea.

Un saludo,

Jorge Serrano
MVP VB.NET


"Galia" wrote:

tengo el siguiente codigo q funciona en proyecto
system.windows.forms pero no funciona en un proyecto web
porq no carga el dll correspondiente.

////////////////////////////////////////
private void lbImpresion_Click(object sender,
System.EventArgs e)
{
try
{
// Assumes the default printer.
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandle
(this.pd_PrintPage);
pd.Print();
}
catch(Exception ex)
{
}
}
}



private void pd_PrintPage(object sender,
PrintPageEventArgs ev)
{
// Draw a picture.
ev.Graphics.DrawImage(System.Drawing.Image.FromFile
("C:\\MyFile.bmp"), ev.Graphics.VisibleClipBounds);

// Indicate that this is the last page to print.
ev.HasMorePages = false;
}

///////////////////////////////////////////

como podria hacer para que funcione este codigo en mi
proyecto web.

email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida