2

I'm trying to submit a postscript print job directly to printer on port 9100. I tried submitting a form directly to the IP and port, but it includes a lot of header information which obviously messes it up.

Is there a way to do this with jQuery or AJAX (or some other term I don't know about)?

Charles
  • 21
  • 1
  • 1
    The answer is probably going to be no, but you never know - it will be interesting to see what comes up. What browsers does this need to work with? Is building a browser extension an option? – Pekka Mar 28 '11 at 21:56
  • Where is the Postscript file itself? How do you know that the client browser can actually access the printer? – Pointy Mar 28 '11 at 22:17
  • interesting question, voted +1 – Scherbius.com Mar 29 '11 at 15:43

2 Answers2

0

You can't do it with Javascript, it'll only do HTTP requests (e.g. POST/GET), which means you get the full HTTP headers included.

Once WebSockets get more widespread, you could use those and send arbitrary data without the HTTP overhead/payload, but at present, that's only in 'bleeding edge' browsers.

This means you're stuck using a Flash or Java applet at present.

Marc B
  • 356,200
  • 43
  • 426
  • 500
0

You can create a proxy php script which will accept your POST data from the form, format this data and send it to the printer

If you'd like to submit data to this script in background - please see my answer to the following post:
JavaScript: How do I create JSONP?

Community
  • 1
  • 1
Scherbius.com
  • 3,396
  • 4
  • 24
  • 44