How to create a PDF page

Hello everyone!

Today we will learn how to create a PDF page in Salesforce!
Imagine for a minute that, after choosing Salesforce to better manage your business, your HR  Dpt needs to extract a candidate’s information as a PDF. Knowing it is not part of the standard functionality of Salesforce, how will you do?
We will proceed in two steps
1) Creation of a Visualforce page
2) Creation of static resource page

This is your Applicant detail page


Here your PDF page you wish to have!

1) Creation of a Visualforce page

<apex:page standardController = ″Applicant__c″ RENDerAs = ″PDF″ >

<apex:image id=″popo″ value = ″{!$Resource.toto}″ width = ″100″ /><br/><br/>

<apex:stylesheet value = ″{!$Resource.logo}″/>

<apex:form >

<apex:pageBlock >

<!– Fields –>
<h2> Détails Applicant</h2>


<apex:pageBlockSection columns =″1″ >
{!Applicant__c.Profile__c} &nbsp;&nbsp; <br/><br/>
<b>Address:</b> {!Applicant__c.Address__c} &nbsp;&nbsp; <br/><br/>
<b>Phone:</b> {!Applicant__c.Phone__c} &nbsp;&nbsp;<br/><br/>

<b>Nom:</b> {!Applicant__c.Name} &nbsp;&nbsp; <br/><br/>

<b>Salary Requirements:</b> {!Applicant__c.Salary_Requirements__c} &nbsp;&nbsp; <br/>

<th>Product Manager </th>
<th> Consultant </th>
<td>{!Applicant__c.second_experience__c }</td>

<td> {!Applicant__c.First_Experience__c }</td>



<apex:pageBlockSection columns = ″1″ showHeader = ″true″ >

<b> Previous Experience: </b> {!Applicant__c.Previous_Experience__c }<br/>
<b> Education: </b> {!Applicant__c.Education__c}&nbsp;&nbsp;<br/>
<apex:pageBlockSection columns = ″4″ showHeader = ″true″ >
<b>Languages:</b> {!Applicant__c.Languages__c} <br/>
<b>Interests:</b> {!Applicant__c.Interests__c}


2) Creation of static resource page

For the beautiful look at your page PDF, create resource static!

body { font-family: Arial Unicode MS;background-color:Aqua;}

h1 { color:Maroon;}
h2 {text-align: center; margin: 0; font-size: 1.5em; font-weight: normal;background-color:Maroon; color:white;}

After do the two steps, you will obtain your PDF page and add your visualforce page in bouton impression.

Leave a Reply

Your email address will not be published. Required fields are marked *