Converting .xls to .pdf using Java(or not)

好久不见. 提交于 2019-12-22 10:28:41

问题


Is there a way to convert a xls file into a pdf?

I want to make a dynamical report directly to pdf file, but didn't find a way to make dynamic columns on iReport, so I've made a method on Java that exports to xls dynamically.

So I was wondering if is there a way to convert this file to pdf, but it need to be on a method from my code. Or if you have a better idea, it can be used too.

Maybe there's a way to make this pdf file from my code as I did with xls. Please help me out.

Thanks.


回答1:


Try using iText http://itextpdf.com/ - I've used it to create PDFs with columnar structure.




回答2:


In addition to using iText directly, there are a couple report engines that sit on top of it:

  • Eclipse BIRT (using 2.1.7, the last MPL/LGPL version)
  • Jasper Reports (which uses a Very Old version, 1.3.1 IIRC)



回答3:


This is a commercial solution:

http://www.dancrintea.ro/xls-to-pdf/

If you want open source try jakarta POI.




回答4:


Try using the Muhimbi PDF Converter Services. It comes with a Java compatible Web Services based interface and sample code. It does other things as well.

I worked on this application, so the usual disclaimer applies.



来源:https://stackoverflow.com/questions/4461131/converting-xls-to-pdf-using-javaor-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!