开发者

Whether is it possible to indicate the printer to next page in php?

开发者 https://www.devze.com 2023-01-06 07:43 出处:网络
I am using php language.I project i have the application to be print,It contain two pages.According to the data available the page content may be change, so printout of first page end and second page

I am using php language. I project i have the application to be print, It contain two pages. According to the data available the page content may be change, so printout of first page end and second page starting content not to be proper.

So i want to know any other way is there, to separate the specific content to be printed from the second 开发者_运维问答page ?


You can't do it using PHP (it just outputs data), but CSS has an attribute called page-break-after that you may use.

#someElement {
    page-break-after: always;
}

There are also page-break-before and page-break-inside. See http://www.w3.org/TR/CSS2/page.html#page-break-props for more information.


PHP cannot print, you must use Javascript for this. You can separate printable/not printable areas in a certain page with custom CSS linked with media="print" attribute.


Assuming it's a web page that's being printed, look at the CSS page-break-before attribute.

pagebreak


I applied all the css method, but not get proper solution. I manually calculated and left the space for this depending on the condition. So i solve this problem with correct result.

Thanks for everyone those who guide and answer for this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号