diff --git a/seahub/templates/snippets/file_content_js.html b/seahub/templates/snippets/file_content_js.html index 1cc9eccdba..6ef653ebc3 100644 --- a/seahub/templates/snippets/file_content_js.html +++ b/seahub/templates/snippets/file_content_js.html @@ -96,6 +96,10 @@ try { PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js'; $('#file-view').html('
'); PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) { + if (pdf.numPages > 50) { + feedback("{% trans "This file has more than 50 pages, and only the first 50 will be shown here." %}", 'info'); + } + var $loadingTip = $('#pdf .loading-tip'); // show at most 50 pages diff --git a/seahub/templates/snippets/office_convert_js.html b/seahub/templates/snippets/office_convert_js.html index 79af596c15..c0bae88725 100644 --- a/seahub/templates/snippets/office_convert_js.html +++ b/seahub/templates/snippets/office_convert_js.html @@ -63,6 +63,10 @@ OfficePreviewer.prototype.check_page_status = function() { cache: false, dataType: 'json', success: function(data) { + if (data.info.pages > data.info.final_pages) { // total pages > shown pages + feedback("{% trans "This file has more than 50 pages, and only the first 50 will be shown here." %}", 'info'); + } + var status = data['status']; switch (status) { case 'PROCESSING': diff --git a/seahub/templates/view_file_pdf.html b/seahub/templates/view_file_pdf.html index 458efc9d5b..7f291dcb6d 100644 --- a/seahub/templates/view_file_pdf.html +++ b/seahub/templates/view_file_pdf.html @@ -30,6 +30,10 @@ try { PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js'; $('#file-view').html('
'); PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) { + if (pdf.numPages > 50) { + feedback("{% trans "This file has more than 50 pages, and only the first 50 will be shown here." %}", 'info'); + } + var $loadingTip = $('#pdf .loading-tip'); // show at most 50 pages