Browse Source

publish muk_web_preview_msoffice - 11.0

pull/122/head
MuK IT GmbH 5 years ago
parent
commit
295293a89d
  1. 2
      muk_web_preview_msoffice/controllers/main.py
  2. 13
      muk_web_preview_msoffice/static/src/js/preview_handler.js

2
muk_web_preview_msoffice/controllers/main.py

@ -50,7 +50,7 @@ class MSOfficeParserController(http.Controller):
else: else:
try: try:
filename = "%s%s" % (uuid.uuid4(), mimetypes.guess_extension(headers['content-type'])) filename = "%s%s" % (uuid.uuid4(), mimetypes.guess_extension(headers['content-type']))
output = request.env['muk_converter.converter'].convert(filename, content)
output = request.env['muk_converter.converter'].convert_raw(filename, content)
return self._make_pdf_response(output, "%s.pdf" % filename) return self._make_pdf_response(output, "%s.pdf" % filename)
except Exception: except Exception:
_logger.exception("Error while convert the file.") _logger.exception("Error while convert the file.")

13
muk_web_preview_msoffice/static/src/js/preview_handler.js

@ -117,19 +117,6 @@ var ExcelHandler = PreviewHandler.BaseHandler.extend({
var $pane = $('<div/>'); var $pane = $('<div/>');
$pane.addClass('tab-pane table-container'); $pane.addClass('tab-pane table-container');
$pane.attr('id', 'sheet-' + index); $pane.attr('id', 'sheet-' + index);
var maximum_arrs = 1;
sheet.forEach(function (arr) {
if(arr.length>maximum_arrs){
maximum_arrs = arr.length;
}
});
sheet.forEach(function (arr) {
if(arr.length<maximum_arrs){
for (var i = arr.length; i < maximum_arrs; i++) {
arr.push("");
}
}
});
$pane.handsontable({ $pane.handsontable({
data: sheet, data: sheet,
rowHeaders: true, rowHeaders: true,

Loading…
Cancel
Save