It looks like I have the same issue as expressed in this concern:
https://forum.aspose.com/t/8-1-net-paper-tray-problem/77970
I am opening a document, merging it, setting the printer tray for output, then trying to print it. The printer tray part is not working. Below is my code. Is this a bug in Aspose.Word?
Thanks,
Damian
DocumentBuilder builder = new DocumentBuilder();
builder.Document = doc;
builder.MoveToDocumentStart();
//check our papertray enum’s range and only use it if it’s a valid number
// int i = 0;
// int j = 1/i;
if (this.tPrinterTray != null)
{
if ((this.tPrinterTray.PaperTrayEnum >= 0) && (this.tPrinterTray.PaperTrayEnum <= 15))
{
builder.PageSetup.FirstPageTray = (Aspose.Words.PaperTray)this.tPrinterTray.PaperTrayEnum;
builder.PageSetup.OtherPagesTray = (Aspose.Words.PaperTray)this.tPrinterTray.PaperTrayEnum;
}
}
if (this.LetterDefinition.tPaper.PaperWidth > 0)
{
builder.PageSetup.PageWidth = ConvertUtil.InchToPoint(this.LetterDefinition.tPaper.PaperWidth);
}
// builder.PageSetup.PageHeight = ConvertUtil.InchToPoint(4.25);
if (this.LetterDefinition.tPaper.PaperHeight > 0)
{
builder.PageSetup.PageHeight = ConvertUtil.InchToPoint(this.LetterDefinition.tPaper.PaperHeight);
}
AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
awPrintDoc.PrinterSettings = printerSettings;
builder.Document.Save("tempoutput.doc");
awPrintDoc.Print();