{"id":6187,"date":"2025-07-29T11:15:30","date_gmt":"2025-07-29T03:15:30","guid":{"rendered":"https:\/\/support.fuxinsoft.cn\/?p=6187"},"modified":"2025-08-06T15:57:41","modified_gmt":"2025-08-06T07:57:41","slug":"websdk%e7%82%b9%e5%87%bbpdf%e6%ad%a3%e6%96%87%e5%90%8e%ef%bc%8c%e5%bf%ab%e9%80%9f%e8%bf%9b%e5%85%a5%e7%bc%96%e8%be%91%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=6187","title":{"rendered":"\u300cWebSDK\u9ad8\u6548\u4ea4\u4e92\u300d\u4e00\u952e\u8fdb\u5165PDF\u6b63\u6587\u7f16\u8f91\u6a21\u5f0f\u7684\u6280\u672f\u5b9e\u73b0"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"6187\" class=\"elementor elementor-6187\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2479449b e-flex e-con-boxed e-con e-parent\" data-id=\"2479449b\" 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-603765c0 elementor-widget elementor-widget-text-editor\" data-id=\"603765c0\" 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>\u5728\u5e38\u89c4WebSDK\u4f7f\u7528\u4e2d\uff0c\u7528\u6237\u9700\u53cd\u590d\u5207\u6362\u5de5\u5177\uff08\u5982\u6587\u672c\u9009\u62e9\/\u6807\u6ce8\u5de5\u5177\uff09\u624d\u80fd\u7f16\u8f91PDF\u5185\u5bb9\uff0c\u64cd\u4f5c\u7e41\u7410\u3002\u672c\u6587\u63d0\u4f9b\u4e00\u79cd\u667a\u80fd\u5224\u65adPDF\u6b63\u6587\u5bf9\u8c61\u5e76\u81ea\u52a8\u5207\u6362\u7f16\u8f91\u6a21\u5f0f\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u901a\u8fc7\u5750\u6807\u8f6c\u6362\u4e0e\u5bf9\u8c61\u68c0\u6d4b\uff0c\u5b9e\u73b0\u70b9\u51fb\u6b63\u6587\u76f4\u63a5\u7f16\u8f91\u7684\u9ad8\u6548\u4ea4\u4e92\u3002<\/p>\n<p>\u6280\u672f\u5b9e\u73b0\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u4e8b\u4ef6\u76d1\u542c\uff1a\u6355\u83b7\u9875\u9762\u70b9\u51fb\u4e8b\u4ef6\uff0c\u83b7\u53d6\u7528\u6237\u64cd\u4f5c\u610f\u56fe<\/p>\n<p>2. \u5750\u6807\u6620\u5c04\uff1a\u5c06\u5c4f\u5e55\u5750\u6807\u8f6c\u6362\u4e3aPDF\u6587\u6863\u5750\u6807\u7cfb<\/p>\n<p>3. \u5bf9\u8c61\u68c0\u6d4b\uff1a\u57fa\u4e8e\u5750\u6807\u5b9a\u4f4d\u547d\u4e2d\u533a\u57df\u5185\u7684GraphicsObject<\/p>\n<p>4. \u6a21\u5f0f\u5207\u6362\uff1a\u52a8\u6001\u6fc0\u6d3b\u5bf9\u5e94\u7f16\u8f91\u5de5\u5177\uff0c\u65e0\u9700\u624b\u52a8\u5207\u6362<\/p>\n<p>\u6838\u5fc3\u4ef7\u503c\uff1a<\/p>\n<p>\u26a1\ufe0f \u51cf\u5c1150%\u4ee5\u4e0a\u64cd\u4f5c\u6b65\u9aa4\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c<\/p>\n<p>\ud83c\udfaf \u7cbe\u51c6\u8bc6\u522b\u53ef\u7f16\u8f91\u5bf9\u8c61\uff08\u6587\u672c\/\u56fe\u5f62\/\u6807\u6ce8\uff09<\/p>\n<p>\ud83d\udcbb \u4ee3\u7801\u8f7b\u91cf\uff0c\u53ef\u5feb\u901f\u96c6\u6210\u81f3\u73b0\u6709WebSDK\u9879\u76ee<\/p>\n<p>\u9002\u7528\u573a\u666f\uff1a<br \/>\u5728\u7ebf\u6587\u6863\u7f16\u8f91\u3001\u7535\u5b50\u5408\u540c\u7b7e\u7f72\u3001\u6559\u80b2\u6279\u6ce8\u7cfb\u7edf\u7b49PDF\u4ea4\u4e92\u573a\u666f<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><\/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-2c58870 e-flex e-con-boxed e-con e-parent\" data-id=\"2c58870\" 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-9893b91 elementor-widget elementor-widget-code-highlight\" data-id=\"9893b91\" 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-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>pdfui.eventEmitter.on(PDFViewCtrl.constants.ViewerEvents.tapPage, async (e) =&gt; {\n    console.log(\"\u89e6\u53d1\u70b9\u51fb\u9875\u9762\u7684\u76d1\u542c\u4e8b\u4ef6:\", e);\n    var clientPointX = e.srcEvent.clientX;\/\/\u957f\u6309\u9875\u9762\u63a5\u89e6\u70b9\u7684\u6a2a\u5750\u6807\uff08\u8bbe\u5907\u5750\u6807\u7cfb\uff09\n    var clientPointY = e.srcEvent.clientY;\/\/\u957f\u6309\u9875\u9762\u63a5\u89e6\u70b9\u7684\u7eb5\u5750\u6807\uff08\u8bbe\u5907\u5750\u6807\u7cfb\uff09\n    console.log(\"\u8bbe\u5907\u5750\u6807\u7cfb\u4e2d\u7684\u8be5\u70b9\u5750\u6807(x,y):\", clientPointX, clientPointY);\n    \/\/\u5c06\u8bbe\u5907\u5750\u6807\u7cfb\u7684\u70b9\u5750\u6807\u8f6c\u6362\u4e3aPDF\u5750\u6807\u7cfb\u7684\u70b9\u5750\u6807\n    var point = await pdfui.convertClientCoordToPDFCoord({\n        clientX: clientPointX,\n        clientY: clientPointY\n    })\n    console.log(point);\n    var p = [point.left, point.top];\n    var doc = await pdfui.getCurrentPDFDoc();\n    var page = await doc.getPageByIndex(point.index)\n    const pageObj = await page.getGraphicsObjectAtPoint(p, 0, PDFViewCtrl.PDF.constant.Graphics_ObjectType.Text);\n    if(pageObj)\n    {\n        console.log(pageObj);\n        pdfui.getAddonInstance('PageEditor').then(pageEditor =&gt; {\n            if (pageEditor) {\n                pageEditor.activate('Text');\n            } else {\n                console.error(\"PageEditor Addon instance not found.\");\n            }\n        });\n    }\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>\u5728\u5e38\u89c4WebSDK\u4f7f\u7528\u4e2d\uff0c\u7528\u6237\u9700\u53cd\u590d\u5207\u6362\u5de5\u5177\uff08\u5982\u6587\u672c\u9009\u62e9\/\u6807\u6ce8\u5de5\u5177\uff09\u624d\u80fd\u7f16\u8f91PDF\u5185\u5bb9\uff0c\u64cd\u4f5c\u7e41\u7410\u3002\u672c\u6587\u63d0\u4f9b\u4e00\u79cd [&hellip;]<\/p>\n","protected":false},"author":33,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[902,898,595,714,901,166,872],"class_list":["post-6187","post","type-post","status-publish","format-standard","hentry","category-websdk","tag-graphicsobject","tag-pdf","tag-websdk","tag-714","tag-901","tag-166","tag-872"],"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\/6187","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\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6187"}],"version-history":[{"count":14,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/6187\/revisions"}],"predecessor-version":[{"id":6327,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/6187\/revisions\/6327"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}