Solved

Print Friendly Page

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
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).

770 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