简体   繁体   English

超链接在PrinceXML中不起作用

[英]Hyperlinks not working in PrinceXML

If I write below code in html file to convert it to PDF with prince factory it is not working properly. 如果我在html文件中编写以下代码,以使用王子工厂将其转换为PDF,则无法正常工作。

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

This above link in pdf generated from prince xml is working properly, but it is pointing to google.com instead of example.com 从prince xml生成的pdf中的上述链接正常工作,但它指向的是google.com而不是example.com

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

This link will not work as we have not written anything before google as http or https. 此链接将不起作用,因为我们没有在Google之前以http或https的形式编写任何内容。

Can someone please help me on this? 有人可以帮我吗?

Thanks. 谢谢。

You can try with css model 您可以尝试使用CSS模型

Html HTML

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

CSS CSS

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

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

Hope it can help you! 希望它能对您有所帮助!

hi you have to check the "prince-pdf-link-type" property. 您好,您必须检查“ prince-pdf-link-type”属性。 by default value is auto, try to change to "web" : https://www.princexml.com/doc/properties/prince-pdf-link-type/ 默认值是自动,请尝试更改为“ web”: https : //www.princexml.com/doc/properties/prince-pdf-link-type/

Apologies for this. 对此表示歉意。 But the problem was not with PrinceXML. 但是问题不在于PrinceXML。 later after so much investigation, I found that it was problem with merging 2 documents in FPDF. 经过大量调查后,我发现合并FPDF中的两个文档存在问题。

I used Zend Merger for merging 2 documents which were created by PrinceXML and it worked perfect. 我使用Zend Merger合并了PrinceXML创建的2个文档,并且效果很好。

Apologies and Thank you all for your help. 抱歉,谢谢大家的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM