Printing From Web App Not Working 追蹤

Legacy Poster

We have been running Bartender 7.71 for years. We have a custom web app written in ASP, running on a 32 bit Windows 2003 server, in IIS. The ASP file makes a shell call to execute a Bartender command line:


Set oShell = Server.CreateObject("Wscript.Shell")

oShell.Run chr(34) & "C:\Bartender\7.71\bartend.exe" & chr(34) & " /DD /p /x /run /PRN=" & chr(34) & "\\printserver\printer" & CHR(34) & " /f=" & chr(34) & "C:\Websites\Traveler\Format\" & Label & chr(34),1,true


This works great, no problems.


Now I am trying to replace that aging server with a new 64 bit Windows 2008 R2 Server with IIS 7.5. While I was at it, I downloaded the trial version of the latest BarTender which I plan to buy it everything works out. I installed the new BarTender and tried the same command line (the path to the new exe was different, all else was the same) but it failed.


The command line, run directly in a command prompt on the server works perfectly.

"C:\Bartender\BarTenderSuite\bartend.exe" /DD /p /x /run /PRN="\\printserver\printer" /f="C:\Websites\Traveler\Format\36088222.BTW"

But running it from the webapp does not print. Here is the error from Event Viewer


Faulting application name: bartend.exe, version:, time stamp: 0x510714bd
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
Exception code: 0xe0434f4d
Fault offset: 0x0000c41f
Faulting process id: 0xc34
Faulting application start time: 0x01ce6d1658c50472
Faulting application path: C:\Bartender\BarTenderSuite\bartend.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 981515c2-d909-11e2-a405-782bcb78eaf6

2 意見

Domingo Rodriguez
評論操作 永久連結

When you start BarTender via your web based application, is the bartend.exe process started under a service context? Is it maybe a permission problem while running under this account?


Out of curiosity, do you know that BarTender (in the Enterprise Automation Edition) has a closed web based solution called BarTender Web Print Server?


Also, using our .NET Print Server SDKs, you can implement a custom web based solution which makes use of BarTender engines in the background:

Legacy Poster
評論操作 永久連結

Yes I think it is a permissions issue.  I am having the same problem.

I had it fixed and it broke again.

I was able to "PrintLabel" and I had the web app create a new bartender application in memory.

Then it used the bartenderFormat.PrintOut(false, false) command.

I had to set the Application Pool's identity to one that has permissions to run the bartender application locally on the server.

We have Windows 2008 server running IIS7.


Usually service accounts have restricted I/O permissions due to hackers and security issues.  That may be why you are unable to print with the web application running as the built-in WebAppUser.


Try this in the website configuration:

Select "Advanced Settings", and Physical Path Credentials.

Enter a "Specific User" credentials instead of ""Pass-Through Authentication".


I think that is the fix.  I am testing it now as soon as I figure out why it won't takes the password.

For the application pool, create a new one that has permissions to the File I/O and other system resources.

Do that by setting the Application Pool's identity to one that an do the above.


Finally in the web config file you can try the "Identity.Impersonate" setting.  I think it is under the security node.