小编Toq*_*uis的帖子

使用 window.print content 将网页下载为 pdf

我想要一个链接,当点击它时,会自动开始下载网页的可打印版本。

我正在使用 Moodle。我想要的内容完全相同如果我使用 ctrl + p 下载页面并保存为 pdf 或使用

<a href=\"whatever.htm\" onClick=\"window.print();return false\">Download web page</a>
Run Code Online (Sandbox Code Playgroud)

I want exactly that content because using this way, the header, sidebar and footer is removed. I don't want css.

I'm not using this because this doesn't work in some browsers.

I'd rather not using pdf libraries like tcpdf because Moodle loads the content in a dynamic way and send this to a libraries like that is a mess.

I tried using sites like pdfcrowd.com …

javascript php pdf moodle

6
推荐指数
2
解决办法
3万
查看次数

标签 统计

javascript ×1

moodle ×1

pdf ×1

php ×1