简体   繁体   中英

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.

<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

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

This link will not work as we have not written anything before google as http or https.

Can someone please help me on this?

Thanks.

You can try with css model

Html

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

CSS

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

Refer doc: 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. by default value is auto, try to change to "web" : https://www.princexml.com/doc/properties/prince-pdf-link-type/

Apologies for this. But the problem was not with PrinceXML. later after so much investigation, I found that it was problem with merging 2 documents in FPDF.

I used Zend Merger for merging 2 documents which were created by PrinceXML and it worked perfect.

Apologies and Thank you all for your help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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