diff --git a/apps/api/wopi/editor-wopi.ejs b/apps/api/wopi/editor-wopi.ejs index 9dcc39e4b9..d11ff5a168 100644 --- a/apps/api/wopi/editor-wopi.ejs +++ b/apps/api/wopi/editor-wopi.ejs @@ -285,6 +285,8 @@ div { var fileType = fileInfo.BaseFileName ? fileInfo.BaseFileName.substr(fileInfo.BaseFileName.lastIndexOf('.') + 1) : ""; fileType = fileInfo.FileExtension ? fileInfo.FileExtension.substr(1) : fileType; fileType = fileType.toLowerCase(); + let permissionsEdit = !fileInfo.ReadOnly && fileInfo.UserCanWrite && queryParams.formsubmit !== "1"; + let permissionsFillForm = permissionsEdit || queryParams.formsubmit === "1"; var config = { "width": "100%", "height": "100%", @@ -300,10 +302,11 @@ div { "folder": fileInfo.BreadcrumbFolderName }, "permissions": { - "edit": !fileInfo.ReadOnly && fileInfo.UserCanWrite, + "edit": permissionsEdit, "review": (fileInfo.SupportsReviewing===false) ? false : (fileInfo.UserCanReview===false ? false : fileInfo.UserCanReview), "copy": fileInfo.CopyPasteRestrictions!=="CurrentDocumentOnly" && fileInfo.CopyPasteRestrictions!=="BlockAll", - "print": !fileInfo.DisablePrint && !fileInfo.HidePrintOption + "print": !fileInfo.DisablePrint && !fileInfo.HidePrintOption, + "fillForms": permissionsFillForm }, "options": { "WOPISrc": userAuth.wopiSrc diff --git a/apps/common/checkExtendedPDF.js b/apps/common/checkExtendedPDF.js index be3c234889..abcefd98b4 100644 --- a/apps/common/checkExtendedPDF.js +++ b/apps/common/checkExtendedPDF.js @@ -30,7 +30,8 @@ * */ function checkExtendedPDF(directUrl, key, url, token, callback) { - var limit = 110; + //110 is not enough for the new PDF form + var limit = 300; if (directUrl) { downloadPartialy(directUrl, limit, null, function(text) { callback(isExtendedPDFFile(text))