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

Free Support Forum - aspose.com

Document is sent to printer spool as multiple spool items

When I try to print a single document and if this document has multiple pages, they are send to the printer spooler in multiple parts. (however not all of them)


For example when my document has 10 pages, the document is split in multiple parts in the print queue. When I look at the Windows printer queue, I see my document name multiple times (1x 1 page , 1x 5 pages, 1 x 4 pages for example).

The total pages are correct, but this can give problems with the page ordering of my document

How can I prevent this from happening?


I’ve had a more closer look at the issue, and it seems that the print function creates a print spool file per Word section if I change the pagestray per section…


If my document has 3 sections and I change the firstpagestray and otherpagestray, 3 spool files are created.

How can I disable this functionality ?

Hi Joeri,

Thanks for your inquiry. In case you are using an older version of Aspose.Words, I would suggest you please upgrade to the latest version (v13.10.0) from here and let us know how it goes on your side. If the problem still remains, please attach your input Word document along with code here for testing. I will investigate the issue on my side and provide you more information.

Moreover, I suggest please read the Document.print method from following link.
http://www.aspose.com/docs/display/wordsjava/Document

Please also try Document.print() method with setting FirstPageTray and OtherPagesTray

In attachemnt you can find a simple program with a simple document to show the behavior.

When changing pagetray settings the printjob is split in multiple parts…


Hi Joeri,

Thanks for sharing the detail. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSJAVA-817. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,


Thanks for the reply, any estimate on what’s the average resolution time for this kind of ticket?

Can you propse other solutions the prevent this kind of behavior in a multithreaded environment? We will be using Aspose as an ondemand production merge solution. This means that documents are staff is requesting should be handled as fast as possible by the the aspose merge engine. Therefor we would make the solution multi threaded. This is working for the merge part, but when printing we can have issues. If multiple threads do a print to the same print queue and the document is not send as 1 bundle, the pages can be mixed between requests.


Hi Joeri,

Cuball:

Thanks for the reply, any estimate on what’s the average resolution time for this kind of ticket?

I would like to share with you that issues are
addressed and resolved based on first come first serve basis. Currently,
your issue is pending for analysis and is in the queue. I am afraid, I
cannot provide you any reliable estimate at the moment. Once your issue
is analyzed, we will then be able to provide you an estimate.
Cuball:

Can you propse other solutions the prevent this kind of behavior in a multithreaded environment? We will be using Aspose as an ondemand production merge solution. This means that documents are staff is requesting should be handled as fast as possible by the the aspose merge engine. Therefor we would make the solution multi threaded. This is working for the merge part, but when printing we can have issues. If multiple threads do a print to the same print queue and the document is not send as 1 bundle, the pages can be mixed between requests.

Aspose.Words is multi thread safe as
long as only one thread works on a document at a time. It is a typical
scenario to have one thread working on one document. Different threads
can safely work on different documents at the same time. If you face any issue, please create a standalone/runnable simple Java application that demonstrates the issue which you are facing.

Please let us know if you have any more queries. We will be glad to help you.

Hi Tahir,


We are indeed processing 1 document in 1 thread, but because of the issue reported we cannot really use this.

If multiple threads ( = multiple documents) want to print to the same printer, there is no guarantee that all pages of the same document are kept together.

for example 3 threads (I represented them as a sort of timeline). While T1 is doing the print function, T2 en T3 will also call the print function, because T3 starts to print before T1 and each page is sent separetely to the print queue it’s possible that pages of the different threads (documents) get mixed up.

T1: (—open document----)(—merge document—)(—print document—)
T2: (–open document-----)(------merge document–)(------print document----)
T3: (–open document–)(–merge document-)(----printdocument------------------)

The output queue on the printer could be like this:
Page1Doc3 , Page1Doc1, Page1Doc2, Page2Doc1, …

Is there any way to prevent this while this bug is not fixed? I added a synchronization around the doc.print function, but this slows down the whole output for all threads :frowning:


Hi Joeri,

Thanks for sharing the detail. Unfortunately, there is no workaround available for WORDSJAVA-817. Regarding
the ETA of this issue, currently this issue is pending for analysis and
is in the queue. I am afraid, I cannot provide you any reliable
estimate at the moment. Once this issue is analyzed, we will then be
able to provide you an estimate.


Thank you for your patience and understanding.

The issues you have found earlier (filed as WORDSJAVA-817) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(5)