function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suresh143suresh143 

How to get the current page data in pdf format once click download button in object

How  to get the current page date in pdf format once click download button in object  

 

 

Kindely Share that Code fully pls

Satish_SFDCSatish_SFDC
See if this helps.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_renderas_pdf.htm

You can create a button to redirect to another page which is rendered as pdf.

Regards,
Satish Kumar
suresh143suresh143

Hi Shatish

 

 

I am asking about Data converted in pdf format once click that Button Account object level

RockzzRockzz

Hi Suresh...

 

Try below Code..

 


<apex:page controller="Example" sidebar="false" action="{!fetch}" contentType="application/x-pdf/#Std.pdf" cache="false">
(or)
<apex:page controller="Example" sidebar="false" action="{!fetch}" contentType="application/pdf" cache="false">
StudentNumber : {!Student.Name}
Student Name : {!Student.Student_Name__c}
City : {!Student.City__c}
Email : {!Student.Email__c}
Description : {!Student.Description__c}
</apex:page>

=======================================================================
public class Example

    public String StudentId;
    public Details__c Student {get;set;}
  
    public Example()
    {

    }
  
    public void fetch()
    {
        StudentId = Apexpages.currentpage().getparameters().get('eid');
        emp = [SELECT Name, Student_Name__c, City__c, State__c, Email__c, Description__c FROM Details__c WHERE ID =: StudentId];
    }  

}

 

Thanks,

Cool Sfdc