从网页创建PDF与SWF文件网页、文件、PDF、SWF

2023-09-04 23:16:41 作者:我爱妳高烧不退

我想生成一个网页,里面有图片和SWF文件的PDF文件。

I am trying to generate a pdf from a web page which has pictures and swf files.

最终的PDF应该有图片(瑞士法郎应该被转换为图像,最后一帧就足够了)。

Final pdf should have pictures (swf should be converted into image, last frame is sufficient).

我能够生成时只有图像是有PDF,但我卡在创建PDF时,网页都有SWF文件。

I am able to generate pdf when only images are there but i am stuck in creating pdf when the web page has swf files.

推荐答案

您也许可以使用 wkhtmltopdf --enable-插件。但根据该错误报告可能无法正常工作的http:// code.google.com / P / wkhtmltopdf /问题/详细信息?ID = 48 的Flash插件(但Java的呢!)。

You might be able to use wkhtmltopdf --enable-plugins. But according to this bugreport it might not work http://code.google.com/p/wkhtmltopdf/issues/detail?id=48 with the flash plugin (Java however does!).

另一种选择是运行在无头模式的​​浏览器,或者在虚拟X. Firefox3的作品据说,如果你使用的扩展CommandLinePrint。

Another option is running a browser in headless mode, or on a virtual X. Firefox3 works supposedly if you use the extension "CommandLinePrint".

Xvfb :2 -screen 0 1600x1200x24 &
firefox --display=localhost:2.0 -print http://flashgames.com -printmode pdf -printfile '/tmp/test.pdf'

相关信息从的http://spielwiese.la-evento.com/xelasblog/archives/31-Headless-Firefox-als-HTML-to-PDF.html (德文不过)。

但也有几个导游像这样(无头的浏览器,HTML到PDF)。我将完全链接到这里的StackOverflow的受骗者之一。但我懒得去搜索现在。

But there are a few more guides like this ("headless browser, HTML to PDF"). I would totally link to one of the dupes here on Stackoverflow. But I'm too lazy to search right now.