www.webdeveloper.com
Results 1 to 5 of 5

Thread: Printing a .RTF File With PHP

  1. #1
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063

    Printing a .RTF File With PHP

    How would I go about setting up a link/button which, when clicked, it printed out one of my rules list, which I have not only as a page on my website, but also as a .RTF file on my server? I want it to print out the .RTF file.

  2. #2
    Join Date
    May 2008
    Location
    Bangor, ME USA
    Posts
    41
    Code:
    <?php 
    echo '<a href="location of the ruleslist.rtf">
    <img src="location of the image to use as the button" alt="noloadimg desc" title="desc of image or like click Here for the rules" width="imgsizewide" height="imgsizehigh" /></a>' 
    ?>
    The above will open the RTF file if your visitor wants to print it they have to do it manually via a print button that is usable on the users computer when the RTF loads.

    Its like opening a PDF file Browsers use adobe acrobat reader to display the file and a new menu appears in the screen with a save and a print button.

    Browsers try to open files within the browser itself if it can read it such as html, txt, php, etc.

    When it can't, it searches for a helper program to open it, like .doc opens in MS Word on a PC, .xls opens in MS Excel on a PC etc.

    MS Word can read RTF files so as long as they have word they are ok.

    Hope this answered your question and helps
    Maine Notary Net

  3. #3
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063
    Well that's the same as setting up a file for download purposes. I know how to do that.

    There's no way to in PHP to send it straight to the printer?

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,389
    Nope: PHP runs on the server, so the only way it could print it would be to send it to a printer on the server's local network; but it has no knowledge of nor access to the user's printer. (If it did, imagine the annoying things hackers could do to make your printer use up paper and ink. )
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063
    Hmm. All right, thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles