31 lines
762 B
JavaScript
31 lines
762 B
JavaScript
|
|
var EcmMultiPdf_create = function(documents, outputName) {
|
||
|
|
// fill params
|
||
|
|
var params = new Array();
|
||
|
|
params[0] = documents;
|
||
|
|
|
||
|
|
if (!(typeof outputName === 'undefined')) {
|
||
|
|
if ((outputName.toUpperCase().substring((outputName.length) - 4,
|
||
|
|
outputName.length)) != '.PDF')
|
||
|
|
outputName += '.pdf';
|
||
|
|
params[2] = outputName;
|
||
|
|
}
|
||
|
|
|
||
|
|
// AJAX call
|
||
|
|
jQuery.ajax({
|
||
|
|
type : 'POST',
|
||
|
|
url : 'index.php?entryPoint=HandleEcmAjax',
|
||
|
|
data : {
|
||
|
|
ecmclass : 'EcmMultiPdf',
|
||
|
|
job : 'create',
|
||
|
|
params : btoa(JSON.stringifyNoSecurity(params)),
|
||
|
|
},
|
||
|
|
dataType : 'json',
|
||
|
|
success : function(response) {
|
||
|
|
$.unblockUI();
|
||
|
|
if (Number.isInteger(response[0]))
|
||
|
|
alert('ERROR '+response[0]);
|
||
|
|
else
|
||
|
|
window.open(response[0]);
|
||
|
|
},
|
||
|
|
});
|
||
|
|
}
|