views:

292

answers:

6

Hi,

This is the situation I am facing. I have developed a web application that allows users to select existing PDF files to be batch printed on selected printers.

However, in the UAT environment, we are not able to attach printers due to the risk to network security. I can arrange to install third-party software, but because of the administrative burden in arranging configuration changes, it would be preferable that the tool can be configured via the database or a simple configuration file.

Given this constraint, how can I replicate printing without the hardware, for both system testing by developers, and user acceptance testing by the customer?

I know this sounds initially appears to this question, but the solution will need to be viable for an end user, not just for developers.

I had thought of creating a printer driver that would take the PDF file and save it to a specified directory with a timestamp as part of the name. I would develop a separate application/web page available to users only on the UAT environment to monitor the contents of this directory and allow users to check the contents of the directory, i.e.select a specific filename and stream the file to the browser. This would allow the end user to check that the file(s) they had selected for printing were being passed to the specified printer.

If you can think of a better solution, please let me know. Thanks in advance.

Regards, MagicAndi.

+3  A: 

Try ImagePrinter on SourceForge, sounds exactly what what you need. Well, it'll save you writing your own printer driver to copy the files.

I think your proposed solution is a good one

Binary Worrier
Binary Worrier, ImagePrinter sounds interesting. Thanks.
MagicAndi
Binary Worrier, Thanks again for your answer, ImagePrinter was exactly what I was looking for. It is the accepted answer.
MagicAndi
+2  A: 

You can set up a Microsoft EPS printer

I used this tutorial to set it up on my laptop http://kb.iu.edu/data/ahii.html

Nathan Koop
+2  A: 

Do you have the drivers installed? Why not attach the printers to File ports? That'll route the files to disk. However, there can be only one file name, successive prints overwrite the former one. So you'd need to add a folder watcher to rename the files immediately after printing.

What do you mean by the solution has to be viable for end-users? Why do you think your users can't use a File port? Print-to-file is another solution obviously.

I don't see why you need to write a driver. The RedMon port monitor can probably be tailored to generate those timestamped files in a directory of your choice.

dirkgently
DirkGently, I have looked into using the Print To File option already, and ruled it out, simply because of the issues around configuring the multiple virtual printers on the UAT environment. The RedMon port monitor does look interesting, and may be a possibility.When I said viable for end users, I meant preferably transparent - if an end user is performing acceptance testing on the UAT environment, they shouldn't need to be concerned with the printer configuration.
MagicAndi
And thanks for answering. Much appreciated.
MagicAndi
So, is your app independent of the target devices (and hence drivers)? In that case, I don't see you have much of a choice. I have seen some products install a vritual driver that you print to which then brings up the list of the actual printers, but these products suck. I don't see much that can be done if you have no control on the printers/drivers. Please clarify.
dirkgently
The application requires simply the printer name in order to print the document. As stated previously, the issue is that I need a way of outputting the file the application has sent to the printer queue where there is no physical printer.
MagicAndi
I think your problem is not with the drivers but their configurations. Is this correct? Typically, drivers control the target (device/file on disk/network folder etc) via the (highly configurable) port parameter. Applications can only print to file or the rely on the device for transport. Curious: How do you think ImagePrinter will help in this case? It's another driver.
dirkgently
DirkGently, apologies, I wasn't clear enough in my original question. The reason that the physical printers are not allowed to be installed is because of the possible risks to network security. I can install drivers, services, etc, but because of the administrative burden in arranging configuration changes to applications in the corporate environment, it is preferable that I can configure any solution via the database, or at least a configuration file. I hope this clears up any confusion.
MagicAndi
One thing, Print-to-file is a runtime setting -- this is the least damaging of configurations. Changing ports may disallow users to print as they wish to existing devices.
dirkgently
DirkGently, Thanks for replies, +1.
MagicAndi
+2  A: 

If it is Windows there are several utilities like PDFCreator which create virtual printers that allow you to print to PDF.

I believe linux has such utilities too, but I can't name them.

BubbaT
These can also be configured to do stuff like putting the file into the user's home directory without any prompting, making it possible to do this on a remote server as long as the app impersonates the user...
Oskar Duveborn
BubbaT, Thanks, tried out PDFCreator, and it is another possibility. +1.
MagicAndi
A: 

Download http://www.dopdf.com/ Its free and it installs a virtual printer that creates PDFs.

Greetings

Cesar
A: 

Would the MS XPS Document Writer help? This is configured as a printer on the desktop, I don't see why you couldn't set it up on the server too.

Steve Haigh