验证 Word 2007 模板文件
我正在开发一个解决方案,允许人们上传 DOCX 文件作为模板。 该模板用于生成带有数据库信息的Word文档。
我想做的是一旦模板上传,检查它是否有错误。 (我不希望我的解析器在使用模板时崩溃。)
我看到了有关 检查 Word 模板的签名,但这不足以验证文件的完整性。 当然,可以尝试解压缩文件,验证其中的 XML,等等,但这相当耗费 CPU 资源,如果有的话,我希望有一种不同的方法。
是否有属于 Open XML SDK 一部分的解决方案或其他标准方法? 任何想法都会受到赞赏。
I'm developing a solution that allows people to upload a DOCX file as a template. This template is used for generating Word documents with database info.
What I would like to do is once a template gets uploaded, to check it for errors. (I don't want my parser crashing when a template is used.)
I've seen the question about checking a signature of a Word template, but that isn't enough to validate the integrity of the file. Of course it is possible to try to unzip the file, validate the XML in there, and so on, but this is rather CPU intensive and I'd like a different approach if there is one.
Are there any solutions that are part of the Open XML SDK or other standard approaches to this? Any ideas are apreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 C# 中 MSDN 站点
in C# off the MSDN site