diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js index 8a5cb663..90d33b0d 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js @@ -108,6 +108,7 @@ function InputCommand(data, copyExplicit) { this['convertToOrigin'] = data['convertToOrigin']; this['isSaveAs'] = data['isSaveAs']; this['saveAsPath'] = data['saveAsPath']; + this['oformAsPdf'] = data['oformAsPdf']; if (copyExplicit) { this['withAuthorization'] = data['withAuthorization']; this['externalChangeInfo'] = data['externalChangeInfo']; @@ -170,6 +171,7 @@ function InputCommand(data, copyExplicit) { this['originformat'] = undefined; this['isSaveAs'] = undefined; this['saveAsPath'] = undefined; + this['oformAsPdf'] = undefined; } } InputCommand.prototype = { @@ -503,6 +505,12 @@ InputCommand.prototype = { }, setSaveAsPath: function(data) { this['saveAsPath'] = data; + }, + getOformAsPdf: function() { + return this['oformAsPdf']; + }, + setOformAsPdf: function(data) { + this['oformAsPdf'] = data; } }; diff --git a/DocService/sources/converterservice.js b/DocService/sources/converterservice.js index 8445cb09..a1ca7f10 100644 --- a/DocService/sources/converterservice.js +++ b/DocService/sources/converterservice.js @@ -279,6 +279,7 @@ function convertRequest(req, res, isJson) { utils.fillResponse(req, res, new commonDefines.ConvertStatus(constants.CONVERT_PARAMS), isJson); return; } + let oformAsPdf; if (params.pdf) { if (true === params.pdf.pdfa && constants.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF === outputFormat) { outputFormat = constants.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDFA; @@ -288,6 +289,8 @@ function convertRequest(req, res, isJson) { if (params.pdf.form && (constants.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF === outputFormat || constants.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDFA === outputFormat)) { outputFormat = constants.AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM_PDF; + } else if (false === params.pdf.form) { + oformAsPdf = true; } } //todo use hash of params as id @@ -299,6 +302,7 @@ function convertRequest(req, res, isJson) { cmd.setFormat(filetype); cmd.setDocId(docId); cmd.setOutputFormat(outputFormat); + cmd.setOformAsPdf(oformAsPdf); let outputExt = formatChecker.getStringFromFormat(cmd.getOutputFormat()); cmd.setCodepage(commonDefines.c_oAscEncodingsMap[params.codePage] || commonDefines.c_oAscCodePageUtf8); diff --git a/FileConverter/sources/converter.js b/FileConverter/sources/converter.js index 224fb5e9..938c7b8d 100644 --- a/FileConverter/sources/converter.js +++ b/FileConverter/sources/converter.js @@ -133,6 +133,7 @@ function TaskQueueDataConvert(ctx, task) { this.savePassword = cmd.getSavePassword(); this.noBase64 = cmd.getNoBase64(); this.convertToOrigin = cmd.getConvertToOrigin(); + this.oformAsPdf = cmd.getOformAsPdf(); this.timestamp = new Date(); } TaskQueueDataConvert.prototype = { @@ -169,7 +170,7 @@ TaskQueueDataConvert.prototype = { xml += this.serializeXmlProp('m_bIsNoBase64', this.noBase64); xml += this.serializeXmlProp('m_sConvertToOrigin', this.convertToOrigin); xml += this.serializeLimit(ctx); - xml += this.serializeOptions(ctx, false); + xml += this.serializeOptions(ctx, false, this.oformAsPdf); xml += ''; fs.writeFileSync(fsPath, xml, {encoding: 'utf8'}); }, @@ -192,7 +193,7 @@ TaskQueueDataConvert.prototype = { return xml; }); }, - serializeOptions: function (ctx, isInJwtToken) { + serializeOptions: function (ctx, isInJwtToken, oformAsPdf) { const tenRequesFilteringAgent = ctx.getCfg('services.CoAuthoring.request-filtering-agent', cfgRequesFilteringAgent); const tenExternalRequestDirectIfIn = ctx.getCfg('externalRequest.directIfIn', cfgExternalRequestDirectIfIn); const tenExternalRequestAction = ctx.getCfg('externalRequest.action', cfgExternalRequestAction); @@ -231,6 +232,9 @@ TaskQueueDataConvert.prototype = { if (proxyHeadersStr.length > 0) { xml += this.serializeXmlProp('proxyHeader', proxyHeadersStr.join(';')); } + if (undefined !== oformAsPdf) { + xml += this.serializeXmlProp('oformAsPdf', oformAsPdf); + } xml += ''; return xml; },