0

I need to send a file to a local workstations default printer, but I do not want the user to have to interact with downloading it or deal with a popup. The interface is a local web intranet webpage.

<select name=”s-1” id=”s_1”>
<option value=”0”>Please Select…</option>
<option value =”file1.doc”>File1.doc</option>
<option value =”file2.doc”>File2.docx</option>
<option value =”file3.doc”>File3.doc</option>
</select>
<input type=”button” name=”b_1” id=”b_1” value=”Print Selected File”>

All files will be Microsoft Word .doc or .docx files. The workstations are terminals and don’t have any office products installed. I just want to send a selected file directly to the terminals default printer with either JavaScript or PHP with "onclick" or "post" events.

4
  • This is tantamount to asking for advice on how to write a virus. Sending a file to the printer appears to the computer much the same as writing a file to the hard drive. Commented Feb 17, 2015 at 15:23
  • I understand this, the printers are on the same network the local web server has access to all the same printers. Commented Feb 17, 2015 at 15:36
  • 1
    I recommend reviewing your requirements for this. Make sure there aren't any ambiguities. Are you supposed to print the file to one specific printer, regardless of who the user is? Are you expected to use the printer specified by Windows as the default? (Edge case: What happens if they've set their default printer to PDF Creator?) Would it be easier to write a script, e.g., a BAT file or BASH script, to send the file to the printer? Commented Feb 17, 2015 at 15:42
  • Very good thought Paul, I'll see if this is a viable option. Commented Feb 17, 2015 at 17:30

1 Answer 1

2

Provided that it's intranet page, can you just identify user's own printer from LDAP, etc.? Do you have print server(s) in the network? If so, send it directly from PHP to the print server. It may be tricky however to print .doc or .docx from PHP script without external calls to MS Office or LibreOffice.

If the above is not possible, try to use Java of Flash applet to print from the browser. It may be useful to convert the documents to PDF before.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, most all printers are IP based and on the local network. This seems like a complicated path. I'll see what I can do. Thank you for your input.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.