是否可以使用 ColdFusion 将 Microsoft Word 文档转换为 PDF?

发布于 2024-08-22 21:25:07 字数 165 浏览 4 评论 0原文

上面的问题已经说明了一切。我知道您可以使用 CFPDF 在 ColdFusion 8 中从图像文件或 HTML 创建 PDF,但我想知道是否可以直接在 CF8 或 CF9 中从 MS Word 文档创建 PDF。

您能否导入Word文档并将其转换为HTML或图像文件,然后进行转换?或者有什么捷径吗?

The above question says it all. I know you can create a PDF from an image file or HTML in ColdFusion 8 using CFPDF, but I'm wondering if it's possible to create a PDF from a MS Word document directly - in CF8 or CF9.

Could you import the Word document and convert it to HTML or an image file, and then do the conversion? Or is there a shortcut?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空城缀染半城烟沙 2024-08-29 21:25:07

请参阅文档:Office 文件互操作性 - 使用 cfdocument

ColdFusion 9 支持OpenOffice,它使用cfdocument 标记将Word 文档(.doc 格式)转换为PDF。

<cfdocument 
    format="pdf" 
    srcfile="C:\documents\MyDocument.doc" 
    filename="C:\documents\MyDocument.pdf"> 
</cfdocument>

see Doc: Office file interoperability - Using cfdocument

ColdFusion 9 supports OpenOffice, which uses the cfdocument tag to convert a Word document (.doc format) to PDF.

<cfdocument 
    format="pdf" 
    srcfile="C:\documents\MyDocument.doc" 
    filename="C:\documents\MyDocument.pdf"> 
</cfdocument>
沒落の蓅哖 2024-08-29 21:25:07

在 CF8 中,您可能可以使用 COM 对象集成或 POI 集成来做一些事情,但这并不简单/直接。

使用 Word 的另存为功能将其转换为 HTML 可能是使用 CF8 的最简单途径。不过,我建议 Henry 的想法是正确的,升级到 CF9 以利用 OO.O 集成。

编辑:感谢@jarofclay,我现在知道 POI CFC 包装器已更新为包含 Word 文档。我记得它只支持 Excel,但这显然已经改变了。嗯,现在改变我对 CF8 中如何执行此操作的投票是否为时已晚?

In CF8, you could probably do something with COM object integration or POI integration, but it would not be simple/straightforward.

Converting it to HTML using Word's save as feature is probably the simplest route using CF8. I'll suggest that Henry has the right idea, though, upgrading to CF9 to take advantage of OO.O integration.

Edit: Thanks to @jarofclay, I now know that the POI CFC wrapper has been updated to include Word docs. I remembered it only supporting Excel, but that's clearly changed. Um, is it too late for me to change my vote for how to do this in CF8?

谷夏 2024-08-29 21:25:07

我对 CF 一点也不熟悉,但如果您可以从中进行 Web 服务调用,请尝试 此产品。它依赖于 MS-Office 而不是 Open Office,因此提供了更好的转换保真度。它还支持其他格式,包括 Infopath、Excel、PowerPoint 等以及 水印支持

请注意,我曾开发过该产品,因此通常的免责声明适用。

I am not at all familiar with CF, but if you can make web service calls from it then try this product. It relies on MS-Office rather than Open Office so provides much better conversion fidelity. It also supports additional formats including Infopath, Excel, PowerPoint etc as well as Watermarking support.

Please note that I have worked on this product so the usual disclaimers apply.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文