开发者

Need to disable an automatic URL hyperlinking with XSL-FO when generating a PDF document?

I'm using Apache XSL-FO to generate a PDF document from an XML using XSLT. In my XSL file I have an fo:block where I bring a URL and simply display it like th开发者_JS百科is: xsl:value-of select="company_info/website"

My website always contains a valid URL for some company, starting with www.abc.com

It seems like that by default anything with a www is being recognized as a URL and becomes linkable. It does not seem like I can force the link of that company to load in a new window, as it always loads the page in the PDF window and that's not a desirable behavior. I am trying to find a way to disable to URL altogether so that it is not linkable and the only way I'm able to do it tight now is by inserting '-' on both ends of the URL: -www.abc.com- Is there a more elegant way to insert some kind of a special character that maybe is not visible?


This is probably not something that can be fixed from the XSLT/XSL-FO side of things (except by inserting extra characters, as you have done). It is the PDF viewer that interprets certain strings as clickable links.

In Adobe Reader, you can disable automatic recognition of links by unchecking the "Create links from URLs" check box (Preferences dialog: General->Basic tools). Foxit Reader has this option too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜