想把网页整屏导出到word,样式显示的问题
如题,我用常规的导出到word的方法,打开word,上面排版很乱,请问怎么解决,就是想把某个网页整屏的生成word,且word里的样式和网页的一样,谢了
protected void btnPdf_Click(object sender, EventArgs e)
{
Response.ContentType = "application/ms-word";//指定到word
Response.AddHeader("Content-Disposition", "inline;filename=test.doc");
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(sw);
sb.Append("");
Page.RenderControl(hw);//整个页面
Response.Write(sw.ToString());
Response.End();
}
这样倒出来的,有问题,乱排版,图片什么的都没有了