{"id":3088,"date":"2024-10-17T14:02:09","date_gmt":"2024-10-17T06:02:09","guid":{"rendered":"https:\/\/support.foxitsoftware.cn\/?p=3088"},"modified":"2025-05-16T15:19:01","modified_gmt":"2025-05-16T07:19:01","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e8%87%aa%e5%ae%9a%e4%b9%89%e7%bb%84%e4%bb%b6%e4%b8%8a%e6%a0%a1%e9%aa%8c-pdf-%e6%b3%a8%e9%87%8a%e6%9d%83%e9%99%90%e5%92%8c%e8%a7%86%e5%9b%be%e6%b3%a8%e9%87%8a","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=3088","title":{"rendered":"\u5982\u4f55\u5728\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e0a\u6821\u9a8c\u00a0PDF\u00a0\u6ce8\u91ca\u6743\u9650\u548c\u89c6\u56fe\u6ce8\u91ca\u6743\u9650\uff1f"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3088\" class=\"elementor elementor-3088\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-434ea3fd e-flex e-con-boxed e-con e-parent\" data-id=\"434ea3fd\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-70f572ee elementor-widget elementor-widget-text-editor\" data-id=\"70f572ee\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e0a\u9a8c\u8bc1\u00a0PDF\u00a0\u6ce8\u91ca\u6743\u9650\u548c\u89c6\u56fe\u6ce8\u91ca\u6743\u9650\u3002\u8fd9\u6837\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406\u548c\u63a7\u5236\u4e0d\u540c\u6ce8\u91ca\u7684\u6743\u9650\u8bbe\u7f6e\u3002<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>\u5982\u4e0b\u4ee3\u7801\u6f14\u793a\u4e86\u5982\u4f55\u5728\u65b0\u6dfb\u52a0\u7684\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e0a\u9a8c\u8bc1\u6ce8\u91ca\u6743\u9650\u3002<code>\n<\/code><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code {\"fontSize\":\"medium\",\"fontFamily\":\"body\"} --><\/p>\n<p><!-- \/wp:code --><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-231ee71 e-flex e-con-boxed e-con e-parent\" data-id=\"231ee71\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-efa6b9a elementor-widget elementor-widget-code-highlight\" data-id=\"efa6b9a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>var pdfui = new PDFUI({\r\n    \/\/ \u81ea\u5b9a\u4e49\u65b0\u589e\u4e00\u4e2a\u5220\u9664 annotation \u7684\u7ec4\u4ef6\r\n    fragments: [{\r\n        target: 'hand-tool',\r\n        template: 'button behind of hand-tool',\r\n        action: UIExtension.UIConsts.FRAGMENT_ACTION.AFTER,\r\n        config: [{\r\n            target: 'cus-delete-button',\r\n            callback: PDFViewCtrl.shared.createClass({\r\n                mounted: function () {\r\n                    this.permissionHandler();\r\n                },\r\n                permissionHandler() {\r\n                    const Events = UIExtension.UIEvents;\r\n                    let permissionHandler = async () =&gt; {\r\n                        const docRender = await pdfui.getPDFDocRender();\r\n                        \/\/ \u83b7\u53d6 PDF \u6ce8\u91ca\u6743\u9650\r\n                        const userPermission = docRender.getUserPermission().getValue();\r\n                        const {AnnotForm} = UIExtension.PDFViewCtrl.Consts.PDFDocPermission;\r\n                        this.hasAnnotForm = (userPermission &amp; AnnotForm) === AnnotForm;\r\n                        \/\/ \u662f\u5426\u7981\u7528\u6b64\u7ec4\u4ef6\r\n                        this.component[this.hasAnnotForm ? 'enable' : 'disable']();\r\n                    }\r\n                    this.addDestroyHook(\r\n                        pdfui.addViewerEventListener(Events.openFileSuccess, permissionHandler),\r\n                        pdfui.addViewerEventListener(Events.permissionChanged, permissionHandler),\r\n                        pdfui.addViewerEventListener(Events.activeAnnotation, async annotRender =&gt; {\r\n                            \/\/ \u83b7\u53d6\u6fc0\u6d3b\u7684 annotation\r\n                            const annot = annotRender.getAnnot();\r\n                            const pdfViewer = await pdfui.getPDFViewer();\r\n                            \/\/ \u83b7\u53d6 AnnotationAuthorityManager \u7ba1\u7406\u5668\r\n                            const annotAuthMgr = pdfViewer.getAnnotAuthorityManager();\r\n                            \/\/ \u83b7\u53d6\u6307\u5b9a annotation \u7684\u89c6\u56fe\u6ce8\u91ca\u6743\u9650\r\n                            const annotPermission = await annotAuthMgr.getPermission(annot);\r\n                            \/\/ \u662f\u5426\u53ef\u4ee5\u5220\u9664 annot\r\n                            const isDeleteAble = annotPermission.isDeletable();\r\n                            \/\/ \u662f\u5426\u7981\u7528\u6b64\u7ec4\u4ef6\r\n                            this.component[isDeleteAble &amp;&amp; this.hasAnnotForm ? 'enable' : 'disable']();\r\n                        })\r\n                    )\r\n                }\r\n            }, UIExtension.Controller)\r\n        }]\r\n    }]\r\n});<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e0a\u9a8c\u8bc1\u00a0PDF\u00a0\u6ce8\u91ca\u6743\u9650\u548c\u89c6\u56fe\u6ce8\u91ca\u6743\u9650\u3002\u8fd9\u6837\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406\u548c\u63a7\u5236\u4e0d\u540c\u6ce8\u91ca\u7684\u6743\u9650\u8bbe [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[],"class_list":["post-3088","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\/3088","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\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3088"}],"version-history":[{"count":11,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/3088\/revisions"}],"predecessor-version":[{"id":5320,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/3088\/revisions\/5320"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}