mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
feat: allow defaulting to printer default page size (#49523)
Co-authored-by: Edvan de Matos <edvan.santos@querodelivery.com>
This commit is contained in:
@@ -263,7 +263,12 @@ WebContents.prototype.print = function (options: ElectronInternal.WebContentsPri
|
||||
throw new TypeError('webContents.print(): Invalid print settings specified.');
|
||||
}
|
||||
|
||||
const { pageSize } = options;
|
||||
const { pageSize, usePrinterDefaultPageSize } = options;
|
||||
|
||||
if (usePrinterDefaultPageSize !== undefined && pageSize !== undefined) {
|
||||
throw new Error('usePrinterDefaultPageSize cannot be combined with pageSize');
|
||||
}
|
||||
|
||||
if (typeof pageSize === 'string' && PDFPageSizes[pageSize]) {
|
||||
const mediaSize = PDFPageSizes[pageSize];
|
||||
options.mediaSize = {
|
||||
|
||||
Reference in New Issue
Block a user