+ Start a Discussion
Vijay sidaraddiVijay sidaraddi 

Build a button called “Export as PDF” on the case object and create a VF page to generate a PDF from the case object

Hi Team,

Could someone tell how to do htis 
Build a button called “Export as PDF” on the case object and create a VF page to generate a PDF from the case object .

Thanks
Vijaykumar.S 
Sourav PSourav P
Hi Vijay
You can do as per below, In the case object go to " buttons , lists and actions" and create a new button as per below,
User-added image

Then, in the content select the visualforce page written, plz refer the below, you can modify the contents inside as per your need.

<apex:page standardController="Case" renderAs="pdf" applyBodyTag="false">
    <head>
        <style>
            body { font-family: 'Arial Unicode MS'; }
            .companyName { font: bold 30px; color: red; } 
        </style>
    </head>
    <body>
        <center>
        <h1>New Case Name!</h1>
    
        <apex:panelGrid columns="1" width="100%">
            <apex:outputText value="{!Case.CaseNumber}" styleClass="companyName"/>
            <apex:outputText value="{!NOW()}"></apex:outputText>
        </apex:panelGrid>
        </center>
    </body>
</apex:page>


Then , go to the Case object page layout and , select the created button and placed in the detailed page.

User-added image