在浏览器中渲染docx文件 [英] Render docx file in a browser

查看:296
本文介绍了在浏览器中渲染docx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用docx4j将Microsoft Word文档转换为pdf,然后在浏览器中显示 http: //www.docx4java.org/trac/docx4j ,它非常适合预览.我面临的问题是这种转换会丢失大多数Microsoft Word文档格式.分页符和字体无法正确转换为PDF格式,即使我使用的是标准字体类型docx4j也不随附.在Linux Tomcat托管的方案中,找不到字体并抛出异常,因为它会退回到sans serif或其他通用类型.

我已经找到了这个Microsoft工具来使文档在线呈现,但是我在防火墙后面,所以我不能将此工具作为一个选项:解决方案

尝试使用 http: //converter-eval.plutext.com/viewer.html

将其视为Alpha级预览.我们尚未发布它,但是您可以将其托管在防火墙后面.

恐怕它不是开源的,我们仍在制定价格(以及是否/如何提供免费版本).

I'm using docx4j to convert a microsoft word document into a pdf then displaying it in a browser http://www.docx4java.org/trac/docx4j and it works well for a preview. The problem I'm facing is that this conversion loses most of the microsoft word document formatting. Page breaks and fonts don't transfer into the PDF format properly and even though I'm using standard font types docx4j doesn't come with them. In a Linux Tomcat hosted scenario fonts are not found and throw exceptions as it falls back to sans serif or other generic types.

I have found this Microsoft tool to make documents render online, but I'm behind a firewall so I cannot include this tool as an option: https://products.office.com/en-us/office-online/view-office-documents-online

I'm open to suggestion on displaying a docx file as a preview and print option from within a browser. Pdf conversion appears to be the most promising, but I run into formatting issues.

Any ideas are welcome!

解决方案

Have a play with http://converter-eval.plutext.com/viewer.html

Consider it an alpha level preview. We haven't quite released it yet, but you will be able to host it behind a firewall.

It isn't open source, I'm afraid, and we're still working out pricing (and whether/how there could be a free edition).

这篇关于在浏览器中渲染docx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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