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
Chad CoffeyChad Coffey 

Render Page as PDF but Change Title at the Top of Page

Hello, 

I am trying to render a custom object as a PDF and I have that working, however I want to replace the Title of the Object with something different, so our users can print the page off as a PDF and take on meetings.  Currently the pages Title is the title of the Object, and that title can be misleading if a Client notices.  Any help would be greatly appreacited!

Here is my Visualforce code I have put in a custom button:

<apex:page standardController="Challenger_Sales_Teaching_Agenda__c" renderAs="pdf">
 <apex:detail Relatedlist="false"  />
</apex:page>
Best Answer chosen by Chad Coffey
Shruti SShruti S
I am sorry to say but unfortunately it is not possible to do so. But it can be done this way -
User-added image

The code to achieve this is as below -
<apex:page standardController="Challenger_Sales_Teaching_Agenda__c" renderAs="pdf">
    <h1>{!Challenger_Sales_Teaching_Agenda__c.Name}</h1><hr/>
    <apex:detail relatedList="false"/>
</apex:page>
Here is what I have done, I have put a <h1> and a <hr> tag to bring a heading and a horizontal rule. Heading is nothing but the record name itself. Doing so the emphasis becomes on the record name now. Unlike before, when the emphasis was on the "Lead Detail". So now the confusions can be avoided.

All Answers

Shruti SShruti S
I am sorry to say but unfortunately it is not possible to do so. But it can be done this way -
User-added image

The code to achieve this is as below -
<apex:page standardController="Challenger_Sales_Teaching_Agenda__c" renderAs="pdf">
    <h1>{!Challenger_Sales_Teaching_Agenda__c.Name}</h1><hr/>
    <apex:detail relatedList="false"/>
</apex:page>
Here is what I have done, I have put a <h1> and a <hr> tag to bring a heading and a horizontal rule. Heading is nothing but the record name itself. Doing so the emphasis becomes on the record name now. Unlike before, when the emphasis was on the "Lead Detail". So now the confusions can be avoided.
This was selected as the best answer
Mustafa JhabuawalaMustafa Jhabuawala
Exactly!!!

As Shruti pointed out, we won't be able to alter the standard detail layout. But we can add a wrapper around that.