Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is it possible to render a VF page as a PDF inside the same page in specific section ? for example I have page with the following hierarchy, And the PDF will display in the second pageblock, is there iframe or something can use ? or using VF components ? or including VF page ?

<apex:page>
     <apex:pageBlock title="Select Account">
          // here the select options for available accounts.
     </apex:pageBlock>
     <apex:pageBlock title="Account Information">
          // reRenderAs PDF here with account info, according to the selected Account.
     </apex:pageBlock>
</apex:page>
share|improve this question

1 Answer 1

up vote 3 down vote accepted

I just tested this and it's some what possible, but very limited. It will involve you separating the components you want to render to different visualforce pages. The code is shown below, but please keep in mind, this is very limited. For example, if you are running any sort of logic after your constructor, rerender, etc, it will not display the changes. This will only display what ever is done at the time your page loads / constructor runs.

Apex VF page Test1:

<apex:page standardController="Account" >
    <apex:detail relatedList="false" title="false"/>
    <iframe src="/apex/Test2?id={!Account.Id}" height="800px" width="800px"/>
</apex:page>

Apex VF page Test2:

<apex:page standardController="Account" renderAs="pdf" >
    <apex:pageBlock>
        <apex:pageBlockSection>
            <apex:outputField value="{!Account.Name}" />
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
share|improve this answer
    
But, I'm using reRender ! I'll try to set id as a parameter in the url –  user3003810 Mar 3 at 17:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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