I have created a visualforce page

<apex:page standardController="Contract__c" extensions="ContractPDFControllerExtension" sidebar="false" showHeader="false" renderAs="PDF" >
    <apex:form >
      <apex:outputtext value="{!htmlText}" escape="false" />

public with sharing class ContractPDFControllerExtension {

Public String htmlText{get;set;}
public contractPDFControllerExtension(ApexPages.StandardController controller) {
     string recordId = System.currentPagereference().getParameters().get('Id');
     List<Contract__c> contractList = [Select id, Temp_Contract__c from Contract__c where id=:recordId ];
     htmlText=EncodingUtil.Base64Decode(contractList[0].Temp_Contract__c ).toString();



I want to add this page in page layout. But getting encoded values enter image description here

How to get this VF page displayed in page layout.

1 Answer 1


You can use iframe and provide the visualforce page link.

 <apex:page STAndardController="Contract__c">
  <iframe src="https://c.ap1.visual.force.com/apex/PDFPage"></iframe>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.