Printing Word Docs

I’m using aspose words print document to print documents. I have an issue with the way its printing documents on the printer. It doesn’t send the documents as soon as the print command is issued but it waits to spool and sends documents as if it is waiting for a print successful command from the printer. Is there anyway to send the documents without waiting from the printer using aspose or is it something to do with the way aspose prints documents. Here is my code

Dim MyWordDoc As Aspose.Words.Document = Nothing
Try
Dim license As Aspose.Words.License = New Aspose.Words.License()
license.SetLicense("Aspose.Total.lic")
Catch ex As Exception
End Try
Dim arrBulktoFiles As String() = Directory.GetFiles("C:\temp\tests", "*.doc")
For Each strDocName As String In arrBulktoFiles
MyWordDoc = New Aspose.Words.Document(strDocName)
Dim awPrintDoc As New Aspose.Words.Rendering.AsposeWordsPrintDocument(MyWordDoc)
awPrintDoc.PrinterSettings = ps
awPrintDoc.Print()
Next

Hi Sita,

Thanks for your inquiry. AsposeWordsPrintDocument Class provides a default implementation for printing of a Document within the .NET printing framework. AsposeWordsPrintDocument overrides OnBeginPrint to print the range of pages that is specified in PrinterSettings. When you print multiple document by using Aspose.Words, all document will be listed in queue for printing. Please see the attached image.

siabhavaraju:

Is there anyway to send the documents without waiting from the printer using aspose or is it something to do with the way aspose prints documents.

It would be great if you please share some more detail about your query.

Thanks manzoor for your detailed explanation. It is almost evident that the printer spools documents and also the framework is waiting to process commands especially when the printer is on the network. I have to check what are the limitation in the .net framework because of which it is not able to send all the pages in a documents without spooling them on the server, that is what currently happening. If I do the prints locally i.e. connect it via USB, then it wouldn’t spool the document as the sending and receiving is much quicker, this is happening only on a specific brand printer.

Hi Sita,

Please accept my apologies for late response. I am working over your query and will get back to you soon.

Thanks manzoor.

Hi Sita,

Thanks for your patience. Please note that Aspose.Words print or preview document pages using the standard .NET printing infrastructure. The AsposeWordsPrintDocument class provides a default implementation for printing of a Document within the .NET printing framework. You can pass PrinterSettings to Document.Print method, this prints the document according to the specified printer settings, using the standard (no User Interface) print controller.

The print spooler is a computer service that allows for the caching of data to be printed between computer and printer memory. Your query is more related to setting print spooler options, I suggest you to read following links for your kind reference.

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc781034(v=ws.10)

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc739118(v=ws.10)

Thanks manzoor for your reply. I will try the solutions you have posted.

Hi Sita,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.