Monday 25 November 2013

Caution while rendering html link on Visualforce PDF’s


As we all knows that rendering engine doesn’t support javascript generated elements. The following logic also will fail to redirect the user.


<apex:image url="{!$Resource.PDFImage}" onclick="window.open('www.google.com');" width="550" height="50"/>



The better approach here is the following line of code which works perfectly in this scenario.


<apex:page renderAs="pdf" >
<apex:form >
<apex:outputLink value="https://learnsfdc.blogspot.com">Click Here</apex:outputLink>
</apex:form>
</apex:page>
**Caution: Use https instead of http while referencing the link

Also as a best practice use images from static resources while rendering pdf

1 comment:

  1. Your providing such a valuabe information about studying..and also have some good key points to every

    student.
    Salesforce Interview Questions |

    Salesforce Training Videos

    ReplyDelete