0

如果我在 html 文件中编写以下代码以使用王子工厂将其转换为 PDF,则它无法正常工作。

<a href="http://example.com">http://google.com</a>

从 Prince xml 生成的 pdf 中的上述链接工作正常,但它指向 google.com 而不是 example.com

<a href="http://example.com">Google</a>

此链接将不起作用,因为我们在 google 之前没有将任何东西写成 http 或 https。

有人可以帮我吗?

谢谢。

4

3 回答 3

2

您可以尝试使用 css 模型

html

<a href="http://example.com"><span class="linkContent"></a>

CSS

.linkContent {
    content: "http://google.com"
}

参考文档:https ://www.princexml.com/doc/8.1/gen-content/

希望它可以帮助你!

于 2017-02-28T08:38:29.330 回答
1

您好,您必须检查“prince-pdf-link-type”属性。默认值为自动,尝试更改为“web”: https ://www.princexml.com/doc/properties/prince-pdf-link-type/

于 2017-02-27T12:36:20.583 回答
0

对此表示歉意。但问题不在于 PrinceXML。后来经过这么多调查,我发现在FPDF中合并2个文档是有问题的。

我使用 Zend Merger 合并了由 PrinceXML 创建的 2 个文档,并且效果很好。

道歉并感谢大家的帮助。

于 2017-04-04T07:29:27.107 回答