[DE] Use default settings for pdf download

This commit is contained in:
Julia Radzhabova 2022-02-15 22:36:49 +03:00
parent fa0679e09e
commit f52b50ae67
3 changed files with 20 additions and 21 deletions

View file

@ -374,22 +374,16 @@ define([
} else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA)
this._saveAsFormat(menu, format, ext);
else {
(new Common.Views.OptionsDialog({
width: 300,
title: this.titleConvertOptions,
label: this.textGroup,
items: [
{caption: this.textChar, value: Asc.c_oAscTextAssociation.BlockChar, checked: true},
{caption: this.textLine, value: Asc.c_oAscTextAssociation.BlockLine, checked: false},
{caption: this.textParagraph, value: Asc.c_oAscTextAssociation.PlainLine, checked: false}
],
handler: function (dlg, result) {
if (result=='ok') {
me._saveAsFormat(menu, format, ext, new AscCommon.asc_CTextParams(dlg.getSettings()));
Common.UI.warning({
title: this.notcriticalErrorTitle,
msg: this.warnDownloadAsPdf,
buttons: ['ok', 'cancel'],
callback: _.bind(function(btn){
if (btn == 'ok') {
me._saveAsFormat(menu, format, ext, new AscCommon.asc_CTextParams(Asc.c_oAscTextAssociation.PlainLine));
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
})).show();
}, this)
});
}
} else
this._saveAsFormat(menu, format, ext);
@ -930,11 +924,7 @@ define([
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?',
txtUntitled: 'Untitled',
txtCompatible: 'The document will be saved to the new format. It will allow to use all the editor features, but might affect the document layout.<br>Use the \'Compatibility\' option of the advanced settings if you want to make the files compatible with older MS Word versions.',
titleConvertOptions: 'Grouping options',
textGroup: 'Group by',
textChar: 'Char',
textLine: 'Line',
textParagraph: 'Paragraph'
warnDownloadAsPdf: 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?'
}, DE.Controllers.LeftMenu || {}));
});

View file

@ -552,6 +552,7 @@ define([
this._state.isFromGatewayDownloadAs = true;
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
_defaultFormat = null,
textParams,
_supported = [
Asc.c_oAscFileType.TXT,
Asc.c_oAscFileType.RTF,
@ -575,6 +576,7 @@ define([
else if (/^djvu$/.test(this.document.fileType)) {
_supported = [Asc.c_oAscFileType.PDF];
}
textParams = new AscCommon.asc_CTextParams(Asc.c_oAscTextAssociation.PlainLine);
} else {
_supported = _supported.concat([Asc.c_oAscFileType.PDF, Asc.c_oAscFileType.PDFA]);
_defaultFormat = Asc.c_oAscFileType.DOCX;
@ -584,7 +586,13 @@ define([
}
if ( !_format || _supported.indexOf(_format) < 0 )
_format = _defaultFormat;
_format ? this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true)) : this.api.asc_DownloadOrigin(true);
if (_format) {
var options = new Asc.asc_CDownloadOptions(_format, true);
textParams && options.asc_setTextParams(textParams);
this.api.asc_DownloadAs(options);
} else {
this.api.asc_DownloadOrigin(true);
}
},
onProcessMouse: function(data) {

View file

@ -513,6 +513,7 @@
"DE.Controllers.LeftMenu.txtUntitled": "Untitled",
"DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
"DE.Controllers.LeftMenu.warnDownloadAsRTF": "If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?",
"DE.Controllers.LeftMenu.warnDownloadAsPdf": "If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?",
"DE.Controllers.Main.applyChangesTextText": "Loading the changes...",
"DE.Controllers.Main.applyChangesTitleText": "Loading the Changes",
"DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",