Guest Teza Posted October 27, 2006 Share Posted October 27, 2006 While printing a HTML, generated by PHP, (the logical structure is identified but its size is variable) it is compulsory to precise directly in the document body, the number of each printed page and the total amount of pages. i.e : Page 3 of 10. Script language PHP or JavaScript. Mozilla or Firefox as browser.Thanks for your help. Link to comment Share on other sites More sharing options...
aspnetguy Posted October 27, 2006 Share Posted October 27, 2006 When generating the html with php is there a way to count the lines as they are being printed? If so you can do a print preview in your browser and see how many lines fit on a page and adjust your php to insert a CSS page break at the correct position and place the Page 3 of 10 just before the page break.This can be tricky and due some options the browser gives the user it is not 100% fool-proof. Link to comment Share on other sites More sharing options...
jesh Posted October 27, 2006 Share Posted October 27, 2006 ...insert a CSS page break at the correct position...hah! I didn't realize there was page break functionality in CSS. Does what is described on this page (http://www.w3schools.com/css/css_ref_print.asp) really work in current browsers? Anyone have any luck with it? Link to comment Share on other sites More sharing options...
aspnetguy Posted October 27, 2006 Share Posted October 27, 2006 I have use page-break-after before and it worked well, although it only had to work in IE.Not sure if that attribute works the same across all browsers. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 27, 2006 Share Posted October 27, 2006 Yeah, I've used that type of thing before. It works fairly well. The most important thing is to get the page to be a static width, so I wrapped everything in a table with a set width. That way it will be predictable on most people's setups. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now