What's the best program / API for converting W

2019-04-06 13:43发布

Well, really the title of the question says it all. There are similar questions on SO already. But here's some differences... I absolutely cannot use Office on the server. I must be able to convert the document programmatically. I don't really care how much it costs. Obviously cheaper is better, but if you have a good suggestion that happens to be pricey, please feel free to include it.

------ Edit ------

I accepted the OpenOffice.org answer because it seemed like the most intriguing. However, I really am curious what other people think. Keep posting answers and voting and I'll accept whichever has the most votes.

9条回答
乱世女痞
2楼-- · 2019-04-06 14:01

You might want to try Aspose, which is also used by Google.

查看更多
Fickle 薄情
3楼-- · 2019-04-06 14:02

Using Convert API it is simple as this HTTP request:

POST https://v2.convertapi.com/doc/to/pdf?Secret=XXX&File=http://example.com/myfile.doc

if file is accessible from the internet. If file is not accessible from the internet, Convert API supports many ways how to pass a file for conversion.

查看更多
4楼-- · 2019-04-06 14:03

OpenOffice can be run in a GUI-less server mode. Using it that way, you can connect to it, stream a document to it, and then convert to any type it supports and stream it back.

查看更多
倾城 Initia
5楼-- · 2019-04-06 14:04

If you want to use OpenOffice then you may use from the command line unoconv with latest LibreOffice. This works in general but be prepared to:

  • have some more fancy formatting lost,
  • repeat conversion due to some exception on LibreOffice side.

I would discourage using UNO API directly. This is possible (and you may have a pool of running OpenOffice servers that will perform the conversion) but definitely not easy.

Google Docs is for me of no use as the conversion file size limit is 2 MB.

查看更多
小情绪 Triste *
6楼-- · 2019-04-06 14:06

You might want to have a look at the CloudConvert API. They are using native Office and they are a way cheaper than Aspose.

查看更多
冷血范
7楼-- · 2019-04-06 14:19

If you upload a document (.doc, .docx, .odf) to google documents you can download as a PDF. This is an easy free solution but it might be hard to integrate.

查看更多
登录 后发表回答