Solved

Print Friendly Page

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now