C#-我想在不使用word.interop的情况下打印word文档

C#-我想在不使用word.interop的情况下打印word文档,c#,asp.net-mvc,C#,Asp.net Mvc,我不想在服务器上安装word,因此我不想使用word.interop 我想做的是在我的web应用程序中打印word文档。 我的班级是这样的 namespace SCD4.Models { using Novacode; public class DocumentDocX { public DocumentDocX(string inputFile) { this.InputFile = inputFile;

我不想在服务器上安装word,因此我不想使用word.interop

我想做的是在我的web应用程序中打印word文档。 我的班级是这样的

namespace SCD4.Models
{
    using Novacode;

    public class DocumentDocX
    {
        public DocumentDocX(string inputFile)
        {
            this.InputFile = inputFile;
        }

        public string  InputFile { get; set; }

        public void OutputLetter(string outputFile, string placeholder, string newText)
        {
            using (var document = DocX.Load(this.InputFile))
            {
                document.ReplaceText(placeholder, newText);
                document.SaveAs(outputFile);
                PrintDocument(outputFile);
            }
        }
    }
}
DocX是我从CodePlex获得的一个程序集,它易于使用,但不打印word文档。
我还没有写我的PrintDocument方法。我应该如何编写它?

您想在没有编写用于管理property格式的property应用程序的情况下管理它吗?毫无疑问,对于那些实现这些事情的人来说是可行的,并且已经得到了所有者的认可,可以重用。这只剩下一个问题:为什么?你可以用它来做。但是,您还没有解释您反对使用Word.Interop的原因?我可以想出两个原因来解释为什么您不想使用它(成本,而且因为MS建议不要在无人看管的情况下使用它)-但我对您的产品感兴趣,因为如果它是成本,那么Aspose不是一个合适的解决方案(它相当昂贵),尽管存在用于处理Office文档的第三方库,我过去使用过的这些工具都不支持渲染(即,您不能使用它们显示或打印文档)。您可能可以使用OpenOffice自动化来做您想做的事情。这需要完整的OpenOffice安装。@GrantThomas我不明白为什么在没有特定供应商工具的情况下管理专有格式是非法的。任何风险(如侵犯专利或版权)都将由工具的供应商承担,而不是客户。@RB。我甚至不能说我会根据猜测来尝试。