+ Start a Discussion

How to add Multiple visualforce pages and combine as single.

Hi Experts,
I have a requirement to add Multiple visualforce pages to combine as single page. This Visualforce pages are render as PDF. 
I want to create a new page like wizard where I need to display some vf pages and provide users to select the page and save. Once saved I need to attach them to record.

Kindly need inputs how can I approach.

Raj VakatiRaj Vakati
You can do it like below  using  apex:include or apex:composition

<apex:include> is used when you want to insert that page as it is in your current page. The entire contents of that page is copied in your current page.
<apex:component> is defining a component before using it. In simple words, lets say you define that ‘myValue’ component is a string type but the value to that string will be assigned in the destination page.

    <p>Test Before</p>
    <apex:include pageName="MainPage"/>
 <apex:include pageName="MainPage1"/> 
    <p>Test After</p>

Hi Raj,

Thanks for your reply. The above will make all VF pages which mentioned in include Tag as single PDF.
But I want user to select visualforcepages and renderas PDF and attach to record.
For Eg: I have 3 VF pages and user select 1 and 3 page and clicking save. Then I want to attach that 2 pages alone as a pdf in attachment object.

Kindly need your inputs.