Save to pdfa format

This commit is contained in:
Julia Radzhabova 2018-07-18 14:07:24 +03:00
parent c5b49333d1
commit d8fc456686
17 changed files with 31 additions and 14 deletions

View file

@ -413,7 +413,8 @@ define([
Asc.c_oAscFileType.ODT, Asc.c_oAscFileType.ODT,
Asc.c_oAscFileType.DOCX, Asc.c_oAscFileType.DOCX,
Asc.c_oAscFileType.HTML, Asc.c_oAscFileType.HTML,
Asc.c_oAscFileType.PDF Asc.c_oAscFileType.PDF,
Asc.c_oAscFileType.PDFA
]; ];
if ( !_format || _supported.indexOf(_format) < 0 ) if ( !_format || _supported.indexOf(_format) < 0 )

View file

@ -142,7 +142,8 @@ define([
Asc.c_oAscFileType.RTF, Asc.c_oAscFileType.RTF,
Asc.c_oAscFileType.ODT, Asc.c_oAscFileType.ODT,
Asc.c_oAscFileType.DOCX, Asc.c_oAscFileType.DOCX,
Asc.c_oAscFileType.HTML Asc.c_oAscFileType.HTML,
Asc.c_oAscFileType.PDFA
]; ];
if ( !_format || _supported.indexOf(_format) < 0 ) if ( !_format || _supported.indexOf(_format) < 0 )

View file

@ -54,6 +54,7 @@ define([
formats: [[ formats: [[
{name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX}, {name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX},
{name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF},
{name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA},
{name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT} {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT}
],[ ],[
// {name: 'DOC', imgCls: 'doc-format btn-doc', type: Asc.c_oAscFileType.DOC}, // {name: 'DOC', imgCls: 'doc-format btn-doc', type: Asc.c_oAscFileType.DOC},

View file

@ -264,6 +264,7 @@
<img class="inline-svg" src="../../common/main/resources/img/header/buttons.svg"> <img class="inline-svg" src="../../common/main/resources/img/header/buttons.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/docx.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/docx.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdf.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdf.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdfa.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/txt.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/txt.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/odt.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/odt.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/rtf.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/rtf.svg">

View file

@ -285,6 +285,7 @@
<inline src="resources/img/header/buttons.svg" /> <inline src="resources/img/header/buttons.svg" />
<inline src="resources/img/doc-formats/docx.svg" /> <inline src="resources/img/doc-formats/docx.svg" />
<inline src="resources/img/doc-formats/pdf.svg" /> <inline src="resources/img/doc-formats/pdf.svg" />
<inline src="resources/img/doc-formats/pdfa.svg" />
<inline src="resources/img/doc-formats/txt.svg" /> <inline src="resources/img/doc-formats/txt.svg" />
<inline src="resources/img/doc-formats/odt.svg" /> <inline src="resources/img/doc-formats/odt.svg" />
<inline src="resources/img/doc-formats/rtf.svg" /> <inline src="resources/img/doc-formats/rtf.svg" />

View file

@ -385,7 +385,8 @@ define([
_supported = [ _supported = [
Asc.c_oAscFileType.PPTX, Asc.c_oAscFileType.PPTX,
Asc.c_oAscFileType.ODP, Asc.c_oAscFileType.ODP,
Asc.c_oAscFileType.PDF Asc.c_oAscFileType.PDF,
Asc.c_oAscFileType.PDFA
]; ];
if ( !_format || _supported.indexOf(_format) < 0 ) if ( !_format || _supported.indexOf(_format) < 0 )

View file

@ -149,7 +149,8 @@ define([
var _supported = [ var _supported = [
Asc.c_oAscFileType.PPTX, Asc.c_oAscFileType.PPTX,
Asc.c_oAscFileType.ODP Asc.c_oAscFileType.ODP,
Asc.c_oAscFileType.PDFA
]; ];
if ( !_format || _supported.indexOf(_format) < 0 ) if ( !_format || _supported.indexOf(_format) < 0 )

View file

@ -55,6 +55,7 @@ define([
formats: [[ formats: [[
{name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX}, {name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX},
{name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF},
{name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA},
{name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP} {name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP}
]], ]],

View file

@ -263,6 +263,7 @@
<img class="inline-svg" src="../../common/main/resources/img/header/buttons.svg"> <img class="inline-svg" src="../../common/main/resources/img/header/buttons.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pptx.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/pptx.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdf.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdf.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdfa.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/odp.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/odp.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/blank.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/blank.svg">
<script> <script>

View file

@ -285,6 +285,7 @@
<inline src="resources/img/header/buttons.svg" /> <inline src="resources/img/header/buttons.svg" />
<inline src="resources/img/doc-formats/pptx.svg" /> <inline src="resources/img/doc-formats/pptx.svg" />
<inline src="resources/img/doc-formats/pdf.svg" /> <inline src="resources/img/doc-formats/pdf.svg" />
<inline src="resources/img/doc-formats/pdfa.svg" />
<inline src="resources/img/doc-formats/odp.svg" /> <inline src="resources/img/doc-formats/odp.svg" />
<inline src="resources/img/doc-formats/blank.svg" /> <inline src="resources/img/doc-formats/blank.svg" />

View file

@ -261,9 +261,9 @@ define([
} }
}, this) }, this)
}); });
} else if (format == Asc.c_oAscFileType.PDF) { } else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) {
menu.hide(); menu.hide();
Common.NotificationCenter.trigger('download:settings', this.leftMenu); Common.NotificationCenter.trigger('download:settings', this.leftMenu, format);
} else { } else {
this.api.asc_DownloadAs(format); this.api.asc_DownloadAs(format);
menu.hide(); menu.hide();

View file

@ -407,13 +407,14 @@ define([
Asc.c_oAscFileType.XLSX, Asc.c_oAscFileType.XLSX,
Asc.c_oAscFileType.ODS, Asc.c_oAscFileType.ODS,
Asc.c_oAscFileType.CSV, Asc.c_oAscFileType.CSV,
Asc.c_oAscFileType.PDF Asc.c_oAscFileType.PDF,
Asc.c_oAscFileType.PDFA
]; ];
if ( !_format || _supported.indexOf(_format) < 0 ) if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.XLSX; _format = Asc.c_oAscFileType.XLSX;
if (_format == Asc.c_oAscFileType.PDF) if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
Common.NotificationCenter.trigger('download:settings', this, true); Common.NotificationCenter.trigger('download:settings', this, _format, true);
else else
this.api.asc_DownloadAs(_format, true); this.api.asc_DownloadAs(_format, true);
}, },

View file

@ -220,9 +220,10 @@ define([
} }
}, },
openPrintSettings: function(type, cmp, asUrl) { openPrintSettings: function(type, cmp, format, asUrl) {
if (this.api) { if (this.api) {
this.asUrl = asUrl; this.asUrl = asUrl;
this.downloadFormat = format;
this.printSettingsDlg = (new SSE.Views.PrintSettings({ this.printSettingsDlg = (new SSE.Views.PrintSettings({
type: type, type: type,
handler: _.bind(this.resultPrintSettings,this), handler: _.bind(this.resultPrintSettings,this),
@ -251,7 +252,7 @@ define([
if ( this.printSettingsDlg.type=='print' ) if ( this.printSettingsDlg.type=='print' )
this.api.asc_Print(this.adjPrintParams, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); this.api.asc_Print(this.adjPrintParams, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera);
else else
this.api.asc_DownloadAs(Asc.c_oAscFileType.PDF, this.asUrl, this.adjPrintParams); this.api.asc_DownloadAs(this.downloadFormat, this.asUrl, this.adjPrintParams);
Common.component.Analytics.trackEvent((this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs'); Common.component.Analytics.trackEvent((this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
Common.component.Analytics.trackEvent('ToolBar', (this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs'); Common.component.Analytics.trackEvent('ToolBar', (this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
Common.NotificationCenter.trigger('edit:complete', view); Common.NotificationCenter.trigger('edit:complete', view);

View file

@ -101,14 +101,15 @@ define([
var _supported = [ var _supported = [
Asc.c_oAscFileType.XLSX, Asc.c_oAscFileType.XLSX,
Asc.c_oAscFileType.ODS, Asc.c_oAscFileType.ODS,
Asc.c_oAscFileType.CSV Asc.c_oAscFileType.CSV,
Asc.c_oAscFileType.PDFA
]; ];
if ( !_format || _supported.indexOf(_format) < 0 ) if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.PDF; _format = Asc.c_oAscFileType.PDF;
if (_format == Asc.c_oAscFileType.PDF) if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
Common.NotificationCenter.trigger('download:settings', this.toolbar); Common.NotificationCenter.trigger('download:settings', this.toolbar, _format);
else else
_main.api.asc_DownloadAs(_format); _main.api.asc_DownloadAs(_format);
}, },

View file

@ -44,6 +44,8 @@ define([
formats: [[ formats: [[
{name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX}, {name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX},
{name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF},
{name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}
],[
{name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS}, {name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS},
{name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV} {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV}
] ]

View file

@ -265,6 +265,7 @@
<img class="inline-svg" src="../../common/main/resources/img/header/buttons.svg"> <img class="inline-svg" src="../../common/main/resources/img/header/buttons.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/xlsx.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/xlsx.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdf.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdf.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/pdfa.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/ods.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/ods.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/csv.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/csv.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/blank.svg"> <img class="inline-svg" src="../../common/main/resources/img/doc-formats/blank.svg">

View file

@ -284,6 +284,7 @@
<inline src="resources/img/header/buttons.svg" /> <inline src="resources/img/header/buttons.svg" />
<inline src="resources/img/doc-formats/xlsx.svg" /> <inline src="resources/img/doc-formats/xlsx.svg" />
<inline src="resources/img/doc-formats/pdf.svg" /> <inline src="resources/img/doc-formats/pdf.svg" />
<inline src="resources/img/doc-formats/pdfa.svg" />
<inline src="resources/img/doc-formats/ods.svg" /> <inline src="resources/img/doc-formats/ods.svg" />
<inline src="resources/img/doc-formats/csv.svg" /> <inline src="resources/img/doc-formats/csv.svg" />
<inline src="resources/img/doc-formats/blank.svg" /> <inline src="resources/img/doc-formats/blank.svg" />