[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2937
  • 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
0
WestCoast_BC
Asked:
WestCoast_BC
  • 2
1 Solution
 
BardobraveCommented:
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.
0
 
WestCoast_BCAuthor Commented:
I finally figured out.  By mistake a
<style></style>

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">
<head>

Open in new window


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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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