Search code examples
pdfsalesforcevisualforce

Can visualforce's RenderAs PDF include href links?


We're using SalesForce's renderAs="PDF" option, and we want a clickable link in the body of the generated PDF. Is this possible?

I have tried an <a href="...">...</a> and I've tried <apex:outputlink value="...">...</apex:outputlink>, both result in a non clickable rendered version.

Has anyone found a way that works in salesforce's engine?

<apex:page standardController="Opportunity"  showHeader="false" renderas="pdf">
<apex:outputLink value="https://google.com">https://google.com</apex:outputLink>

<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
  <tr>
    <td>
...

Update: This is browser dependent. Firefox doesn't let you click the link, Google Chrome does.


Solution

  • What type of link are you trying to render in the PDF, a relative link? Using outputlink I have previously had the same behaviour but only for relative links.

    Using a full URL should render the hyperlink.