6

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?

4

3 回答 3

7

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

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

<cfdocument 
    format="pdf" 
    srcfile="C:\documents\MyDocument.doc" 
    filename="C:\documents\MyDocument.pdf"> 
</cfdocument>
于 2010-02-18T21:40:16.803 回答
5

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

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

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

于 2010-02-18T22:32:07.367 回答
0

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

请注意,我已经在这个产品上工作过,所以通常的免责声明适用。

于 2010-08-01T05:41:07.660 回答