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

Free Support Forum - aspose.com

Printing on incorrect trays

The scenario:
our client create templates. Some of those templates have printer settings that should be sending the output into spectific trays.
the templates are uploaded to our site.
our site generates the docx/pdf file and saves it (we do not have the driver installed at our site)

the docx/pdf files are transfered to client site.
another of our programs pick up the file and sends it to the printer through aspose with a Print() command

Our issue is that the docx file is not going to the right trays. it’s only being printed in the default tray.

The question now is : how can I tell which trays the docx file is supposed to print to?
I’ve managed to get the printer settings:(which are correct), but how do I display the tray settings;

Settings : [PrinterSettings HP LaserJet 2055 Check Printer Copies=1 Collate=False Duplex=Simplex FromPage=0 LandscapeAngle=0 MaximumCopies=1 OutputPort= ToPage=0]

@conniem Pager tray can be explicitly specified using PageSetup.FirstPageTray and PageSetup.OtherPagesTray. But please note the value is implementation (printer) specific.
If the trays are properly setup in the template, printing should work as expected. You can use the following code to check what paper source is selected:

PrinterSettings settings = new PrinterSettings();
settings.PrinterName = "my printer";

for (int i = 0; i < settings.PaperSizes.Count; i++)
    Console.WriteLine(settings.PaperSizes[i]);

Console.WriteLine("====================================");

for (int i = 0; i < settings.PaperSources.Count; i++)
    Console.WriteLine(settings.PaperSources[i]);

Console.WriteLine("====================================");

Document doc = new Document(@"C:\Temp\in.docx");
for (int i = 0; i < doc.PageCount; i++)
{
    PageInfo pageInfo = doc.GetPageInfo(i);
    Console.WriteLine(pageInfo.GetDotNetPaperSize(settings.PaperSizes));
    Console.WriteLine(pageInfo.GetSpecifiedPrinterPaperSource(settings.PaperSources, settings.DefaultPageSettings.PaperSource));
    Console.WriteLine("---------------------------------");
}

Thank you, this got me to the place where I got the information required