views:

30

answers:

1

hi!

I've a php file which'll run a SQL script and fetch information about users.

Some user's information may span 2 or 3 pages while some might end in just 1.

I want to print the beginning of ever user's report in a new page. All these process has to be automated because there are some 400 users, and the client can't select page layout for every user or print them individually.

How can i achieve this? using PHP or Javascript? Is there any library to do this?

Thanks :)

+2  A: 

Your question was a little confusing, but now I think you're talking about doing page breaks in a print.css? If so you can use: page-break-before and page-break-after in your CSS.

So using CSS you would do something like:

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

Where your page was contained in:

<div class="pagecontainer">page content here</div>

If you're just trying to figure out pagination. Take a look at this php solution.

You can also do completely client side pagination as mentioned in this question and this question.

jjclarkson
hmmm..i'm not looking for paginations..
jest
oh! Perhaps you're looking for the css to do a page break? Take a look at page-break-after: always;
jjclarkson
thanks :) exactly what i was looking for
jest