HI,
We are using Aspose to generate a postscript(ps) file. We are passing the filename as part of PrinterSettings object to the Aspose Document’s Print method.
Document doc = new Document(streamData)
doc.Print(printerSettings);
The ps file is being created by aspose in the temp folder. However, if the code tries to access this file after the doc.Print method is called, we get an error (occasionally) stating:
System.IO.IOException: The process cannot access the file ‘C:\Users\test\AppData\Local\Temp\epjogiz4.ps’ because it is being used by another process.
We think this is because aspose a lock on to the file it created. Can you please let us know if there is any way we can get Aspose to release the ps file?
Hi there,
Thanks for your inquiry. If you want to save document to PS file format, please use following code example.
Document doc = new Document(MyDir + "in.docx");
doc.Save(MyDir + @"Out v16.7.0.ps", SaveFormat.Ps);
UGSINonLinc:
System.IO.IOException: The process cannot access the file ‘C:\Users\test\AppData\Local\Temp\epjogiz4.ps’ because it is being used by another process.
To ensure a timely and accurate response, please attach the following resources here for testing:
- Your input Word document.
- Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.
PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.
Hi,
Thanks for your reply.
The ps file is being created by aspose in the temp folder. However, if the code tries to access this file after the doc.Print method is called, we get an error (occasionally) stating:
System.IO.IOException: The process cannot access the file ‘C:\Users\testcmsac\AppData\Local\Temp\epjogiz4.ps’ because it is being used by another process.
Unfortunately, the above error is occuring occasionally and very generic and not specific to any template.
Can you please suggest?
Hi there,
Thanks for your inquiry. It seems that you are trying to access PS file while Document.Print is under process. Your issue seems not to be related to Aspose.Words.
Unfortunately, it is difficult to say what the problem is without simplified code example. Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. We will then provide you more information about your query.