{"id":5952,"date":"2025-07-09T15:08:10","date_gmt":"2025-07-09T07:08:10","guid":{"rendered":"https:\/\/support.fuxinsoft.cn\/?p=5952"},"modified":"2025-07-09T15:41:13","modified_gmt":"2025-07-09T07:41:13","slug":"%e4%b8%93%e4%b8%9a%e8%8e%b7%e5%8f%96%e5%bd%93%e5%89%8d%e9%a1%b5%e9%9d%a2%e6%88%aa%e5%9b%be%e7%9a%84%e6%8a%80%e6%9c%af%e5%ae%9e%e7%8e%b0%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=5952","title":{"rendered":"\u4e13\u4e1a\u83b7\u53d6\u5f53\u524d\u9875\u9762\u622a\u56fe\u7684\u6280\u672f\u5b9e\u73b0\u65b9\u6848"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"5952\" class=\"elementor elementor-5952\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-23c1f58 e-flex e-con-boxed e-con e-parent\" data-id=\"23c1f58\" 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-dfaaf6f elementor-widget elementor-widget-text-editor\" data-id=\"dfaaf6f\" 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>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u7f16\u7a0b\u65b9\u5f0f\u83b7\u53d6PDF\u6587\u6863\u5f53\u524d\u9875\u9762\u7684\u7cbe\u786e\u622a\u56fe\u3002\u5982\u4e0b\u4ee3\u7801\u5b9e\u73b0\u57fa\u4e8ePDF\u6e32\u67d3\u5f15\u64ce\uff0c\u901a\u8fc7\u8bbe\u5907\u5750\u6807\u8f6c\u6362\u548c\u9ad8\u7cbe\u5ea6\u533a\u57df\u6355\u83b7\u6280\u672f\uff0c\u786e\u4fdd\u83b7\u53d6\u7684\u622a\u56fe\u4e0e\u53ef\u89c6\u5316\u5185\u5bb9\u4e00\u81f4\u3002<\/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-c4c3401 e-flex e-con-boxed e-con e-parent\" data-id=\"c4c3401\" 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-fcf7365 elementor-widget elementor-widget-code-highlight\" data-id=\"fcf7365\" 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 word-wrap\">\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>async function snapCurrentPage() {\r\n    var docRender = await pdfui.getPDFDocRender();\r\n\r\n    var curPageIndex = docRender.currentPageNumber;\r\n\r\n    var curPageRender = docRender.pagesRender.pageRenders[docRender.currentPageNumber];\r\n\r\n\r\n    \/\/\u83b7\u53d6\u5f53\u524d\u9875\u9762\u6e32\u67d3\u5c42\u7684\u7f29\u653e\u6bd4\u4f8b\u53ca\u65cb\u8f6c\u89d2\u5ea6\r\n    var scaleNum = curPageRender.scale;\r\n    var RotationAngle = curPageRender.rotate;\r\n    var curPageRect = {\r\n        left: 0,\r\n        bottom: 0,\r\n        right: curPageRender.page.info.width,\r\n        top: curPageRender.page.info.height\r\n    }\r\n    console.log(\"scaleNum:\", scaleNum, \"RotationAngle:\", RotationAngle, \"curPageRect:\", curPageRect);\r\n    \/\/\u5c06\u5f53\u524d\u9875\u9762\u533a\u57df\u7684\u77e9\u5f62\u503c \u8f6c\u6362\u4e3a \u8bbe\u5907\u5750\u6807\u5f62\u5f0f\r\n    var devRect = curPageRender.page.getDeviceRect(curPageRect, scaleNum,RotationAngle);\r\n    console.log(devRect);\r\n\r\n    pdfui.takeSnapshot(curPageIndex, devRect.left, devRect.top, devRect.right, devRect.bottom).then(blob =&gt; {\r\n        console.log(blob);\r\n        const url = URL.createObjectURL(blob);\r\n        console.log(url);\r\n        let link = document.createElement('a');\r\n        link.style.display = 'none';\r\n        link.href = url;\r\n        link.setAttribute('download', \"test\");\r\n        document.body.appendChild(link);\r\n        link.click();\r\n        URL.revokeObjectURL(link.href); \/\/ \u91ca\u653eURL \u5bf9\u8c61\r\n        document.body.removeChild(link);\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>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u7f16\u7a0b\u65b9\u5f0f\u83b7\u53d6PDF\u6587\u6863\u5f53\u524d\u9875\u9762\u7684\u7cbe\u786e\u622a\u56fe\u3002\u5982\u4e0b\u4ee3\u7801\u5b9e\u73b0\u57fa\u4e8ePDF\u6e32\u67d3\u5f15\u64ce\uff0c\u901a\u8fc7\u8bbe\u5907\u5750\u6807\u8f6c\u6362 [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[859,857,860,861,642,619,858,396],"class_list":["post-5952","post","type-post","status-publish","format-standard","hentry","category-websdk","tag-blob","tag-pdf","tag-takesnapshot","tag-861","tag-642","tag-619","tag-858","tag-396"],"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\/5952","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\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5952"}],"version-history":[{"count":15,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/5952\/revisions"}],"predecessor-version":[{"id":6110,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/5952\/revisions\/6110"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}