• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3697
  • Last Modified:

window.print() not printing multiple pages

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
  • 2
1 Solution
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.
WestCoast_BCAuthor Commented:
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" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Open in new window

This caused only one page to be printed.
WestCoast_BCAuthor Commented:
I hope I have described the solution to my problem
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now