diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 77c89f1263..2c1326b92e 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -1031,6 +1031,9 @@ if (config.editorConfig && config.editorConfig.customization && config.editorConfig.customization.uiTheme ) params += "&uitheme=" + config.editorConfig.customization.uiTheme; + if (config.document.fileType) + params += "&fileType=" + config.document.fileType; + return params; } diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 6812cdb317..0e7264f0c1 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -948,7 +948,13 @@ DE.ApplicationController = new(function(){ }); window["flat_desine"] = true; - api = new Asc.asc_docs_api({ + var result = /[\?\&]fileType=\b(pdf|djvu|xps|oxps)\b&?/i.exec(window.location.search), + isPDF = (!!result && result.length && typeof result[1] === 'string'); + + api = isPDF ? new Asc.PDFEditorApi({ + 'id-view' : 'editor_sdk', + 'embedded' : true + }) : new Asc.asc_docs_api({ 'id-view' : 'editor_sdk', 'embedded' : true }); diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 45ed9bddaf..c7c822d16b 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -341,7 +341,14 @@ class MainController extends Component { delete _translate[item]; }); - this.api = new Asc.asc_docs_api({ + var result = /[\?\&]fileType=\b(pdf|djvu|xps|oxps)\b&?/i.exec(window.location.search), + isPDF = (!!result && result.length && typeof result[1] === 'string'); + + this.api = isPDF ? new Asc.PDFEditorApi({ + 'id-view' : 'editor_sdk', + 'mobile' : true, + 'translate': _translate + }) : new Asc.asc_docs_api({ 'id-view' : 'editor_sdk', 'mobile' : true, 'translate': _translate diff --git a/apps/pdfeditor/main/app/controller/Print.js b/apps/pdfeditor/main/app/controller/Print.js index 0051976ca6..bbf6c9500a 100644 --- a/apps/pdfeditor/main/app/controller/Print.js +++ b/apps/pdfeditor/main/app/controller/Print.js @@ -558,7 +558,8 @@ define([ SetDisabled: function() { if (this.printSettings.isVisible()) { - var disable = !this.mode.isEdit || this._state.lock_doc; + // var disable = !this.mode.isEdit || this._state.lock_doc; + var disable = true; this.printSettings.cmbPaperSize.setDisabled(disable); this.printSettings.cmbPaperMargins.setDisabled(disable); this.printSettings.cmbPaperOrientation.setDisabled(disable); diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less index 178543ff4f..f21ae23134 100644 --- a/apps/pdfeditor/main/resources/less/filemenu.less +++ b/apps/pdfeditor/main/resources/less/filemenu.less @@ -665,4 +665,134 @@ padding-left: 12px; padding-right: 12px; } +} + +#file-menu-panel { + #panel-print { + padding: 0; + .main-header { + .font-size-very-huge(); + margin: 18px 0 20px 0; + } + .comment-text{ + white-space: normal; + } + #id-print-settings { + position: absolute; + width:280px; + top: 0; + bottom: 0; + } + .print-settings { + width: 100%; + height: 100%; + overflow: hidden; + display: flex; + flex-direction: column; + border-right: @scaled-one-px-value-ie solid @border-toolbar-ie; + border-right: @scaled-one-px-value solid @border-toolbar; + .rtl & { + border-right: none; + border-left: @scaled-one-px-value-ie solid @border-toolbar-ie; + border-left: @scaled-one-px-value solid @border-toolbar; + } + + .settings-container { + width: 100%; + height: 100%; + overflow: hidden; + padding: 12px 16px; + .padding-small { + padding-bottom: 8px; + } + .padding-large { + padding-bottom: 16px; + } + + #print-apply-all { + margin-top: 5px; + } + .link { + margin-top: 9px; + } + .footer { + margin-top: 24px; + } + #print-combo-sides { + .dropdown-menu li > a { + .padding-x(20px, 5px); + } + } + } + } + #print-navigation { + height: 50px; + .padding-left-20(); + padding-top: 10px; + display: flex; + #print-prev-page { + display: inline-block; + margin-right: 4px; + } + #print-next-page { + display: inline-block; + } + .btn-prev-page, .btn-next-page { + background-color: transparent; + padding: 0; + height: 20px; + width: 20px; + i.arrow { + display: inline-block; + width: 10px; + height: 10px; + + border: solid @scaled-one-px-value-ie @icon-normal-ie; + border: solid @scaled-one-px-value @icon-normal; + border-bottom: none; + border-right: none; + } + &.disabled { + opacity: @component-disabled-opacity; + } + + &:hover:not(:disabled):not(.disabled) { + background-color: @highlight-button-hover-ie; + background-color: @highlight-button-hover; + } + } + .btn-prev-page { + i { + transform: rotate(-45deg) translate(-1px, 3px); + } + } + .btn-next-page { + i { + transform: rotate(135deg) translate(4px, 0px); + } + } + .page-number { + display: flex; + align-items: center; + height: 20px; + label { + .font-weight-bold(); + } + } + } + #print-preview { + height: calc(100% - 50px); + } + #print-preview-box { + position: absolute; + left: 280px; + top: 0; + right: 0; + bottom: 0; + .rtl & { + right: 280px; + left: 0; + } + } + } } \ No newline at end of file