Retroceder   Foros del Web > Programación para sitios web > .NET > web forms

Respuesta
 
Herramientas Desplegado
Antiguo 06-jun-2006, 16:24   #1 (permalink)
didierpavajeau está en el buen camino
 
Fecha de Ingreso: noviembre-2004
Mensajes: 40
word diseño impresion

Alguien sabe como se pone en version de impresion un documento word con asp.net

yo quiero abrir un documento html con word pero el problema es que siempre lo abre con vista de diseño web y yo quiero que lo abra vista diseño impresion
didierpavajeau está desconectado   Responder Citando
Antiguo 26-mar-2008, 10:33   #2 (permalink)
david_ ha deshabilitado el karma
 
Fecha de Ingreso: febrero-2005
Mensajes: 34
Re: word diseño impresion

Yo estoy en la misma :S, me da q eso es cosa del programa y la única forma es covertirlo a word o rtf
david_ está desconectado   Responder Citando
Antiguo 26-mar-2008, 10:49   #3 (permalink)
Peterpay tiene algunos puntos positivos de karma
 
Avatar de Peterpay
 
Fecha de Ingreso: septiembre-2007
Ubicación: Mexico
Mensajes: 2.029
Enviar un mensaje por MSN a Peterpay Enviar un mensaje por Skype™ a Peterpay
Re: word diseño impresion

Correccion esto es para vista de impresion desde la pagina
Cita:
Podrian jugar con javascript y dejar q el navegador reconociera el tipo

window.open('rutaarchivo.doc,'preview','height=600 ,width=915,top=50,left=50,scrollbars=1')

Aqui hay un articulo pero con asp.net 3.5

http://blog.maartenballiauw.be/post/...NQ-to-XML.aspx
Para lo q ustedes necesitan es jugar con los parametros del word como dice david_
__________________
Saludos
Peterpay
MCPD EAD
Directorio Gratuito
Peterpay está desconectado   Responder Citando
Antiguo 27-mar-2008, 12:48   #4 (permalink)
david_ ha deshabilitado el karma
 
Fecha de Ingreso: febrero-2005
Mensajes: 34
Re: word diseño impresion

He conseguido que abra como "Diseño de Impresión" directamente en el Word. Cambiando la cabecera por esto:

Cita:
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title></title>
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:DoNotHyphenateCaps/>
<w:PunctuationKerning/>
<w:DrawingGridHorizontalSpacing>9.35 pt</w:DrawingGridHorizontalSpacing>
<w:DrawingGridVerticalSpacing>9.35 pt</w:DrawingGridVerticalSpacing>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:7.5pt;
mso-bidi-font-size:8.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Verdana";}
p.small
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:1.0pt;
mso-bidi-font-size:1.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Verdana";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1032">
<o:colormenu v:ext="edit" strokecolor="none"/>
</o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
En el medio aparece esto: <w:View>Print</w:View> que indica que abra en modo diseño de impresión, también se le pueden poner más parámetros como "<w:Zoom>100</w:Zoom>".

Añadir propiedades de documento:

Cita:
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Pepito de los palotes</o:Author>
<o:LastAuthor>user</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>18</o:TotalTime>
<o:LastPrinted>2007-09-24T16:01:00Z</o:LastPrinted>
<o:Created>2008-03-30T12:37:00Z</o:Created>
<o:LastSaved>2008-03-30T12:37:00Z</o:LastSaved>
<o:Pages>3</o:Pages>
<o:Words>93</o:Words>
<o:Characters>515</o:Characters>
<o:Lines>4</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>607</o:CharactersWithSpaces>
<o:Version>12.00</o:Version>
</o:DocumentProperties>
</xml><![endif]-->

Añadir plantilla de encabezado y pie de página (guardarla con el word como htm):

Cita:
<style>
/* Page Definitions */
@page
{mso-footnote-separator:url("http://miurl.com/header.htm") fs;
mso-footnote-continuation-separator:url("http://miurl.com/header.htm") fcs;
mso-endnote-separator:url("http://miurl.com/header.htm") es;
mso-endnote-continuation-separator:url("http://miurl.com/header.htm") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;
mso-header-margin:0cm;
mso-footer-margin:0cm;
mso-title-page:yes;
mso-header:url("http://miurl.com/header.htm") h1;
mso-footer:url("http://miurl.com/header.htm") f1;
mso-first-header:url("http://miurl.com/header.htm") fh1;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
Para que se vea la plantilla htm hay que poner el código de la página entre "<div class=div.Section1>"

Última edición por david_; 31-mar-2008 a las 01:54.
david_ está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 14:16.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93