使用xsl-fo将链接放在PDF文件中

时间:2016-05-11 12:57:18

标签: xml pdf xslt

我使用FOP XSL-FO Anchor答案中给出的代码在我的xsl-fo代码生成的PDF文件中放置一个链接。我使用的代码是

<fo:table-row font-size="8pt">
  <fo:table-cell text-align="left" number-columns-spanned="12" padding-left="0.1cm" padding-top="0.1cm" border-left="0.50pt solid black" border-right="0.50pt solid black"  >                       
    <fo:block>
        <fo:basic-link 
            external-destination="url('http://www.moga.mo.gov/mostatutes/stathtml/26000003921.html)" 
            color="blue" text-decoration="underline">
             http://www.moga.mo.gov/mostatutes/stathtml/26000003921.html
       </fo:basic-link> 
    </fo:block>
  </fo:table-cell>
</fo:table-row>

PDF文件中生成的链接

file:///C:/Users/pondek/Appdata/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.IE5/NJ1Y1AFR/'http://www.moga.mo.gov/mostatutes/stathtml/26000003921.html

我不知道是否重要,但我在使用Windows 7Professional的PC上使用Rad 8.5。任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

我没有结束'。应该是

external-destination="url('http://www.moga.mo.gov/mostatutes/stathtml/26000003921.html')"  

而不是

external-destination="url('http://www.moga.mo.gov/mostatutes/stathtml/26000003921.html)"