Office文档为PDF [英] Office documents to PDF

查看:137
本文介绍了Office文档为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了这个几个线程,但我没有得到很直接的答案在我的搜索。我有一个需要采取DOC,DOCX,XLS,XLSX文件转换成PDF格式的Web应用程序。现在,我们有一个使用该打开的文档,其打印一个PS文件的Microsoft.Office.Interop.Word库中的过程,那么GPL GhostScript的的PS文件转换成PDF格式。

I have seen a couple threads about this, but am not getting very straight answers in my searching. I have a web application that needs to take in doc, docx, xls, xlsx files and convert them into PDF. Right now we have a process that uses the Microsoft.Office.Interop.Word library which opens up the document, prints it to a PS file, then GPL GhostScript converts the PS file into a PDF.

该过程的工作OKish,但总体来说是有几个步骤,而这原本是几年前开发的时候它甚至很难找到一个PDF打印驱动程序和接口了。在更新的精神,我期待在试图找到一个可能的更好的方式来处理这个问题。主要的原因是,在我们的应用中使用Web服务调用来执行转换过程中的高架运行,具有较新的Windows服务器,特别是对微软Windows 7的发展,甚至与模拟打开文件的能力造成了一些问题与互操作库。

This process works OKish, but overall there are several steps in there, and this was originally developed years ago when it was even harder to find a PDF print driver and interface it. In the spirit of updating, I am looking at trying to find a possible better way to handle this. The main reason is that in our application we use a web service call to perform the elevated operation of the conversion process, with newer windows server and in particular for Window 7 for development, the ability to open the file even with impersonation is causing some issues with the Interop library.

这一切我敢肯定,可以计算出,并冰释前嫌,但我不知道是否有更新,更好的方式去了解这一点。我研究过PDF995,但我没有找到一个很好的方式,以编程方式去和直接打印文件为PDF。在code,他们提供的是在C ++中,我没有找到如何模仿C#中的电话。

All of this I'm sure can be figured out and ironed out, but I was wondering if there is a newer and better way to go about this. I have looked into PDF995, but am not finding a great way to programmatically go in and print a file directly to a PDF. The code they provide is in C++ and I am not finding how to mimic the calls in C#.

推荐答案

如果你正在寻找一个免费的解决方案,我想你可能是唯一可行的选择摆在那里,但像约翰说,服务器端的互操作性通常不是一个好主意。 我们使用了.NET 的Aspose组件有很大的成功。这是一个没有需要的互操作或办公室纯粹的管理解决方案。

If you're looking for a "free" solution, I think you might have the only viable option out there, but like John said, server-side interop is typically not a good idea. We've used the .NET Aspose components with a great deal of success. This is a pure managed solution with no interop or office required.

这篇关于Office文档为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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