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
Chiru GChiru G 

How to convert the half of the visualforce page into pdf?

For full visuaforce page we can use renderas attribute..then how to convert the half of the visualforce page into pdf?please give answer with code..

ManjunathManjunath
HI,
I don't believe we can do that. Since renderas is an attribute of apex:page tag and you cannot have apex:page inside the apex:page tag nor can you have 2 apex:page tag in VF page .

Regards,
ManjunathManjunath

Where as you can create 2 vf page. For one VF page use renderas pdf. Using apex:iframe add this VF page into the second VF. Hope this help.

 

Regards,

 

 

 

asish1989asish1989

Hi 

This is the code you can refer for your need .

<apex:page standardController="Contact"> 
    
        <apex:pageBlock>
        <apex:form>
        <apex:pageBlockSection>
        
            <apex:inputfield value = "{!Contact.LastName}" />
             <apex:inputfield value = "{!Contact.Email}" />
              <apex:inputfield value = "{!Contact.Phone}" />
               
       </apex:pageBlockSection>        
        </apex:form>
        </apex:pageBlock>
        <apex:pageBlock>
           <apex:iframe scrolling="true" height="200" src="https://c.ap1.visual.force.com/apex/ForumTest"/>
        
        
        </apex:pageBlock>
    
</apex:page>

 This the Page which is converted into pdf 

<apex:page controller="ForumTestController" renderAs="pdf">
    <apex:form >
       <apex:pageBlock>
            Here You will write Your code which will be converted in to pdf ...
       <apex:pageBlock>
  </apex:form >
  </apex:page>

    Did this post answers your questions If so please mark it as solutions ans hit kudos icon 

 

 

  Thanks