Sets printer driver information. This method is not intended to be used alone, but together with GetPrinterDriverSettings to copy printer driver information from a file to another.
Excel stores printer settings in two places
- Standard printer settings: You can set/read this with PrintPaperSize, PrintScale, PrintLandscape, PrintXResolution, PrintYResolution and PrintCopies
- 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.
procedure TExcelFile.SetPrinterDriverSettings(const settings: TPrinterDriverSettings); virtual; abstract;
|const||settings||TPrinterDriverSettings||Printer driver information obtained with GetPrinterDriverSettings. Use null to remove the printer settings.|
To copy the printer driver information from an empty template to the working file, use:
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.