Why does XpdfPrint fail when used on a server?

Applies to: XpdfPrint

When XpdfPrint is used on a server (IIS with ASP or ASP.net, or similar), you may get errors from XpdfPrint's printPDF / printPDF2 / printPDF3 / printPDF4 functions: specifically the errBadPrinter or errPrinting error codes. (The numeric error codes are 0x80040206 and 0x80040207, and Visual Studio may display the error message "An unexpected internal error was detected" or "The owner SID on a per-user subscription doesn't exist".)

These errors are almost always due to permission settings on your server. First, make sure that the user account has permission to print to the desired printer(s). Second, you may need to change the account under which XpdfPrint runs:

  1. In the Control Panel, select "Administrative Tools", then "Component Services".

  2. Under the "Component Services" entry, select "Computers" -> "My Computer" -> "COM+ Applications". Right-click on "COM+ Applications" and select "New" -> "Application".

  3. In the COM+ Application Install Wizard, click on "Create an empty application".

  4. Name the application "XpdfPrint", with Activation Type "Server application".

  5. On the next screen, select "This user", and then specify a user account to run XpdfPrint. Make sure the user has permission to access the printer(s).

  6. On the final screen, click "Finish".

  7. Back in the Component Services window, you should have a new COM+ application called "XpdfPrint". Under that, right-click on "Components" -> "New".

  8. In the COM+ Component Install Wizard, click on "Install new component(s)". Locate XpdfPrint.dll (not XpdfPrintNet.dll) and double-click on it (or click "Open").

  9. On the following screen, just click "Next", then click "Finish".

(This procedure applies to Windows 2000, Windows XP, and Windows 2003.)