I have a custom object called Credits that is related to Contacts via lookup relationsihp.
I added a button in the Contact page that displays a pdf of the credits for that specific contact.
I know the apex to display a page as pdf but unsure how I can display Credits only for that contact? Do I need a controller? How do I pass the value of the contact ID to the page?
<apex:page standardController="Credits__c" showHeader="false" renderAs="pdf">
<apex:pageBlock title="Credits">
<table>
<tr>
<td width="15%"><apex:outputLabel value="Course Number: " for="coursenumber" /></td>
<td width="35%"><apex:outputField id="coursenumber" value=" {!RITT_Credits__c.Course_Number__c}"/></td>
</tr>
</table>
</apex:pageBlock>
</apex:page>