Aspose on linux

Our product processes documents on linux servers using Aspose. This works like a charm and we are very happy with it.
In the future we intend to use Aspose’s new ability to print, this way our customers can not only be provided with documents in their preferred format, but they may also retrieve a printed version from a printer near them.

In order to print to different trays as specified by our users we need to answer the following question: How can we find out the specific tray identifiers for the different printers?

Using these identifiers we intend to tell Aspose to print certain pages to certain paper types.

Kind regards,
Frederik Bonte
InteractionNext
Rijssen, Nederland

Hi Rijssen,


Thanks for your inquiry. I am in communication with our development team and will update you as soon as I have information about this topic.

Best regards,

Hi Frederik,


Thanks for your patience.

I have received response from our development team; yes, you can send and print all pages of the document to a specific printer tray. Please find attached a sample program to achieve what you’re looking for:

I hope, this helps.

Best regards,

Thanks very much for your response.

I’m (unfortunately) hypersensitive to word choices.
Your response states that ALL pages of the document can be sent to A (i.e. ONE) specific tray.
Is is also possible for EACH page of the document to be sent to a DIFFERENT specific tray?

Also the original question was related to actually identifying the different trays that are available to me. In order to control the tray to which each page is printed a certain (magic?) number is required by Aspose.
In what way can we use Aspose to retrieve the list of supported tray numbers?

Kind regards,
Frederik Bonte

Hi Frederik,

Thanks for your inquiry.
Frederik:
Is is also possible for EACH page of the document to be sent to a DIFFERENT specific tray?
To be able to achieve this you first need to extract individual pages into separate documents properly. The easiest way you can do this is by converting each page to a separate image as follows:
Document doc = new Document("c:\\temp\\first.docx");

for (int pageIndex = 0; pageIndex < doc.getPageCount(); pageIndex++)
{
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.JPEG);
options.setPageIndex(pageIndex);
options.setPageCount(1);
doc.save(“c:\temp\out_” + pageIndex + “.jpg”, options);
}

Once pages are exported to separate images you can then use the code from the following article to save each image to an individual Word document preferrably in DOC/DOCX format and ofcourse as per your needs you can send these single page intermediate documents to separate trays.
Frederik:
Also the original question was related to actually identifying the different trays that are available to me. In order to control the tray to which each page is printed a certain (magic?) number is required by Aspose.
In what way can we use Aspose to retrieve the list of supported tray numbers?
Please see in the definition of testTray method, there you will find code for poulating combobox with list of available trays and you can select specific tray your ‘single page temp document’ would be sent to.

Best regards,

Thanks very much for you clear exposition. It is greatly appreciated.

Kind regards,
Frederik Bonte