Search Results for

    Show / Hide Table of Contents

    XlsFile.GetPrinterDriverSettings Method

    Returns printer driver settings. This method is not intended to be used alone, but together with ExcelFile.SetPrinterDriverSettings to copy printer driver information from a file to another.

    Remarks

    Excel stores printer settings in two places

    1. Standard printer settings: You can set/read this with ExcelFile.PrintPaperSize, ExcelFile.PrintScale, ExcelFile.PrintLandscape, ExcelFile.PrintXResolution, ExcelFile.PrintYResolution and ExcelFile.PrintCopies
    2. Printer driver settings: You can access this with GetPrinterDriverSettings and SetPrinterDriverSettings.

    NOTE THAT THOSE PLACES STORE DUPLICATED INFORMATION. For example, Excel stores the PageSize on both Standard printer settings and Printer driver settings.

    Always that a value is stored on both places, (1) Standard printer settings takes preference.

    If you set PaperSize = A4 on standard settings and PaperSize = A5 on driver settings, A4 will be used.

    Syntax

    Namespace: FlexCel.XlsAdapter

    public override TPrinterDriverSettings GetPrinterDriverSettings()

    Examples

    To copy the printer driver information from an empty template to the working file, use:

        xlsWorkingCopy.SetPrinterDriverSettings(xlsTemplate.GetPrinterDriverSettings());
    

    If you have defined a printer specific paper size, and you want to use it, you should call

        xlsWorkingCopy.PrintPaperSize = xlsTemplate.PrintPaperSize;
    

    after copying the driver settings.

    See also

    • XlsFile
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com