Cannot Access .prn File Error When Printing From Client フォローする

0
Avatar
Legacy Poster

On Windows Server 2012, there's an intermittent error when customers try to print from the client. The error is:

"The process cannot access the file [flle path] because it is being used by another process."

Any idea what could be causing this error? At least sometimes if the customer re-tries printing a couple times, the barcode will eventually print.

As a corollary, is there a way to print from the client that does not use a prn file?

Thanks!

5 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

What version of BarTender is in use?  How are you printing (BarTender/Print Station/some form of automation)?  What is the file in question?  Is it a print file name that you wish to output the native printer code to instead of printing directly?  or is it a data file of some sort that contains the record data that you wish to source for printing onto labels? 

0
Avatar
Legacy Poster
コメントアクション Permalink

Hi, thanks for replying

 

All the customers that we're aware of that are having this issue are using Bartender 10.1.  We know for certain that the customers that we're hosting on our WIndows Server 2012 are having this issue, and believe that the customers with their own installs that are having this issue are also using Server 2012 .  In the case of our hosted customers, we're hosting multiple customer website on the 2012 server, each with their own application directory and iis web site.

 

The file is the temporary .prn file that is output to a Temp directory in preparation for printing on a client printer.  What we're trying to do is have the barcode print to a printer that is hooked up to computer from which our website is being accessed.  So, a customer logs into the website from one of their local computers, selects an item, and wants to print the barcode for that item to the printer attached to their local computer.  The way I understood the sample  code, called "printing on the client" and the sample code for that involves the creation of a .prn file on the server with the code:

 

labelFormat.PrintSetup.PrintToFileName = System.IO.Path.Combine(tempFullPath, Guid.NewGuid().ToString() + ".prn");

 

before sending its contents to the client via the _hiddenClientPrintCode control in the TaskPrint_Succeeded callback:

 

    void TaskPrint_Succeeded(object sender, TaskEventArgs e)
    {
        PrintLabelFormatTask taskPrint = sender as PrintLabelFormatTask;
 
        if (taskPrint != null)
        {
            _hiddenClientPrintCode.Value = taskPrint.PrintCode;
 
            string printerName = JavaScriptSupport.EscapeSpecialCharacters(_listPrintersClient.LastPrinterName);
            Page.ClientScript.RegisterStartupScript(GetType(), "SampleClientPrint", string.Format("SampleClientPrint('{0}','{1}','{2}','{3}');", printerName, _hiddenClientPrintCode.ClientID, _alert.MessageClientID, _alert.PanelClientID), true);
        }
    }
 
 
If there's a way to avoid the creation and use of the .prn file and still print to client the way I described, I suspect this would address the problem.
 
Since only Server 2012 users seem to be affected, I'm not sure if there's some I/O process unique to 2012 that could be blocking access to the .prn file after it's created, or if something else is going on.
 
Thanks!
0
Avatar
Legacy Poster
コメントアクション Permalink

Hi Ian;

 

Wondered if you have any additional input on this given the information I supplied.

 

Thanks!

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

I assume you're trying to perform internet printing using the web printing example as part of the .NET SDK.  This printing process involves the server side generating a print job to file which is then encrypted (with a printer license as the key), and encoded into base64 and embedded into the response document that is sent back to the client browser.  the browser installed plugin will then extract the embedded print job, decrypt it, and then send it out to the specified print queue/port as originally requested.  The generation of the prn file on the server side is thus part of the process and cannot be avoided.

 

As to the problem itself; I don't have an answer for you myself.  I suggest you contact technical support for assistance unless anyone else here can help.

0
Avatar
Legacy Poster
コメントアクション Permalink

Hi Ian;

 

Thanks for the reply =)  I've opened a support ticket regarding the error messages I'm getting.

サインインしてコメントを残してください。