0

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.

shruti
  • 780
  • 9
  • 25

3 Answers3

2

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!

nmtri
  • 444
  • 3
  • 6
1

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/

BGH
  • 56
  • 1
  • 6
  • How can I use this? With style tag? If possible can you please give me any example for the same.. Thanks again! – shruti Mar 02 '17 at 04:08
  • can you show your code? to see what are you missed what language you use ? PHP ? – BGH Mar 03 '17 at 14:35
0

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.

shruti
  • 780
  • 9
  • 25