Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing without Printer definitions

Status
Not open for further replies.

klamerus

Programmer
Jun 23, 2003
71
US
Is it possible to print without creating a Windows printer on a server.

Situation:

We have an application that turns data into PDF documents and in later steps prints to printers via 2 steps. Step 1, is we use the PDF libraries to create a PS or PCL file from the PDF. Step 2 is we open a network printer UNC (\\servername\printername) in binary write mote and copy the data from the PS or PCL directly to that in binary mode.

We would like to simply print to a network UNC specification and not do this interim step, but the printers we need to print to are many and aren't known in advance. This info is passed to our application by the applications that need this service (mainly SAP).

Is it possible to simply substitute a UNC specification like we have above for a printer even if that printer has not yet been defined on our server and have the data actually sent to it?
 
We had a situation somewhat like this; our application used either the Kodak Imageviewer(2000) or the generic imageviewer(XP) to print a .tiff file that comes in via a secure file transfer program.

What makes this dicey is this: printers aren't associated with machines, they are associated with users. So the application will only recognize the printers that are installed for the user that the program runs as.

If you have a generic system account that the program runs as, you can (via a script or any code) dynamically insert the printer into the registry as the default printer for that account before the printing occurs. It's actually very easy, and it works.

The other big problem is that when you are printing to foreign/unknown printers directly from the box, you may need drivers to make it work. We have had success with setting up UNIX-style LPD/LPR daemons on WIndows servers (comes with Windows-- "add components"), and then porting our print jobs to that service. That one took a few trys to get right, and you may need to download a few things, but it also works well.

Hope this helps.

-Tom

"I would rather have a free bottle in front of me, than a pre-frontal lobotomy..."

-Shrubble
 
I may not have been clear here. This is entirely a back-office situation and our application is running as a service on our Windows 2000 server, so our program is running under a privileged server-side account.

We do need to have all the proper printer drives, so we expect that'll take some thinking. We have a list of all the printers used year-to-date. There are probably only 20 models in the entire list (there were 400-500 total printers though, so you can see why we don't want to define all these - and they'd change anyway).

I hadn't thought about creating a printer dynamically just so that we can use it. That seems like a lot of overhead.
 
Actually it's trivial. If you know the name and location of the printer at go-time, you can pass it to a VBScript to pop it in the privileged user's profile real quick, and then remove it (if needed) when it's finished.

If you have 400-500 printers, the LPD/LPR solution may be the way to go. I know it sounds weird, but believe me, we went through a very similar situation and were at our wits end.

To try the LPD/LPR setup, you would have to make sure that the print job exits the server using the Adobe PostScript format (driver freely downloadable), and that the printers that you port it to (via IP) are PostScript ready; most newer networkable printers are. If you don't use the PostScript format, the LPD/LPR job will print out binary garbage.

If you like I can dig up some good config links for you. It costs nothing to try, and I'd be willing to bet you would be happy with the final product.

Anyway, just trying to help. Good luck!

-Tom

"I would rather have a free bottle in front of me, than a pre-frontal lobotomy..."

-Shrubble
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top