Foros del Web » Creando para Internet » Diseño web »

Imprimir Archivo

Estas en el tema de Imprimir Archivo en el foro de Diseño web en Foros del Web. Hola, como puedo hacer un boton que mande a para imprimir un archivo, en este caso una imagen GIF desde mi pagina. La mayoria que ...
  #1 (permalink)  
Antiguo 04/05/2006, 14:49
Avatar de gragus  
Fecha de Ingreso: diciembre-2005
Mensajes: 162
Antigüedad: 18 años, 3 meses
Puntos: 0
Imprimir Archivo

Hola, como puedo hacer un boton que mande a para imprimir un archivo, en este caso una imagen GIF desde mi pagina.
La mayoria que encontre solo imprimen la pagina que esta abierta en el momento, no algun otro archivo dentro dentro del sitio.
  #2 (permalink)  
Antiguo 04/05/2006, 18:35
 
Fecha de Ingreso: diciembre-2004
Mensajes: 413
Antigüedad: 19 años, 3 meses
Puntos: 0
disuclpa que lo postee en ingles , no tengo tiempo para traducir,

Suppose you have a page with an image such as a directions map on it. You want the reader to be able to click on the image to print a copy. You can start with the onclick event tied to the image element. It would call the window.print() method to do the actual printing of the page.

<img src="location.jpg" onclick="window.print();">
But what if you only want to print the image and not the rest of the page. This takes a bit more work but mostly a bit of thought. Since window.print() does a whole page, why not put a copy of the image on its own page. You can even scale the image, center it, and add information if needed. A fragment of the second page is:

<script type="text/javascript">
function doit() {
window.print();\\ does the print of this page
top.location.href='first.htm';} \\ returns to original page
</script></head><body onload="doit();">
The only additional component you need besides the two pages is a method of transferring from one to the other. Transferring to another page can be done by setting the top.location.href property

<img src="location.jpg" onclick="top.location.href='second.htm';">
__________________
Directorio Empresas
agrega ya tu enlace
Seo Costa Rica
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:38.