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

Free Support Forum - aspose.com

Setting printer trays

Hi,

I am currently trying to set a document so that the first page prints from tray one and the remaining pages from tray 2. The default printer supports two trays but when I execute the code all the pages print from tray 1. I have attached a sample consol program and input file in the hope you can advise where I am going wrong.

It might be worth checking if your printer trays are being set - or if they’re being set as Automatic :slight_smile:

The current printer setting are attached in the word document

Hi Timothy,


Thanks for your inquiry. Aspose.Words supports printing as per the paper tray values stored in the document. So, you can mention paper trays in Document.

http://word.tips.net/T003519_Selecting_Different_Trays_in_a_Mail_Merge.html

Please note that paper tray numbers are printer specific. Aspose.Words just reads values from document in Raw format (i.e. as int) and after Print method is called, a function compares the Raw value of PaperTray of current page and values in PrinterSettings.PaperSources and if it doesn’t find coincidence, function returns “Automatic” value. Then it passes the value for PaperTray to underlying Windows function that actually sends document to printer.

Could you please run the following code to determine whether a tray with specific number actually exists in your printer?

PrinterSettings settings = new PrinterSettings();

settings.PrinterName = “name of your multi-tray printer”;<o:p></o:p>

foreach (PaperSource ps in settings.PaperSources)<o:p></o:p>

Console.WriteLine(ps.RawKind);


Best regards,