Solved

Print Friendly Page

Posted on 2003-10-21
3
146 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
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