无需办公室即可将Excel转换为PDF [英] Excel to PDF without office

查看:120
本文介绍了无需办公室即可将Excel转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我正在使用的Windows应用程序中生成PDF报告,这是通过将.xlsx文件导出为pdf来实现的.我目前正在为此使用互操作性:

I need to generate PDF reports in a windows application I'm working on, and I do this by exporting an .xlsx file to pdf. I'm currently using interop for this, however:

  • 我需要在不要求用户购买软件的情况下执行此操作,所以没有Microsoft Office擅长于此.
  • 我也不能使用任何繁重的依赖项(例如开放/自由办公).
  • 该应用程序位于.NET winforms中,并且是本地的(不依赖于Internet连接).

我尝试过的事情:

  • 我已经尝试过iTextSharp,但这会使事情变得非常复杂 像列溢出.
  • 尝试了closeXML,但无法转换为PDF.
  • (如前所述)尝试互操作,但找不到使其独立于办公室的方法.
  • I have tried iTextSharp but this gets really complicated with things like overflowing columns.
  • Tried closedXML but there couldn't convert to PDF.
  • (As mentioned earlier) Tried interop but couldn't find a way to make it independent on office.

我们将不胜感激,在此先感谢您:)

Help would be appreciated, thank you in advance :)

iTextSharp

除了需要导出具有可变数量的大数据表外,我将使用它 列(最多30列),并且如果有很多列,则变得非常复杂 处理该列溢出,这在互操作中很容易.

iTextSharp

I would use it except I need to export a big DataTable that has a variable number of columns (up to 30 columns), and if there are many columns then It gets really complicated to handle that column overflow, which was easy in interop.

摆姿势

似乎太贵了,因为我在一家目前资源非常有限的小公司工作.

Aspose

Appears to be too expensive, since I work for a small company that is currently very limited in resources.

推荐答案

使用HTML代替使用Excel来布置报告.它更加灵活,并且几乎是用于为最终用户布置数据的最简单工具.然后查找许多HTML到PDF解决方案(wkhtmltopdf,安装打印到pdf驱动程序等)之一.

Instead of using Excel to layout your reports, use HTML. It is much more flexible, and pretty much the easiest tool for laying out data for end users. Then look up one of the many HTML to PDF solutions (wkhtmltopdf, installing a print to pdf driver, etc.)

这篇关于无需办公室即可将Excel转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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