如何在服务器端加载word文档进行编辑和保存 [英] how to load word document on server side for editing and save

查看:173
本文介绍了如何在服务器端加载word文档进行编辑和保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了一个应用程序,我在ck编辑器中加载html页面进行编辑然后保存。但后者当我检索保存的文件时,所有格式都丢失了。所以现在我正在尝试将原始word文档加载到ck编辑器中。我真的不知道是否可能。所以,如果有人在解决之前请帮我解决这个问题。如果任何其他解决方案将被接受但请注意我必须在服务器端加载word文档,并且必须保存在服务器中以备将来使用。请不要向我推荐任何付费组件,因为我作为实习生进行项目,并且不具备在asp.net的商业组件上投入预算的经济能力。谢谢大家。

i have built one application in which i am loading html pages in ck editor for edit and then save it. but latter when i am retrieving the saved file all the format is lost. so now i am trying to load the original word document into ck editor. i really don't know whether it is possible or not. so if any one has worked out it before please help me regarding this thing. if any other solution will be accepted but note that i have to load word document on server side and have to save in the server for future use. please don't suggest me any paid component because i am doing the project as intern and not so financially capable of investing budget on commercial components of asp.net. thank you for all in advance.

推荐答案

试用DocX



< a href =https://docx.codeplex.com/> https://docx.codeplex.com/ [ ^ ]



C#:使用DocX以编程方式创建和处理Word文档 [ ^ ]



或者公开赛XML SDK。
Try DocX

https://docx.codeplex.com/[^]

C#: Create and Manipulate Word Documents Programmatically Using DocX[^]

Or the Open XML SDK.


首先关于保存的文件丢失所有格式,我假设您指的是HTML文件格式。很遗憾没有更多的信息我不能确定为什么会出现这个问题,但我认为问题可能是您的输出文件使用外部CSS,您是否尝试过仅使用内联样式?



尽管如此,对于单词文档,您必须将它们转换为HTML内容,以便在任何WYSIWYG HTML编辑器中显示它们(这也包括CK编辑器)。如果你的文件都是新的(DOCX格式),我建议你试试这个:

使用PowerTools for Open XML将DOCX转换为高保真的HTML / CSS [ ^ ]



如果您需要两者的解决方案旧的(DOC)和新的单词格式然后我担心没有免费的解决方案(至少不是我的知识)。嗯......有Word的自动化,我不建议你在服务器端使用。
First regarding the saved file loosing all the formatting, I presume you are referring to HTML file format. Well unfortunately without more information I cannot say for sure why this issue occurs to you but I presume the problem may be that your output file uses external css, have you tried using only inline styling?

Nevertheless regarding the word documents you'll have to convert them to HTML content in order to display them in any WYSIWYG HTML editor (this includes CK editor as well). In case your documents are all newer (DOCX format) I would suggest you to try this out:
Transform DOCX to HTML/CSS with High-Fidelity using PowerTools for Open XML[^]

If you need the solution for both old (DOC) and new word format then I'm afraid there is no free solution (at least not to my knowledge). Well... there is Word's automation which I wouldn't recommend you to use on server side.


这篇关于如何在服务器端加载word文档进行编辑和保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆