ColdFusion的 - HTML网页转换为Word或PDF文档 [英] ColdFusion - converting HTML webpage to Word or PDF document

查看:171
本文介绍了ColdFusion的 - HTML网页转换为Word或PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,在用户有可能要打印此页或将其保存他/她的计算机上。

I have a webpage, where user has a possible to Print this page OR to save it on his/her computer.

我如何可以将其保存为Word或PDF文档?

How may I save it as a Word or PDF document?

感谢。

推荐答案

对于MS Word的要求,办公室的大部分版本都可以跨preT基本的HTML / XML。所以,你可能会考虑老cfcontent黑客以POI一个简单的选择。 (字包并不像在S preadsheet包作为成熟的。)

For the MS Word requirement, most versions of Office can interpret basic html/xml. So you might consider the old cfcontent hack as a simpler alternative to POI. (The Word package is not quite as mature as the spreadsheet package.)

基本上你生成html,而是使用cfheader / cfcontent到的告诉的浏览器中的内容确实是一个Word文档。这显然​​不是一个真正的MS Word文件。但它比大多数选项简单。

Basically you generate html, but use cfheader/cfcontent to tell the browser the content is really a Word document. It is obviously not a true MS Word file. But it is simpler than most options.

http://msdn.microsoft.com/en-us/library/ aa155477.aspx

<cfheader name="Content-Disposition" value="attachment; filename=someFile.doc">
<cfcontent type="application/msword"> 
... your html code here ...

这篇关于ColdFusion的 - HTML网页转换为Word或PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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