Solved

Printer Friendly Page

Posted on 2006-07-18
4
206 Views
Last Modified: 2010-04-06
I want to generate a page that is printer friendly. What should I do?

Ideally I would like to control the number of pages with 'height' and the flow with 'width'.

Simply put i want to print out a data sheet for a product. Some data appears on the first page, some on the second. When the Next product comes up I want it to start on a new page instead of continuing at the end of the previous page.

at the very least I want to control the width so nothing gets cropped off the paper when it prints.
0
Comment
Question by:cipiWeb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
nschafer earned 125 total points
ID: 17132320
Hi cipiWeb,

A couple of suggestions here.

1. Place your content in a DIV and specify the Width of the div.  
2. To break a page use <p style="page-break-after:always;"></p>
3. If detailed formatting is an issue consider an HTML to PDF component that can work on your web server.

Hope this helps,
Neal.
0
 

Author Comment

by:cipiWeb
ID: 17132859
Thanks!
1) I was planning on using a table or div for the set width ^.^
2) How well do browsers support that?
3) I am not sure what you mean by detailed, could you elaborate? what options are you refering to?
0
 
LVL 19

Expert Comment

by:nschafer
ID: 17133080
So far as I know the page-break-after is supported by all modern browsers.

By detailed I mean that if you need complete control over the output.  Bascially this suggestion involves using a 3rd party component to convert HTML into a PDF file.  When you create the PDF file you can control page size, margins, headers, footers, orientation, and so forth.  You have pretty much complete control of the output.  The downside is that you must have a component to do this.  Depending on who is hosting your site, this may not be an option.  If you are hosting the site yourself, then it is not  a problem.  I use a product called abcPDF for this.  For more information you may visit their site at http://www.websupergoo.com/abcpdf-1.htm

Neal.
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 17133248
You can also look into using @media print do define a seperate css for printing.  
This is handy when there are things on the page (such as navigation menus) that you don't want to print.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

688 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