/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@mainenotarynetJun 15.2008 — <?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
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJun 15.2008 — 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?
Copy linkTweet thisAlerts:
@NogDogJun 16.2008 — 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. :eek: )
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJun 16.2008 — Hmm. All right, thanks.
×

Success!

Help @Joseph_Witchard spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...