How To Print In Php - How to print to the users printer using PHP

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

How To Print In Php - How to print to the users printer using PHP

moodsey211
I'm making a site which generates a number of reports. I want to print it to the user's printer. Any idea how can I obtain this.

Thanks in advance.

Reply

truefusion
PHP is for server side scripting, not client side. In order to achieve this, you're going to need java script:
CODE
window.print()

Reply

moodsey211
Yes, that's really one of my concerns so I'm collecting ideas on how to go around it. the javascript print function is very primitive and it shows a dialog box before printing. need something to go around this. T_T

Reply

truefusion
If the dialog box is the same one when you hit Ctrl+P on the keyboard (which i'm sure it is), then it is best if left that way. This allows users to pick the printer they want if they have more than one printer to choose from and it also allows them to modify the page margins, how many pages they want to print, etc.

Reply

moodsey211
I have two options to choose from. one is to connect to the client using a socket, or let the browser call my application. But both needs the client to install my app on their machines which has less security issues. my problem is which of the two would i choose.

Reply

truefusion
I'd go with the browser call, assuming the client can still print offline. But i am left wondering, what is the purpose of PHP here, then, if it's more related to a desktop application?

Reply

jlhaslip
One possibility might be to use the php functions to "write" a file for download and then have the client print it locally.

Reply

moodsey211
I was thinking of making php write a file and let the browser automatically call my app if ever it encounters the file created by php. But the action should be generated by php. or something like that. sounds wild. biggrin.gif

Reply

raqib
as far as i know it is not possible in php. If possible pls somebody explain the procedure.

Reply

moodsey211
QUOTE(raqib @ Jul 11 2008, 09:05 PM) *
as far as i know it is not possible in php. If possible pls somebody explain the procedure.


its possible. but you need to install something on the clients machine to be able to print to their printers. It's impossible to do it alone with just a server side script.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. how to print reports in php - 3.43 hr back. (1)
  2. print report with javascript - 4.44 hr back. (1)
  3. connect to printer php report - 11.58 hr back. (1)
  4. php report printer - 17.75 hr back. (1)
  5. connect to printer php - 17.64 hr back. (2)
  6. printing dialog "javascript print" - 18.61 hr back. (1)
  7. "print report" php code - 25.16 hr back. (1)
  8. print documents using php/javascript - 25.65 hr back. (1)
  9. php using printer - 25.70 hr back. (1)
  10. php print file printer - 46.65 hr back. (2)
  11. print reports php - 47.87 hr back. (1)
  12. php, if, print - 52.79 hr back. (1)
  13. php code for printing reports - 57.30 hr back. (1)
  14. how to print report using php coding? - 59.86 hr back. (1)
Similar Topics

Keywords : print, php, print, users, printer, php

  1. Add Users On Email Program With Php?
    (1)
  2. Script That Tracks The User Status
    how can I track on or offline users? (4)
    long explaination: hey, I'm building a user profile site right now. And, I kinda know how to
    make a online/offline detector, but not totally sure. I know I can make a mysql database to track
    them, but how does it entrer the information? I could easily put in a field where when they login it
    sets them to online, but if they don't sign out, and just exit the browser, how can I tell.
    short: I want someone to tell me how to make a online/offline status detector, like they have here
    on trap17. I'd be thrilled if you can post to this, thanks, arcticsnpr....
  3. Show Users Logged In
    Some help needed.. (5)
    I need some help if somebody can help me out please doit /smile.gif" style="vertical-align:middle"
    emoid=":)" border="0" alt="smile.gif" />.. Ok here is the thing - I have an login box (works
    perfect) and I have MySQL database (works perfect).. Now I need to make thing like a list where
    shows everyone who is logged on.. But making it I need to use the same MySQl database and the same
    login box.. Example: when your write tour Login and password and press "Log-in!" opens page
    where is list of all logged in member.. If there is ant tutorial aor scripts/codes please....
  4. Adding Users To Databases Using Phpmyadmin
    (2)
    I am running my own apache server with PHP and MySQL, with phpMyAdmin on my own computer, to test
    things locally. I know how to create databases and how to create users, but how can I add a user to
    a database?....
  5. Users Online Script In Php
    how do i get one? (7)
    I've been seeing a whole bunch of sites that have a Statistics corner, and in there, there are
    things that says "Users Online:", "Page Loads:", "Unique Hits:", and "IP:". Well, I was wondering,
    where do these users get one of these nifty things? I know that PHPNuke offers one, but most of the
    sites that I go to do not use PHPNuke. Any reply is appreciated. /smile.gif' border='0'
    style='vertical-align:middle' alt='smile.gif' /> ....
  6. Script: Phpbb Mod, Total Users Registered
    Display the total users anywhere on your site. (1)
    This is for phpBB V2+ It displays the total number of registered users anywhere you want. This file
    is called: phpbb-totalusers.php CODE <?php /** * ©2005 Craig lloyd. All rights reserved. * *
    Mod Title:   Total Registered Users * Author:      Craig Lloyd * Description: Shows
    total number of registered users * Release:     v1.2, 10th May 2005 *** * Demo:            
       http://www.toxicsims.co.uk/ (stats box) * Installation Level:  Easy *
    Installation Time:   1 minute * Files To Edit:       This one * Included Files....
  7. Php Sessions
    Multiple users using the same login (2)
    Hi, I'm realtively new to PHP and I'm considering creating some login functionality.
    However I want a group of users to use the same loginname and password. They will be loggin infrom
    different machines. The users will know they are sharing the account. Can anyone give me an idea
    of what kind of effect this might have on my sessions? Will it create any odd hiccups or other
    strange things?....

    1. Looking for print, php, print, users, printer, php

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for print, php, print, users, printer, php

*MORE FROM TRAP17.COM*
advertisement



How To Print In Php - How to print to the users printer using PHP



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE