与 wkhtmltopdf 的内部链接? [英] Internal links with wkhtmltopdf?

查看:30
本文介绍了与 wkhtmltopdf 的内部链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 wkhtmltopdf 从多个网页创建了一个 PDF.

I have created a PDF from several web pages using wkhtmltopdf.

有没有办法跨页面链接,例如从第 10 页到第 15 页.

Is there a way to link across pages, for example from page 10 to 15.

我尝试创建一个带有 ID 的元素,然后创建一个链接到它的锚点,但这在同一页面或跨页面中不起作用.它将链接转换为绝对 URL 并尝试在网络浏览器中打开它.

I tried creating an element with an ID and then an anchor to link to it, but this does not work within the same page or across pages. It turns the link into an absolute URL and tries to open it in a web browser.

推荐答案

我通过更新我正在使用的二进制文件解决了这个问题.我使用的是 0.8 并切换到 0.11.0 rc1.

I solved this issue by updating the binary that I was using. I was using 0.8 and switched to 0.11.0 rc1.

确保它是针对 QT 构建的(最新的二进制文件位于 http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltoimage-0.11.0_rc1-static-amd64.tar.bz2 是.

Ensure that it is built against QT (the latest binary at http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltoimage-0.11.0_rc1-static-amd64.tar.bz2 is.

然后只是为了确保启用内部链接:

And then just to be sure enable internal links:

--enable-internal-links 

当您调用转换时

这篇关于与 wkhtmltopdf 的内部链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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