I have a Visualforce page that I need to be paginated. I followed the guide at http://wiki.developerforce.com/page/Creating_Professional_PDF_Documents_with_CSS_and_Visualforce and have verified that it generates the proper HTML. However, I cannot render the page as PDF because it references web resources that require authentication.

The HTML that Salesforce embeds into the iframe works as intended (I verified this by putting it into a simple HTML file and printing) but the encapsulating page breaks the pagination. Going by W3School's article on page-break I suspect it is styling on the outer CSS that is causing the trouble.

Is there anyway to get Salesforce to display a VF page directly, and not in an iframe? If not, what is the best way to solve this problem? Do I need to use JavaScript to just apply style="float:none;" recursively up the DOM?

  • Do you want to page break for Printing? Commented Jan 4, 2013 at 21:18
  • Yes, the page needs clean breaks without Accounts spanning multiple pages for printing purposes.
    – Mike Chale
    Commented Jan 4, 2013 at 21:53

2 Answers 2


If you have the development mode footer on then there will be an iframe involved.

<apex:page showHeader="false" sidebar="false">
     <h1>My Page</h1>
     <p>Here is some introductory information</p>

That gets served by Salesforce to your browser in a page that contains the development mode footer framework in addition to the actual VF page and there's an iframe involved.

<iframe frameborder="0" id="contentPane" name="contentPane" 
   onload="initContentFrame('https://c.na14.visual.force.com/apex/testPage?core.apexpages.devmode.url=1', true, false);" 
   style="width: 100%; height: 100%" 
   title="Content Pane"></iframe>

You can turn off the development mode footer either through your user profile or just clicking the "Disable Development Mode" icon which looks like a circle with an 'X' on the upper right corner of the footer. Then bring up your page again it will not contain an iframe, because the development mode footer / environment part will be gone.

I have implemented VF pdfs with the page-break-inside:avoid (different than what you are doing) without any issues, but I haven't attempted it in non pdf VF pages, and it looks like it wouldn't have worked for me because browser support is questionable, outside of opera.

  • Turned off Development Mode and it worked like a charm.
    – Mike Chale
    Commented Jan 7, 2013 at 12:20

Where are you representing the VF page? Pages can be accessed directly via /apex/{PageName} without an iframe, if that is what you mean - and standardStyleSheets/headers to false should revert any existing CSS.

  • The page is launched from a Detail Button on a custom object's layout. I've tried having it open in the same window and a new window.
    – Mike Chale
    Commented Jan 4, 2013 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .