window.print() not printing multiple pages

Posted on 2012-09-13
Last Modified: 2012-09-19
I am trying to print a document using window.print().  My problem is that it is only printing one page.  What do I need to do to have it print the entire document?  Also, what is the best way to ensure that parts of the document are not split across multiple pages?  Is using the style page-break-before and page-break-after the best solution?  Can I use this same style when creating PDF documents for keeping text together?

Thank you for your help
Question by:WestCoast_BC
    LVL 19

    Expert Comment

    Window.print() opens the printing configuration window, there you can select if you want to print one page or all the content. Check that your printing configuration is correct.

    page-break-after and page-break-before are the best solution to keep content together during html printing. For PDFs it really depends of how are you creating the PDF, but probably it only will work if you are converting your HTML.

    Accepted Solution

    I finally figured out.  By mistake a

    Open in new window

    block of code was added to the page at the top before the following:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">

    Open in new window

    This caused only one page to be printed.

    Author Closing Comment

    I hope I have described the solution to my problem

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now