From 033c44d47315a1f34313c0114cd91cb283d160f3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Nov 2022 14:47:58 +0300 Subject: [PATCH] [DE][PE] Show error when printing several pages --- apps/documenteditor/main/app/controller/Print.js | 11 +++++++---- apps/documenteditor/main/locale/en.json | 1 + apps/presentationeditor/main/app/controller/Print.js | 11 +++++++---- apps/presentationeditor/main/locale/en.json | 1 + 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Print.js b/apps/documenteditor/main/app/controller/Print.js index 2be799c0a..556b303f8 100644 --- a/apps/documenteditor/main/app/controller/Print.js +++ b/apps/documenteditor/main/app/controller/Print.js @@ -89,6 +89,9 @@ define([ if (!_.isEmpty(value) && /[0-9,\-]/.test(value)) { var res = [], arr = value.split(','); + if (me._isPrint && arr.length>1) + return me.txtPrintRangeSingleRange; + for (var i=0; i size['W'] ? 'portrait' : 'landscape') : null }); - this._isPrint = print; if ( print ) { var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); opts.asc_setAdvancedOptions(this.adjPrintParams); this.api.asc_Print(opts); - this._isPrint = false; } else { var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF); opts.asc_setAdvancedOptions(this.adjPrintParams); @@ -566,6 +568,7 @@ define([ txtCustom: 'Custom', txtPrintRangeInvalid: 'Invalid print range', - textMarginsLast: 'Last Custom' + textMarginsLast: 'Last Custom', + txtPrintRangeSingleRange: 'Enter either a single page number or a single page range (for example, 5-12). Or you can Print to PDF.' }, DE.Controllers.Print || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 27356e349..a6a6a1b61 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -957,6 +957,7 @@ "DE.Controllers.Print.txtCustom": "Custom", "DE.Controllers.Print.txtPrintRangeInvalid": "Invalid print range", "DE.Controllers.Print.textMarginsLast": "Last Custom", + "DE.Controllers.Print.txtPrintRangeSingleRange": "Enter either a single page number or a single page range (for example, 5-12). Or you can Print to PDF.", "DE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?", "DE.Controllers.Toolbar.dataUrl": "Paste a data URL", "DE.Controllers.Toolbar.notcriticalErrorTitle": "Warning", diff --git a/apps/presentationeditor/main/app/controller/Print.js b/apps/presentationeditor/main/app/controller/Print.js index 657bb963d..2fc123f63 100644 --- a/apps/presentationeditor/main/app/controller/Print.js +++ b/apps/presentationeditor/main/app/controller/Print.js @@ -84,6 +84,9 @@ define([ if (!_.isEmpty(value) && /[0-9,\-]/.test(value)) { var res = [], arr = value.split(','); + if (me._isPrint && arr.length>1) + return me.txtPrintRangeSingleRange; + for (var i=0; i86); opts.asc_setAdvancedOptions(this.adjPrintParams); this.api.asc_Print(opts); - this._isPrint = false; } else { var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF); opts.asc_setAdvancedOptions(this.adjPrintParams); @@ -340,6 +342,7 @@ define([ } }, - txtPrintRangeInvalid: 'Invalid print range' + txtPrintRangeInvalid: 'Invalid print range', + txtPrintRangeSingleRange: 'Enter either a single slide number or a single slide range (for example, 5-12). Or you can Print to PDF.' }, PE.Controllers.Print || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index cd455cb43..52910b371 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1012,6 +1012,7 @@ "PE.Controllers.Main.textUndo": "Undo", "PE.Controllers.Main.textContinue": "Continue", "PE.Controllers.Print.txtPrintRangeInvalid": "Invalid print range", + "PE.Controllers.Print.txtPrintRangeSingleRange": "Enter either a single slide number or a single slide range (for example, 5-12). Or you can Print to PDF.", "PE.Controllers.Search.notcriticalErrorTitle": "Warning", "PE.Controllers.Search.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.", "PE.Controllers.Search.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",