Solved

Print Friendly Page

Posted on 2003-10-21
3
145 Views
Last Modified: 2010-04-09
I'm working on an Ecards application using ASP and I'm trying to create a print friendly page.  I have very little experience with the print aspect of development and I'm trying to get it so that when the user clicks 'print' the page prints out with two inch margins and doesn't show the buttons at the bottom of the page.  

Thanks in advance,

N
0
Comment
Question by:stretch73
[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
3 Comments
 
LVL 31

Accepted Solution

by:
seanpowell earned 200 total points
ID: 9591491
There's potentially a lot of issues here, so I'll start with giving you two basics that should get you in the right direction.

1. You need to add a stylesheet tag in the head of your document that is only for printing, like this:

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

print.css contains:

#footerbuttons {
      display: none;
      }
      
#content {
      width: auto;
      border: 0;
      margin: 5%;
      padding: 0;
      float: none !important;
      }


2. The content that needs to be printed sits inside one div, and the buttons that you don't want printed in another, like this:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
<title>Printing</title>
</head>
<body>
<div id="content">Print Me</div>
<div id="footerbuttons">Don't Print Me</div>
</body>
</html>

Obviously this is quite basic, and not geared to your specific situation as I don't know how your page is set up. But it should give you enough to understand the printing principles when using CSS.
0
 

Author Comment

by:stretch73
ID: 9593382
Thanks much G, it was a massive help.

N
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9593401
Your welcome,
G :-)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

749 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