Submit Your Article Forum Rules

Results 1 to 6 of 6

Thread: Printer friendly page?

  1. #1

    Printer friendly page?

    I'm working on a site and the client wants a "printer-friendly" page link for each page. I've seen these on various sites, but I'm confused about what the parameters are.

    My site resides in a 750 px table centered on the page.

    Any suggestions?

  2. #2

    Hey there...

    As far as i know, printer friendly refers to pages which content will fit (horizontally) in one page, altho i've seen "printer friendly" pages that have a totally different 'layout'.

    Some others use PDF as printer friendly also


    Good luck
    Do you like it Uncut?
    http://www.uncutdesign.com
    ----Arnoldo "A.T" Tijerina

  3. #3
    It seems that different printers handle browser printing differently. Does anyone know about ideal pixel dimensions, fixed width vs. expandable, any scripting that makes a disference?

  4. #4
    Senior Member paulhiles's Avatar
    Join Date
    Jul 2003
    Posts
    2,073

    Horses for courses

    As you say, printer behaviour does vary somewhat... the CSS purists would most likely advocate enclosing all your page content within a flexible 100% width div element. Programmers would advise you to use scripting to select your text content from named div blocks, and hide the non-essential page elements.

    Take a look through the following threads, and then make up your own mind! :o)

    Optimize webpage for printing
    Printable Web Site

    Paul

  5. #5
    Senior Member greeneagle's Avatar
    Join Date
    Dec 2003
    Posts
    5,277
    Many developers provide "Printer Friendly" pages in "pdf" format.

    Ken
    Mountain Eagle Marketing
    Contemporary Art News
    Modern Art News

  6. #6
    Senior Member
    Join Date
    Aug 2003
    Posts
    294

    This works good

    I've used this php file and it works great.
    Just add your URL to this file and save as phprint.php and upload with your site. Add the start and stop print tags found in this file to your site and a link to this file, as in;
    Print this page

    This works great! Here's the phprint.php file.

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <?php

    /*PHPrint - This file is phprint.php
    Make any Page Printer Friendly! Version 2.0 - With error handling
    Copyright by MikeNew.Net, Notice must stay intact
    ************
    Legal: MikeNew.Net is not responsible for any damages caused
    by use of this script. (Not likely that it will. Hasn't yet.)
    This script will make your pages printer friendly.
    Optionally, it will strip images as well. (Instructions for that below)

    // After installation, you can remove text from here down to the next: 8< ---->
    // Back up/copy this file first.

    1. Save this script in the root of the site for simplicity.
    2. Place somewhere in your HTML page where you consider
    it to be the start of printer friendly content, and goes at the end
    of that same content.
    3. You place a link to phprint.php anywhere on the HTML page (preferably outside the printed content,
    like this: Print this page
    - or however you like, just as long as you link to this script. */

    // If you've already tested, you can remove the text from here up to the other: 8< ---->

    //Do you want to strip images from the printable output?
    // If no, change to "no". Otherwise, images are stripped by default.
    $stripImages = "yes";

    //what's the base domain name of your site, without trailing slash?
    // Just the domain itself, so we can fix any relative image and link problems.
    $baseURL="http://www.YOURSITE.COM";

    // That's it! No need to go below here. Upload it and test by going to yoursite.com/page.php
    // (The page containing the two tags and a link to this script)
    // -----------------------------------------------------

    $startingpoint = "";
    $endingpoint = "";
    // let's turn off any ugly errors for a sec so we can use our own if necessary...
    error_reporting(0);
    // $read = fopen($HTTP_REFERER, "rb") ... this line may work better if you're using NT and images
    $read = fopen($HTTP_REFERER, "r") or die("
    <font face=\"Verdana\">Sorry! There is no access to this file directly. You must follow a link.

    Please click your browser's back button. </font>

    <a href=\"http://miracle2.net/\"><img src=\"http://miracle2.net/i.gif\" alt=\"miracle ii\" width=\"20\" height=\"8\" border=\"0\"></a>");
    // let's turn errors back on so we can debug if necessary
    error_reporting(1);

    $value = "";
    while(!feof($read)){
    $value .= fread($read, 10000); // reduce number to save server load
    }
    fclose($read);
    $start= strpos($value, "$startingpoint");
    $finish= strpos($value, "$endingpoint");
    $length= $finish-$start;
    $value=substr($value, $start, $length);

    function i_denude($variable)
    {
    return(eregi_replace("<img src=[^>]*>", "", $variable));
    }

    function i_denudef($variable)
    {
    return(eregi_replace("<font[^>]*>", "", $variable));
    }

    $PHPrint = ("$value");

    if ($stripImages == "yes") {
    $PHPrint = i_denude("$PHPrint");
    }

    $PHPrint = i_denudef("$PHPrint");
    $PHPrint = str_replace( "</font>", "", $PHPrint );
    $PHPrint = stripslashes("$PHPrint");

    //
    echo "<base href=\"$baseURL\">";


    echo $PHPrint;
    // Next line is invisible except to Search-Engine crawlers, please don't remove. Thanks! :)
    echo "
    <a href=\"http://www.mikenew.net/\"><img src=\"http://www.mikenew.net/images/php.gif\" ";
    echo "alt=\"printer friendly pages script, php\" width=\"20\" height=\"8\" border=\"0\"></a>";
    echo "

    <font size=\"2\">This page printed from: $HTTP_REFERER</font>
    ";
    flush ();
    ?>
    Hello everyone! Newbie. Self-taught. Loves writing web-code.

Similar Threads

  1. CSS Page : Looks great in browser but not on printer
    By sparshpolly in forum Accessibility and Usability Forum
    Replies: 19
    Last Post: 04-06-2007, 01:37 AM
  2. Firefox friendly tooltips, and lightboxing a page?
    By blizeH in forum Graphics & Design Discussion Forum
    Replies: 13
    Last Post: 10-14-2006, 06:12 AM
  3. Printer Friendly Website Script
    By spenland in forum Accessibility and Usability Forum
    Replies: 14
    Last Post: 08-20-2006, 01:55 PM
  4. Buy a powerful SE friendly web page/link for £10
    By malcolm in forum Ad Space Buy and Sell
    Replies: 4
    Last Post: 05-02-2005, 03:11 AM
  5. Why aren't printer friendly pages picked up as spam?
    By littlegiant in forum Google Discussion Forum
    Replies: 13
    Last Post: 05-04-2004, 08:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •