{"id":405,"date":"2023-11-20T16:05:08","date_gmt":"2023-11-20T08:05:08","guid":{"rendered":""},"modified":"2025-01-22T10:23:11","modified_gmt":"2025-01-22T02:23:11","slug":"article-slug-314","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=405","title":{"rendered":"\u5982\u4f55\u4f7f\u7528JavaScript\u83b7\u53d6\u6216\u8bbe\u7f6ePDF\u6ce8\u91ca\u7684\u5c5e\u6027\uff1f"},"content":{"rendered":"\n<p>\u5982\u679c\u60a8\u60f3\u8981\u901a\u8fc7JavaScript\u83b7\u53d6\u6216\u8005\u8bbe\u7f6ePDF\u6ce8\u91ca\u7684\u5c5e\u6027\u3002\u4f8b\u5982\uff1astrokeColor\u3001fillColor\u3001readOnly\u3001rect\u3001type\u3002<\/p>\n\n\n\n<p>\u5efa\u8bae\u60a8\u53c2\u8003\u5982\u4e0b\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-body-font-family has-medium-font-size\"><code>\/\/ \u83b7\u53d6\u6ce8\u89e3\u7684\u5c5e\u6027.\n\nJavaScriptAction javascipt_action = new JavaScriptAction(Action.create(form.getDocument(),\n\nAction.e_TypeJavaScript));\n\njavascipt_action.setScript(\"var ann = this.getAnnot(0, \\\" UniqueID \\\"); if (ann != null) { console.println(\\\"Found it!\n\ntype: \\\" + ann.type); console.println(\\\"readOnly: \\\" + ann.readOnly); console.println(\\\"strokeColor: \\\" +\n\nann.strokeColor);console.println(\\\"fillColor: \\\" + ann.fillColor); console.println(\\\"rect: \\\" + ann.rect);}\");\n\nAdditionalAction aa = new AdditionalAction(field);\n\naa.setAction(AdditionalAction.e_TriggerAnnotCursorEnter, javascipt_action);\n\naa.doJSAction(AdditionalAction.e_TriggerAnnotCursorEnter);\n\n\/\/ \u8bbe\u7f6e\u6ce8\u91ca\u5c5e\u6027(\u4ec5\u4ee5strokeColor\u4e3a\u4f8b).\n\nJavaScriptAction javascipt_action1 = new JavaScriptAction(Action.create(form.getDocument(),\n\nAction.e_TypeJavaScript));\n\njavascipt_action1.setScript(\"var ann = this.getAnnot(0, \\\"UniqueID\\\"); if (ann != null) { ann.strokeColor =\n\ncolor.blue; }\");\n\nAdditionalAction aa1 = new AdditionalAction(field1);\n\naa1.setAction(AdditionalAction.e_TriggerAnnotCursorEnter, javascipt_action1);\n\naa1.doJSAction(AdditionalAction.e_TriggerAnnotCursorEnter);<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u60a8\u60f3\u8981\u901a\u8fc7JavaScript\u83b7\u53d6\u6216\u8005\u8bbe\u7f6ePDF\u6ce8\u91ca\u7684\u5c5e\u6027\u3002\u4f8b\u5982\uff1astrokeColor\u3001fillColo [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[212,215,214],"class_list":["post-405","post","type-post","status-publish","format-standard","hentry","category-gsdk","tag-javascript","tag-pdf"],"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\/405","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=405"}],"version-history":[{"count":2,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/405\/revisions"}],"predecessor-version":[{"id":4235,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/405\/revisions\/4235"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}