I have to skip the content of vf page (renderAs=pdf) to the next page whenever page body found <<next page>>. Below is my requirement: -

The first(left) page should be split in two pages as shown below. Content below <<skip content>> should be moved in next page

Any assistance to achieve this would be greatly appreciated. Thanks!!

  • I have the same requirement too. Waiting for the answer. – user3627953 Nov 8 '14 at 20:08

I'm not clear whether <<skip content>> is something you actually output or not.

Outputting this instead:

<div style="page-break-after: always"/>

would move the following content to a new page via CSS. See e.g. How to render Multiple PDFs from a single Visualforce page? for more detail.

| improve this answer | |

You can push it with CSS, for example on a div tag:

div.Ending { page-break-after: always; }

There's a suggested reference I found somewhere in Salesforce help which covers most of the things the PDF engine can do, including page breaks, page numbering, margins, headers, footers, etc. even internal page linking and index generation.

It has really helped me out with some tricky form generation. It's all controlled through an external style sheet and css. See this link:

Introduction to page composition with CSS

| improve this answer | |

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.