生成PDF文档时需要禁用XSL-FO的自动URL超链接吗? [英] Need to disable an automatic URL hyperlinking with XSL-FO when generating a PDF document?

查看:91
本文介绍了生成PDF文档时需要禁用XSL-FO的自动URL超链接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Apache XSL-FO使用XSLT从XML生成PDF文档.在我的XSL文件中,我有一个fo:block,在其中带一个URL并像这样简单地显示它:xsl:value-of select ="company_info/website"

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 this: xsl:value-of select="company_info/website"

我的网站始终包含某些公司的有效URL,从www.abc.com开始

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

默认情况下,带有www的所有内容似乎都被识别为URL,并且可以链接.我似乎不能强迫该公司的链接加载到新窗口中,因为它总是将页面加载到PDF窗口中,这不是理想的行为.我试图找到一种完全禁用URL的方法,以使它不可链接,而我现在能做到的唯一唯一方法是在URL的两端都插入-":-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?

推荐答案

这可能不是从XSLT/XSL-FO方面可以解决的问题(除了通过插入额外的字符(如您所做的那样)).PDF查看器将某些字符串解释为可单击的链接.

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.

在Adobe Reader中,可以通过取消选中从URL创建链接"复选框(首选项"对话框:常规"->基本"工具)来禁用对链接的自动识别.福昕阅读器也有此选项.

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.

这篇关于生成PDF文档时需要禁用XSL-FO的自动URL超链接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆