• Nice to see a wide variety of articles on the site

    Having said that, two comments.

    1. The comment earlier about "no default printer" when the user had a network printer - if ASP.NET is running under a service account it will not have network printers already established - only local printers (LPT, USB, TCP, LPR, etc) printers are, by default, available to service apps.  You'll need to do one of the following

    a) call the windows API to connect to a network printer when your app starts

    b) change the printer to print to LPTx and then issue a NET USE LPTx: \\computer\printer when your app starts

    c) run the service under a user account that you have logged on to and set up some printers

    d) Install the "Print services for Unix" on the computer that is hosting the printer (and then set the service to automatically start!) - you can then set up a TCP printer port printing to that computer - the wizard for this part will say that it cannot detect the type of network card for the printer - don't worry, choose generic   Then configure the port, change it to LPR and enter in the printer's share name.  Then the printer will be a local printer rather than a network printer and it will be available to all users on the machine - including service accounts

    The above has come in very useful when configuring terminal server environments - ensuring all users get all printers without messy scripts and ensuring that permissions on printers and PCs not in the domain do not get in the way (TCP printers don't have any permissions - no shared print queue).

    Second point....  hahahaha

    I'm not a big .NET programmer but know my way around C# pretty well (I use delphi 99% of the time) - If I had a similar requirement I would probably format my text using RTF and print it using the RichText control?  If I needed HTML syntax then I guess I could spawn explorer - wouldn't this be a lot easier???

    Full marks though for sharing the code and working out the nitty gritty stuff!