[SalesForce] Will the PDF rendered VF page can have buttons where user can click

I have designed a solution to generate a document for each record with the values from the record by having button that will generate a PDF form of the record with selected fields and there values.

I have a question that is it possible to add button to the PDF rendered VF page where user can click it.

Best Answer

Yes, it is possible There is an example below, that shows couple of links (as link, as buttons and as custom URL field as link type)

    <apex:page standardController="Account" renderAs="pdf" 
               standardStylesheets="false" showHeader="false" 
               sidebar="false" applyBodyTag="false"  >
    <body>
        <div class="button">
            <a href="https://google.com">Some custom link</a>
        </div>
        <div>
            <a href="https://google.com" 
               style="font: bold 11px Arial;text-decoration: none; 
                      background-color: #EEEEEE;color: #333333;padding: 2px 6px 2px 6px;
                      border-top: 1px solid #CCCCCC;border-right: 1px solid #333333;
                      border-bottom: 1px solid #333333; 
                      border-left: 1px solid #CCCCCC;">
                 Some link like a button
            </a>
        </div>
        <apex:detail subject="{!Account.Id}" relatedList="false" inlineEdit="false" showChatter="false"  />
    </body>
</apex:page>

If render as pdf, can result as pdf shown below: enter image description here

All the links are clickable (at least in google chrome preview) and lead to appropriate page.

Related Topic