{"id":207,"date":"2023-06-01T16:06:57","date_gmt":"2023-06-01T08:06:57","guid":{"rendered":""},"modified":"2025-01-02T17:05:41","modified_gmt":"2025-01-02T09:05:41","slug":"article-slug-4","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=207","title":{"rendered":"\u5982\u4f55\u914d\u7f6e\u67e5\u770b\u8005\u548c\u6587\u6863\u7684\u6743\u9650\uff1f"},"content":{"rendered":"<p><span style=\"font-family:\u7b49\u7ebf\">\u5728\u5b9e\u9645\u7684\u5e94\u7528\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u5f80\u5f80\u9700\u8981\u5bf9\u67e5\u770b\u8005\u6216\u8005\u6587\u6863\u672c\u8eab\u914d\u7f6e\u4e00\u4e9b\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u8fd9\u7bc7\u6587\u7ae0\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728<\/span> WebPDF SDK <span style=\"font-family:\u7b49\u7ebf\">\u4e2d\u914d\u7f6e\u8fd9\u4e9b\u6743\u9650\u3002<\/span><\/p>\n<p><strong><span style=\"font-family:\u7b49\u7ebf\">\u67e5\u770b\u8005\u6743\u9650\u8bbe\u7f6e<\/span><\/strong><\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:.25in\"><span style=\"font-family:Symbol\"><img decoding=\"async\" width=\"12\" height=\"12\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2023\/06\/d59ce88ff93dfc36bec7ee6ffa077e83.gif\" alt=\"*\" word_img=\"file:\/\/\/C:\/Users\/Ivy\/AppData\/Local\/Temp\/msohtmlclip1\/01\/clip_image001.png\" style=\"background:url(https:\/\/help.foxitsoftware.cn\/csh\/resource\/default\/js\/ueditor\/themes\/default\/images\/word.gif) no-repeat center center;border:1px solid #ddd\"\/><span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family:\u7b49\u7ebf\">\u67e5\u770b\u8005\u7684\u6587\u6863\u6743\u9650<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u6211\u4eec\u53ef\u4ee5\u5728\u521d\u59cb\u5316<\/span>PDFUI<span style=\"font-family:\u7b49\u7ebf\">\u6216<\/span>PDFViewer<span style=\"font-family:\u7b49\u7ebf\">\u65f6\uff0c\u5728<\/span>viewerOptions<span style=\"font-family:\u7b49\u7ebf\">\u53c2\u6570\u4e2d\u914d\u7f6e\u67e5\u770b\u5668\u76f8\u5173\u7684\u6743\u9650\uff0c\u5e76\u901a\u8fc7<\/span>API getDocPermissions<span style=\"font-family:\u7b49\u7ebf\">\u6765\u5b9e\u73b0\u63a7\u5236\u7684\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u60a8\u53ef\u4ee5\u53c2\u8003<\/span> API <span style=\"font-family:\u7b49\u7ebf\">\u53c2\u8003\u4e2d\u7684<\/span> PDFViewCtrl.PDF.constant.User_Permissions <span style=\"font-family: \u7b49\u7ebf\">\u53bb\u83b7\u53d6\u5177\u4f53\u6743\u9650\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-left:.25in\">var pdfui = new PDFUI({<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; viewerOptions: {<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026\u2026<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; customs:{<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getDocPermissions: function () {<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/you can operate text annotations, fill in interactive form fields and print the document.<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return PDFViewCtrl.PDF.constant.User_Permissions.annotForm | PDFViewCtrl.PDF.constant.User_Permissions.print<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026\u2026<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:.25in\"><span style=\"font-family:Symbol\"><img decoding=\"async\" width=\"12\" height=\"12\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2023\/06\/d59ce88ff93dfc36bec7ee6ffa077e83.gif\" alt=\"*\" word_img=\"file:\/\/\/C:\/Users\/Ivy\/AppData\/Local\/Temp\/msohtmlclip1\/01\/clip_image001.png\" style=\"background:url(https:\/\/help.foxitsoftware.cn\/csh\/resource\/default\/js\/ueditor\/themes\/default\/images\/word.gif) no-repeat center center;border:1px solid #ddd\"\/><span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family:\u7b49\u7ebf\">\u67e5\u770b\u8005\u7684\u6ce8\u91ca\u6743\u9650<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u914d\u7f6e\u6ce8\u91ca\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u4e0d\u540c\u7684\u65b9\u5f0f\u53ef\u4ee5\u63a7\u5236\u4e0d\u540c\u6ce8\u91ca\u7684\u76f8\u5173\u6743\u9650\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u5176\u4e00\u3002<\/span><\/p>\n<p class=\"MsoListParagraph\">1.<span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"font-family:\u7b49\u7ebf\">\u901a\u8fc7<\/span> API getAnnotPermissions <span style=\"font-family:\u7b49\u7ebf\">\u914d\u7f6e\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u8be6\u7ec6\u6743\u9650\u503c\u8bf7\u53c2\u8003<\/span>PDFViewCtrl.constants.ANNOTATION_PERMISSION<span style=\"font-family:\u7b49\u7ebf\">\u3002<\/span><\/p>\n<p style=\"margin-left:.5in\"><span style=\"font-family: \u7b49\u7ebf\">\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-left:.5in\">var ANNOTATION_PERMISSION = PDFViewCtrl.constants.ANNOTATION_PERMISSION;<\/p>\n<p style=\"margin-left:.5in\">var pdfui = new PDFUI({<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp; viewerOptions: {<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026\u2026<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; customs:{<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getAnnotPermissions: function(annot) {<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(annot.getTitle() === userName){<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Promise.resolve(JSON.stringify([ANNOTATION_PERMISSION.fully]))<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Promise.resolve(JSON.stringify([ANNOTATION_PERMISSION.replyable]))<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp; },<\/p>\n<p style=\"margin-left:.5in\">&nbsp;&nbsp;&nbsp; \u2026\u2026<\/p>\n<p style=\"margin-left:.5in\">});<\/p>\n<p class=\"MsoListParagraph\">2.<span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"font-family:\u7b49\u7ebf\">\u901a\u8fc7\u6ce8\u91ca\u6807\u5fd7\u914d\u7f6e\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u6ce8\u91ca\u6807\u5fd7\u662f<\/span> PDF <span style=\"font-family:\u7b49\u7ebf\">\u6807\u51c6\u4e2d\u5b9a\u4e49\u7684\u4e0e\u6ce8\u91ca\u76f8\u5173\u7684\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u60a8\u53ef\u4ee5\u53c2\u8003<\/span> PDFViewCtrl.PDF.annots.constant.Annot_Flags <span style=\"font-family: \u7b49\u7ebf\">\u83b7\u53d6\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u5f53\u5f53\u524d\u7528\u6237\u4e0e\u6ce8\u89e3\u4f5c\u8005\u4e00\u81f4\u65f6\uff0c\u5c06\u62e5\u6709\u6240\u6709\u6743\u9650\uff0c\u53cd\u4e4b\u5c06\u88ab\u88ab\u5173\u95ed\u6743\u9650\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-left:.25in\">var userName = &quot;&quot;;<\/p>\n<p style=\"margin-left:.25in\">pdfui.addViewerEventListener(PDFViewCtrl.Events.tapAnnotation , function(annotRender){<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; var annot = annotRender.getAnnot();<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; pdfui.getAnnotManager(annot).then(function(annotManager) {<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var annotFlag = annotManager.getAnnotFlag(annot);<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&quot;===current annotation information<span style=\"font-family:\u7b49\u7ebf\">\uff1a<\/span>pageIndex:&quot;,annot.getPage().info.index,&quot;type:&quot;,annot.info.type,&quot;,title:&quot;,annot.info.title,&#39;<span style=\"font-family:\u7b49\u7ebf\">\uff1a<\/span>permissions&#39;);<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkHidden&#39;,annotFlag.checkHidden())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkInvisible&#39;,annotFlag.checkInvisible())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkLocked&#39;,annotFlag.checkLocked())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkLockedContents&#39;,annotFlag.checkLockedContents())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkNoRotate&#39;,annotFlag.checkNoRotate())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkNoView&#39;,annotFlag.checkNoView())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkNoZoom&#39;,annotFlag.checkNoZoom())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkPrint&#39;,annotFlag.checkPrint())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkReadOnly&#39;,annotFlag.checkReadOnly())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#39;checkToggleNoView&#39;,annotFlag.checkToggleNoView())<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdfui.redraw(true);<\/p>\n<p style=\"margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; })<\/p>\n<p style=\"margin-left:.25in\">})<\/p>\n<p style=\"margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-left:.25in\">pdfui.getUserName().then(function (name){<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; userName = name;<\/p>\n<p style=\"margin-left:.25in\">});<\/p>\n<p style=\"margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-left:.25in\">pdfui.getAnnotManager().then(function(annotManager) {<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; annotManager.setViewerAnnotFlag(function(annot) {<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(annot.getTitle() === userName){<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return PDFViewCtrl.PDF.annots.constant.Annot_Flags.locked;<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; });<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; pdfui.redraw(true);<\/p>\n<p style=\"margin-left:.25in\">});<\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family:Symbol\"><img decoding=\"async\" width=\"12\" height=\"12\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2023\/06\/d59ce88ff93dfc36bec7ee6ffa077e83.gif\" alt=\"*\" word_img=\"file:\/\/\/C:\/Users\/Ivy\/AppData\/Local\/Temp\/msohtmlclip1\/01\/clip_image001.png\" style=\"background:url(https:\/\/help.foxitsoftware.cn\/csh\/resource\/default\/js\/ueditor\/themes\/default\/images\/word.gif) no-repeat center center;border:1px solid #ddd\"\/><span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family:\u7b49\u7ebf\">\u9644\u52a0\u6743\u9650<\/span><\/p>\n<p style=\"margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u9644\u52a0\u6743\u9650\u76ee\u524d\u53ea\u652f\u6301\u4e0b\u8f7d\u6743\u9650\uff0c\u5141\u8bb8\u7528\u6237\u4e0b\u8f7d<\/span>PDF<span style=\"font-family:\u7b49\u7ebf\">\u6587\u4ef6\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605<\/span> PDFViewCtrl.PDF.constant.Additional_Permission<span style=\"font-family:\u7b49\u7ebf\">\u3002<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-left:.25in\">var pdfui = new PDFUI({<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; viewerOptions: {<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026\u2026<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; customs:{<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getAdditionalPerm:function(){<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/return 0 means no permission to download the document.<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;\u2026\u2026<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<\/p>\n<p><strong><span style=\"font-family:\u7b49\u7ebf\">\u6587\u6863\u6743\u9650\u8bbe\u7f6e<\/span><\/strong><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family:Symbol\"><img decoding=\"async\" width=\"12\" height=\"12\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2023\/06\/d59ce88ff93dfc36bec7ee6ffa077e83.gif\" alt=\"*\" word_img=\"file:\/\/\/C:\/Users\/Ivy\/AppData\/Local\/Temp\/msohtmlclip1\/01\/clip_image001.png\" style=\"background:url(https:\/\/help.foxitsoftware.cn\/csh\/resource\/default\/js\/ueditor\/themes\/default\/images\/word.gif) no-repeat center center;border:1px solid #ddd\"\/><span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family:\u7b49\u7ebf\">\u6587\u6863\u6743\u9650<\/span><\/p>\n<p style=\"margin-left:.25in\">Foxit PDF SDK for Web <span style=\"font-family:\u7b49\u7ebf\">\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u6587\u6863\u5bc6\u7801\u6765\u914d\u7f6e\u6587\u6863\u6743\u9650\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u53ef\u4ee5\u7ed9\u6587\u6863\u8bbe\u7f6e<\/span>ownerPassword<span style=\"font-family:\u7b49\u7ebf\">\uff0c\u7136\u540e\u914d\u7f6e\u6587\u6863\u76f8\u5173\u7684\u6743\u9650\u3002<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family: \u7b49\u7ebf\">\u8bf7\u53c2\u9605<\/span> API <span style=\"font-family:\u7b49\u7ebf\">\u53c2\u8003\u4e2d\u7684<\/span> PDFViewCtrl.PDF.constant.User_Permissions <span style=\"font-family: \u7b49\u7ebf\">\u4ee5\u83b7\u53d6\u7279\u5b9a\u6743\u9650\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/span> <span style=\"font-family:\u7b49\u7ebf\">\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-left:.25in\">\/\/Set the password of owner to &#39;abc&#39;, and if non-owner open the document, he only read the document. Only when owner open the document with the right password, he can do anything with the document.<\/p>\n<p style=\"margin-left:.25in\">var test = {userPassword:&#39;&#39;,ownerPassword:&#39;abc&#39;,permission:0,cipher:&#39;aes256&#39;,isEncryptMetaData:true,expected:true}<\/p>\n<p style=\"margin-left:.25in\">var pdfviewer = await pdfui.getPDFViewer();<\/p>\n<p style=\"margin-left:.25in\">var pdfdoc = await pdfviewer.getCurrentPDFDoc();<\/p>\n<p style=\"margin-left:.25in\">await pdfdoc.setPasswordAndPermission(test.userPassword,test.ownerPassword,test.permission,test.cipher,test.isEncryptMetaData);<\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family:Symbol\"><img decoding=\"async\" width=\"12\" height=\"12\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2023\/06\/d59ce88ff93dfc36bec7ee6ffa077e83.gif\" alt=\"*\" word_img=\"file:\/\/\/C:\/Users\/Ivy\/AppData\/Local\/Temp\/msohtmlclip1\/01\/clip_image001.png\" style=\"background:url(https:\/\/help.foxitsoftware.cn\/csh\/resource\/default\/js\/ueditor\/themes\/default\/images\/word.gif) no-repeat center center;border:1px solid #ddd\"\/><span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family:\u7b49\u7ebf\">\u6ce8\u91ca\u6743\u9650<\/span><\/p>\n<p style=\"margin-left:.25in\"><span style=\"font-family:\u7b49\u7ebf\">\u548c\u5982\u4e0a\u7684\u67e5\u770b\u8005\u6ce8\u89e3\u6743\u9650\u4e00\u6837\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6ce8\u89e3<\/span>flags<span style=\"font-family:\u7b49\u7ebf\">\u6765\u914d\u7f6e\u6ce8\u89e3\u7684\u6743\u9650\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-left:.25in\">var pdfViewer = await pdfui.getPDFViewer();<\/p>\n<p style=\"margin-left:.25in\">var pdfDoc = await pdfViewer.getCurrentPDFDoc();<\/p>\n<p style=\"margin-left:.25in\">var pdfPage = await pdfDoc.getPageByIndex(0);<\/p>\n<p style=\"margin-left:.25in\">\/\/Add a square annotation and set the flag to locked.<\/p>\n<p style=\"margin-left:.25in\">var annots = await pdfPage.addAnnot({<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; type:&quot;square&quot;,<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; rect:{<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; left:300,<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right:400,<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bottom:300,<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; top:400<\/p>\n<p style=\"margin-left:.25in\">&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:.25in\">})<\/p>\n<p style=\"margin-left:.25in\">annots[0].setFlags(PDFViewCtrl.PDF.annots.constant.Annot_Flags.locked);<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\"><span style=\"font-family:Symbol\"><img decoding=\"async\" width=\"12\" height=\"12\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2023\/06\/d59ce88ff93dfc36bec7ee6ffa077e83.gif\" alt=\"*\" word_img=\"file:\/\/\/C:\/Users\/Ivy\/AppData\/Local\/Temp\/msohtmlclip1\/01\/clip_image001.png\" style=\"background:url(https:\/\/help.foxitsoftware.cn\/csh\/resource\/default\/js\/ueditor\/themes\/default\/images\/word.gif) no-repeat center center;border:1px solid #ddd\"\/><span style=\"font:9px &#39;Times New Roman&#39;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family:\u7b49\u7ebf\">\u8868\u5355\u57df\u6743\u9650<\/span><\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\"><span style=\"font-family:\u7b49\u7ebf\">\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e<\/span>form field flag<span style=\"font-family: \u7b49\u7ebf\">\u6765\u914d\u7f6e<\/span>Form Field<span style=\"font-family:\u7b49\u7ebf\">\u7684\u6743\u9650\uff0c\u8be6\u89c1<\/span>PDFViewCtrl.PDF.form.constant.Field_Flag<span style=\"font-family:\u7b49\u7ebf\">\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">var pdfViewer = await pdfui.getPDFViewer();<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">var pdfdoc = await pdfViewer.getCurrentPDFDoc();<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">await pdfdoc.loadPDFForm();<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">let form = pdfdoc.getPDFForm ();<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">&nbsp;<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">var control = {pageIndex:0,fieldName:&#39;textField1&#39;,fieldType:PDFViewCtrl.PDF.form.constant.Field_Type.Text,rect:{left: 100,right: 250,top: 430,bottom: 330}};<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">var ret = await form.addControl(control.pageIndex,control.fieldName,control.fieldType,control.rect);<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">var field = await form.getField(&#39;textField1&#39;);<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">await field.setValue(&#39;123&#39;);<\/p>\n<p style=\"margin-top:16px;margin-bottom:11px;margin-left:.25in\">await field.setFlags(PDFViewCtrl.PDF.form.constant.Field_Flag.ReadOnly);<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5b9e\u9645\u7684\u5e94\u7528\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u5f80\u5f80\u9700\u8981\u5bf9\u67e5\u770b\u8005\u6216\u8005\u6587\u6863\u672c\u8eab\u914d\u7f6e\u4e00\u4e9b\u6743\u9650\u3002 \u8fd9\u7bc7\u6587\u7ae0\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728 WebPDF S [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-websdk"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","_links":{"self":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":2,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":3966,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions\/3966"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}