designing a page to print

  waydekirrane 13:31 28 Jul 2004

what's the best way to design a page that when printed through ie or mozilla will come out solely on 1 A4 piece of paper
thanks in advance

  Taran 14:50 28 Jul 2004

There is no 'best' way but there are a few that work well.

My own preference is for a PHP or ASP script which can be set to print various elements of the page.

Try click here for a pretty good example. It has a lot of options to allow you to set what you like for the printable output. Of course it will only work if you have PHP support offered by your web host.

I dislike the JavaScript options since they are less reliable (browser variations or just not having JavaScript support enabled or even installed), but I've never had an issue with a PHP or ASP script performing this task for me.

  waydekirrane 15:45 28 Jul 2004

but it doesn't work
i get a page saying this page needs a direct link...or something like that. it's in the faqs and i tried everything it said and got the same answer. any other ideas?

  Taran 22:06 28 Jul 2004

I meant that link as an example and I have set it up to work perfectly on one of my own servers this evening after reading that you had experienced difficulties.

If you want to try alternatives along a similar line, check this link out:

click here

Another alternative is a JavaScript/CSS way of doing things:

<a href="#"

onclick="window.print ()">

Print this page</a>

That is a relatively simple JavaScript hyperlink on the page.

The CSS file that goes with it should contain this:

@media print {

/* styles for print output go here */


And obviously the CSS document should be referenced properly in the HTML page header.

Most browsers will cope with this most of the time, but you do need to know what you are doing with CSS. The beauty of using CSS for this is that you can strip out all of the junk that you don't want and also control page width and so on. You can learn more about this method click here

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 6 review

Best art and design exhibitions in 2018

MacBook Pro keyboard issues and other problems

E3 2018 : dates, conférences de presse, billets et plus