简体   繁体   中英

Create Clickable External Link in XSL for PDF Creation

I'm trying to create a clickable hyperlink in my xsl code. This xsl receives xml input and creates a pdf bill for customers. I'm trying to make the hyperlink work, but I can't find any solution online.

I've searched the internet and can't find any solution that works. I've tried using an anchor tag around my url as well as fo:basic-link.

<xsl:if test="@donation = '0.00' and @outputpastduemsg != 'true'">
              <fo:block  padding-top=".15in" color="black" font-size="9pt">Please visit 

<fo:basic-link external-destination="https://blahblahblah.org/donations">

to discover ways that you can help those in critical financial need.
              </fo:block>
</xsl:if>

I'd expect to see the created pdf with a hyperlink, but when I try to view the pdf in the application it gives me a pop up window with the following

"Not Found

The requested URL /pm/once-off/Statement-for-67002_1562332338838.pdf was not found on this server."

Your sample XML is not well-formed since the fo:basic-link does not have an end-tag.

Similarly to Generating PDF from XML using XSL:FO. Transforming the hyperlink content from XML to PDF , put the URI in external-destination ( https://www.w3.org/TR/xsl11/#external-destination ):

<fo:basic-link
  external-destination="url(https://blahblahblah.org/donations)">blahblahblah.org</fo:basic-link>

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