简体   繁体   English

将文档转换为 html 和 pdf

[英]converting doc to html and pdf

How can we convert a doc file into an html and a pdf file using c# in a web application?我们如何在 c# 应用程序中使用 c# 将 doc 文件转换为 html 和 pdf 文件?

I am making a web application and i want to convert a doc file into html and pdf as soon as the user clicks on the desired button我正在制作 web 应用程序,我想在用户单击所需按钮后立即将 doc 文件转换为 html 和 pdf

If you want to convert a word doc to pure html, you will need to run a function that strips all of the garbage characters from your word document.. you would be recreating your own basic CMS.如果您想将 word doc 转换为纯 html,则需要运行 function 从您的 word 文档中删除所有垃圾字符。您将重新创建自己的基本 CMS。

If you want to convert a word doc to PDF, you will need to run Microsoft Office on a Microsoft server and it gets quite complex and expensive to buy licences for using Office on the server.如果要将 word doc 转换为 PDF,则需要在 Microsoft 服务器上运行 Microsoft Office,并且购买在服务器上使用 Office 的许可证变得相当复杂和昂贵。

If you want to simply upload a word doc to a server, you can display it online using Google Doc Viewer without any conversion.如果您想简单地将 word doc 上传到服务器,您可以使用 Google Doc Viewer 在线显示它而无需任何转换。 Here is an short article on how to embed a document on a website. 这是一篇关于如何在网站上嵌入文档的简短文章 All that is required is a short amount of code:所需要的只是一小段代码:

<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM