We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to close a file after we print it using Aspose.Words.Document object Print()

Hi All
My Name is Hari, now developing an application which is using Aspose.Word.Document object to convert a doc file to PRN file.
I am using void Document.Print(System.Drawing.Printing.PrinterSettings printerSettings) method to convert the doc file to PRN file.
This process will be done in a loop after I create the PRN file another process will pick that and do the next logic.
I am getting File is used by another process IOExpection while accessing the generated PRN.
It looks like the Print method after it generated the PRN, it is not releasing or closing that file.
Could you please help me to resolve this issue.
Is it possible to close or dispose the Aspose word object.


Are you using the latest (21.9) version of Aspose.Words for .NET on your end? In case the problem still remains, then please create a standalone simplified Console Application (source code without compilation errors) that helps us to reproduce this exception on our end, compress it into ZIP format and attach the .zip file here for testing. Please also provide related documents (DOCX, PRN etc) files used by the app. Please do not include Aspose.Words DLL files in it to reduce the file size. We will then investigate the issue on our end and provide you more information.