diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index 97542da34e..a8f6b9e89a 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -1213,7 +1213,7 @@ class NoteTextComponent extends React.Component { setTimeout(() => { if (target === 'pdf') { - this.webviewRef_.current.wrappedInstance.printToPDF({ printBackground: true }, (error, data) => { + this.webviewRef_.current.wrappedInstance.printToPDF({ printBackground: true, pageSize: Setting.value('export.pdfPageSize'), landscape: Setting.value('export.pdfPageOrientation') === 'landscape' }, (error, data) => { restoreSettings(); if (error) { diff --git a/ReactNativeClient/lib/models/Setting.js b/ReactNativeClient/lib/models/Setting.js index 578e700a35..767ba949c9 100644 --- a/ReactNativeClient/lib/models/Setting.js +++ b/ReactNativeClient/lib/models/Setting.js @@ -407,6 +407,23 @@ class Setting extends BaseModel { tagHeaderIsExpanded: { value: true, type: Setting.TYPE_BOOL, public: false, appTypes: ['desktop'] }, folderHeaderIsExpanded: { value: true, type: Setting.TYPE_BOOL, public: false, appTypes: ['desktop'] }, editor: { value: '', type: Setting.TYPE_STRING, subType: 'file_path_and_args', public: true, appTypes: ['cli', 'desktop'], label: () => _('Text editor command'), description: () => _('The editor command (may include arguments) that will be used to open a note. If none is provided it will try to auto-detect the default editor.') }, + 'export.pdfPageSize': { value: 'A4', type: Setting.TYPE_STRING, isEnum: true, public: true, appTypes: ['desktop'], label: () => _('Page size for PDF export'), options: () => { + return { + 'A4': _('A4'), + 'Letter': _('Letter'), + 'A3': _('A3'), + 'A5': _('A5'), + 'Tabloid': _('Tabloid'), + 'Legal': _('Legal'), + }; + }}, + 'export.pdfPageOrientation': { value: 'portrait', type: Setting.TYPE_STRING, isEnum: true, public: true, appTypes: ['desktop'], label: () => _('Page orientation for PDF export'), options: () => { + return { + 'portrait': _('Portrait'), + 'landscape': _('Landscape'), + }; + }}, + 'net.customCertificates': { value: '',