Free Support Forum - aspose.com

Can't print to dofferent trays. Version 10

Hello,

I am trying to print to different Trays with version 10.x

However I am not able to do that. It always goes to the default tray.

I have attached the simple console program. I read the trays from the paper source. Find RawKind 258

I set it to 258 and when it prints it goes to RawKind 7.

After setting the value it check the value and it is on 7.

Can you please help?

I have not attached the Words.dll file

Hi

Thanks for your request. I think, in your case, you have to set paper tray in PageSetup of each section of the document. Please see the following link for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.pagesetup.firstpagetray.html

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.pagesetup.otherpagestray.html

But please note that paper tray you specify in the document should be present in your printer.

Best regards,

Hi Alexy,

I am not sure if i am doing everything well.

I only need to print the complete document in one of the trays. Is there an easy solution? and if so, can you provide that?

Setting per section doesn't seems to be the correct solution.

Hi

Thanks for your request. Please try using the following code:

const int tray = 17;

// Open document.

Document doc = new Document(@"Test001\in.doc");

// Set tray.

foreach (Section section in doc.Sections)

{

section.PageSetup.FirstPageTray = tray;

section.PageSetup.OtherPagesTray = tray;

}

// Print the document.

doc.Print();

Please note that tray should be valid for your printer.

Best regards,