CSS - Page Break When Want To Force Printer To Print Selected Page..
Hi All :
Currently i'm running in .NET platform together with VB.net and ASP. I faced a problem regarding to the PAGE BREAK html tag. The problem is when i want to print out a report, it will show with scroll bar and the report is very long. So what i have to do is to apply Page-Break-After/Before into the HTML. how am i know if the report already apply the Page Break function or not? And the only style i can use is CSS. Anyone familiar with this? It's urgent !! Hope can get anyone help asap. Regards, JeFFery Similar TutorialsI am trying to print a table withing a loop. Whenever the loop reaches class = "end" I want the printer to start a new page. Code: <div id = "texter"> <table><td></td> . . . <td class="end">sdfs</td> <td>hh</td> . . . <td class="end">kkk</td> <form> <input type="button" value="Print this page" onClick="window.print()"> </form> </table> </div> Code: @charset "utf-8"; /* CSS Document */ body { font-size: 10pt; font:Arial, Helvetica, sans-serif background-color: #FFFFFF; margin: 0; color:#000000; background-color: #FFFFFF; } #texter { width:auto; height:auto; position:absolute; top:2.6mm; left:3.9mm; background-color:#333333; } input, button { display:none;} #texter.end { page-break-after:always} THANKS I am generating a list with PHP that is going to be printed out and hung up for display. I would prefer if the following weren't printed. 1) Top Left - Page Title (I know I can have this disappear by having a blank title, but I would prefer to have one) 2) Top Right - Page URL 3) Bottom Left - Page number (ex: 1 of 2) 4) Bottom Right - Date Is there any way to print the list without these? I wasn't sure if there is some css I can use, or if this is something that the printer prints automatically. Thanks Hi All I hope i have landed in the right forum. its kind of information overload for me. Anyway Here is my question I have a HTML page with large number of text boxes and buttons. I want to print this page but without the text boxes and buttons. Is there any easy way to do it? TIA Dear all, I want to add a print icon to my pages, which would print an alternate page (a printer friendly version). I have the following code: <link href="print.php?cli_id=2" rel="alternate" media="print" /> This works fine if I use the print icon in my browser, but if I use javascript:window.print(); within the page, it seems to ignore the alternate printer friendly page. My page appears in frames, and I plan to remove the browser toolbar and replace with a custom one in the page once the application is complete. Any ideas anyone? many thanks, Mark Hello, Is it possible to create a CCS stylesheet that will not only produce a printer-friendly HTML page, but create that page in the form of columns like a newsletter? What I don't want are columns like a web page, that simply read straight down to the end of the page, giving little regard to the fact that text in column one extends to the next page before continuing to subsequent columns. I want the text to read down from the left column to the right column, and then continue to each subsequent page, always reading from the left column to the right column--just like a newsletter. I know I can use PDF, but I find those file huge and combersome, and would prefer to create this in HTML & CSS if possible. I searched this board using "printer version" & columns, and when I found nothing I searched just "printer version" and found nothing. I could search just using columns, but wading through several postings about creating columns for a screen doesn't seem productive. Thanks in advance. Angie Hi, I'd like to have each page of my website print out "scaled to fit" on regular letter-sized paper in landscape orientation. The size of the background element that all page content fits on is 950px w x 750px h. So, even if the user scaled one of the web pages onscreen, when they print it out on their inkjet, it should still print the full page, scaled to fit on the letter-sized paper. These are the steps I know to take, but I am missing some info. Can anyone help me fill in the missing steps/info? If you would keep it in bulleted (1,2,3) format that'd be easiest for me to understand (still new at web work). I really appreciate it! 1. Put this code in the head section of each html web page: <link href="print.css" rel="stylesheet" type="text/css" media="print" /> 2. Create a print.css file (What code goes in here?) 3. Link the print.css file to each html web page. 4. Upload all html web pages, and put the print.css file in the same root folder Thank you! We're having a weird problem with a print stylesheet - a little bit of the javascript menu appear on the printed over the top of the content. eg: (http://www.lawhandbook.sa.gov.au/ch10.php ) - Print Preview this page and you will see "Chapters A-Z" in the middle. This seems to happen in all browsers. We've looked into many css solutions to the issue - but to no avail - we cant make the damn thing disappear. One long winded solution is to change the stylesheet to be built dynamically - so a call to ch10.php=true would build the page differently. But this seems to defeat the purpose of using a print stylesheet in the first place. Another long winded soltuion is to change the (Rather old) menu script - but that not really an option in this case either. So my question is - What happens when a browser prints a page? Does it send anything back to the server indicating it is loading the print stylesheet instead? (eg: Some sort of request variable) Or does the client's browser simple request the CSS file and reformat the page it has already downloaded? If so I could detect this event with PHP or Javascript to not load the offending menus when the print css had been loaded Pretty Common issue.... I think... I need my div's background to go all the way down the page.... even on small pages!! Here is an example... Sign Up Page Can anyone confirm this? It seems to me that page-break-before doesn't work when printing in Landscape in IE7 (you can just look at the page preview, it does seem to work in portrait). Any thoughts for a workaround? The question is "what effect will page-break-after have on screen media"? Am I correct when I say that it will have no effect? I believe that page-break-after only affects print media, but I have poor reading comprehension and would just like to double check. Question for the CSS gurus: I have a site that is listing several steps to complete a process, and each step is displayed in a table. The problem is that IE6 (I believe my workplace uses 6, anyway) doesn't want to break it properly - at times it breaks it in the middle of the tables. I don't want to manually enter the page breaks each time (as I know I can do with page-break-xxx: always), because future updates may be done by someone who has absolutely no coding experience. Any thoughts on how to achieve what I'm looking for in IE6? Thanks! Anyone know a way to put a page break in a standard html/php webpage? I am printing invoices and need to break to another page after a certain amount of line items are listed. I have an internal document that depends on page-break-after to separate the pages when it is printed. The attribute page-break-after:always had been working just fine. Now, I've noticed it is getting ignored on some users machines that have updated to IE8. I've never seen this problem in IE7 or Firefox, and I've also seen it work at times on IE8, though rarely. For the most part, users on IE8 are getting a document that treats it as only one page and will only print that first of 14 pages. Does anyone know about problems with this attribute in IE8 and what might need to be done to fix it. Hi, I'm having a problem with Firefox and a print-friendly stylesheet. Basically, I'm printing out a load of images - 9 per page, in 3 rows of 3. After 9 images, I'm printing a <div style="page-break-after:always;"></div> However, the problem I'm getting is that the 10th image, which appears at the top left of the next page, is missing. All of the other images on the page print, apart from that one. Has anyone else had the same problem, and is there a way around it. Other threads I've Googled suggest it's a bug in CSS2, but my boss/client won't accept that as an answer! Thanks in advance, Psycle is there a way to check if a page-break is going to happen? ex: if i print a long document that takes up 2 pages... i want to knwo where a page break will occur... Hi all.. I been tried to put page break function inside <div> tag but it still can't take any effect. Am i correct or any others idea? And when i put in page break function and want to print page 2, but it'll also print out some page 1 table field. I am trying to create a printable address book. The output is in the following format, with more tables for each entry: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Header Test</title> <link rel="stylesheet" type="text/css" href="documents/directory/style.css" /> </head> <body> <h1>Stanley Road Baptist Church</h1> <h2>Address Book 2005</h2> <div class="pagebreak"></div> <table> <tr> <th colspan="2"> Joan Facer </th> </tr> <tr> <td> Abbeystead<br />New Road<br />Lancaster<br />Lancashire </td> <td> </td> </tr> <tr> <td colspan="2"> <hr /> </td> </tr> </table> <table> <tr> <th colspan="2"> Matt Fletcher </th> </tr> <tr> <td> 6 Baycliffe Crescent<br />Morecambe<br />Lancashire<br />LA4 4EQ </td> <td> 01524 426559<br /> matt@1stmorecambe.net<br /> 07792 148897 </td> </tr> <tr> <td colspan="2"> <hr /> </td> </tr> </table> </body> </html> I am trying to make it so that it never breaks the page in the middle of an entry, but it will not play ball. I am using the following CSS declaration to get the effect: Code: table { page-break-inside:avoid; } But it isn't working at all. Any suggestions? I have a report that prints a list o people and a select box that will run the same list in a form format (all on one page) so that the user can print this off and get one form per page. I am using page-break after always as part of a div that contains the info to be printed (this is a loop from a db query). On my printer and a few others it works like a charm, but I have a user that gets the first page (first loop) no problem, but after that he gets parts of the pages when he prints (they display fine on the screen in the browser - IE6). Some pages come out with half the info (the bottom half is missing. Anyone ever hear of this issue? He is using WinXP IE 6 Printer is HP 855 (or something like that) I have a long list of paragraphs (no more than 10 lines each), dynamically placed on a page. I am trying to avoid breaking paragraphs when the user prints the page. <p style="page-break-inside: avoid;"> <?php do { Paragraphs from Mysql } while ($row_data=mysql_fetch_assoc($data); </p> This is not working. Paragraphs are splited in two pages. Thanks in advance for any help Is there any way to force a background color to print in all browsers or at least IE & FF? In the past I have just used an actual image; instead of a background color, but I was wondering if there was a 100% sure way to do this. I tried using media="print" and !import - neither of these worked. So if there is a will, place let me know the way. |