PageSetupOtherPagesTray Property

Gets or sets the paper tray (bin) to be used for all but the first page of a section. The value is implementation (printer) specific.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.9.0

Syntax

public int OtherPagesTray { get; set; }

Property Value

Type: Int32

Examples

Shows how to change all sections in a document to use the default paper tray of the selected printer.
Document doc = new Document();

// Find the printer that will be used for printing this document
// In this case, it is the default printer
// You can define a specific printer using PrinterName
PrinterSettings settings = new PrinterSettings();

// The paper tray value stored in documents is completely printer specific
// This means the code below resets all page tray values to use the current printers default tray
// You can enumerate PrinterSettings.PaperSources to find the other valid paper tray values of the selected printer
foreach (Section section in doc.Sections.OfType<Section>())
{
    section.PageSetup.FirstPageTray = settings.DefaultPageSettings.PaperSource.RawKind;
    section.PageSetup.OtherPagesTray = settings.DefaultPageSettings.PaperSource.RawKind;
}
Shows how to set up printing using different printer trays for different paper sizes.
Document doc = new Document();

// Choose the default printer to be used for printing this document
PrinterSettings settings = new PrinterSettings();

// This is the tray we will use for A4 paper size
// This is the first tray in the paper sources collection
int printerTrayForA4 = settings.PaperSources[0].RawKind;
// The is the tray we will use for Letter paper size
// This is the second tray in the paper sources collection
int printerTrayForLetter = settings.PaperSources[1].RawKind;

// Set the page tray used for each section based off the paper size used in the section
foreach (Section section in doc.Sections.OfType<Section>())
{
    if (section.PageSetup.PaperSize == Aspose.Words.PaperSize.Letter)
    {
        section.PageSetup.FirstPageTray = printerTrayForLetter;
        section.PageSetup.OtherPagesTray = printerTrayForLetter;
    }
    else if (section.PageSetup.PaperSize == Aspose.Words.PaperSize.A4)
    {
        section.PageSetup.FirstPageTray = printerTrayForA4;
        section.PageSetup.OtherPagesTray = printerTrayForA4;
    }
}

See Also