Foros del Web » Programando para Internet » Javascript »

imprimir archivo. No lo entiendo.Como funciona?

Estas en el tema de imprimir archivo. No lo entiendo.Como funciona? en el foro de Javascript en Foros del Web. En deposito JS hay un script para imprimir documentos: <!-- Copiar dentro del tag HEAD --> <link rel="alternate" media="print" href="ejemplo.doc"> Yo lo que necesito es ...
  #1 (permalink)  
Antiguo 16/05/2002, 11:38
 
Fecha de Ingreso: febrero-2002
Mensajes: 14
Antigüedad: 22 años, 2 meses
Puntos: 0
imprimir archivo. No lo entiendo.Como funciona?

En deposito JS hay un script para imprimir documentos:

<!-- Copiar dentro del tag HEAD -->

<link rel="alternate" media="print" href="ejemplo.doc">

Yo lo que necesito es un link que diga imprimir y cuando haga click en el me imprima un archivo.doc o un .ppt o una planilla de excel.

¿Como lo hago?

Gracias...
  #2 (permalink)  
Antiguo 16/05/2002, 11:45
Avatar de Cain  
Fecha de Ingreso: enero-2002
Ubicación: Catalunya
Mensajes: 6.459
Antigüedad: 22 años, 3 meses
Puntos: 17
Re: imprimir archivo. No lo entiendo.Como funciona?

Código:
<a hreh="Javascript:self.print();">Imprime esto</a>

Joe Tawers,
<a href="http://www.ilimit.com/towers">http://www.ilimit.com/towers</a>
  #3 (permalink)  
Antiguo 16/05/2002, 12:07
 
Fecha de Ingreso: febrero-2002
Mensajes: 14
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: imprimir archivo. No lo entiendo.Como funciona?

gracias Cain, pero no necesito que imprima la pagina en la que estoy.

Lo que necesito es que, en la pagina que estoy haya un link que diga imprimir y cuando haga click en el me imprima un .doc que no se ve nunca. El .doc es solo para imprimir.

No se si se me explico?
  #4 (permalink)  
Antiguo 16/05/2002, 23:05
 
Fecha de Ingreso: febrero-2002
Mensajes: 14
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: imprimir archivo. No lo entiendo.Como funciona?

Parece ser que lo que yo necesito no es posible.

Por ahora pude encontrar la explicacion del script, que pego a continuacion por si a alguien le interesa:

Printing a page online usually means printing more than what you actually want. Webpages are quite fancy nowadays, with ad banners on top, navigational links on the left, and so on. That's fine when you're viewing the page online, but when you're printing the page, you only want to print out the &quot;actual content&quot;, and nothing else from the page! Many sites nowadays understand this, and provide an alternate &quot;print&quot; version of the document that surfers can go to and print out. Well, there's actually a much more elegant and seamless way of accomplishing the same thing, and that is by using the &lt;link&gt; tag. IE 4+ (and hopefully NS 5 when it comes out) supports a version of the &lt;link&gt; tag that allows you to specify to thr printer which file it should print when the user selects print. In other words, the job of locating the alternate print version of the document to print out is left to the printer, instead of the surfer. Take a look at the below example, and it will all be clear.

Demo: Let's say you're interested in only printing out the content in gray below from this page. As the webmaster, I could have helped you out by creating another HTML document with only the below content, and telling you to go there and print that document instead. However, I'm not going to do that. Instead, I've prepared a Word document called printversion.doc, and by adding the following:

&lt;link rel=alternate media=print href=&quot;printversion.doc&quot;&gt;

to the &lt;head&gt; section of this page, informed the printer to directly proceed to printversion.doc and print it when you select &quot;print&quot; on this page. In other words, the printer will print out printversion.doc instead when you choose &quot;print&quot; on printstyle.htm.

Bla, bla bla...

Bueno si alguien sabe como hacerlo y que funcione en ns4 y ie4 que por favor avise.

Saludos
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 00:53.