Windows 7 pro; Centos5; PHP 5; local only, not public.
I'm trying to figure out if there is a way to capture and process a print job from Quicken on a LAMP server.
In Windows, there is an option to create and configure a standard tcp/ip port. This can be set to point to a script on LAMP that process the batch and formats it into XML (needed end-result).
In the port settings are options for RAW or LPR, if that matters.
What I can't seem to wrap my head around is how to handle the data that is sent (if indeed it is being sent). I assume it would be a stream as opposed to a file; but how would PHP handle such? file_get_contents()? On what though? I don't think the stream would be $_POST...
So for giggles, here's what I've done:
- add printer (network)
- add printer using tcp/ip address or hostname
- Device type TCP/IP device
- hostname and port name set to https url of script
- Device type: Generic Network Card
- Driver: Generic / Text only
Watching netstat and checking the logs on LAMP after attempting to send a print job shows nothing of note. Am I out of my mind here?
Theoretically, if this were to work, it would save 1 maybe 2 steps for the users. Not having to print to a file then move/do something with that file is big. It would be ideal if I could set up a printer on the clients that they could print to that would handle everything.
Thanks.
edit: having a .sh, .pl, .py script to handle such would be fine as well. But I need to figure out which way is up first.
EDIT:
I found this python script: http://newcenturycomputers.net/projects/rawprintserver.html (download on right hand side; vertically). Upon installing and testing it out, it seems to be getting the file. However, every time I try to print to it, it just logs "Error: lpr returns 100" and exits.
I don't see that error in any of the files, and looking for python error code 100 doesn't help.
Perhaps someone can let me know what that error means.. OR, perhaps a python guru could just take a cursory look at the code and let me know where I can tap into the output/whichermercallit so I can start learning how to work with XML in python :)