{"id":647,"date":"2025-04-21T13:13:06","date_gmt":"2025-04-21T05:13:06","guid":{"rendered":"https:\/\/znl.pub\/?p=647"},"modified":"2025-04-21T13:13:06","modified_gmt":"2025-04-21T05:13:06","slug":"%e3%80%90%e5%ae%98%e6%96%b9%e9%80%94%e5%be%84%e3%80%91%e5%9b%bd%e5%ae%b6%e6%a0%87%e5%87%86%e6%9f%a5%e8%af%a2%e4%b8%8e%e4%b8%8b%e8%bd%bd","status":"publish","type":"post","link":"https:\/\/znl.pub\/?p=647","title":{"rendered":"\u3010\u5b98\u65b9\u9014\u5f84\u3011\u56fd\u5bb6\u6807\u51c6\u67e5\u8be2\u4e0e\u4e0b\u8f7d"},"content":{"rendered":"\n<p>\u6211\u4eec\u8981\u627e\u4e00\u4e2a\u56fd\u5bb6\u6807\u51c6\u901a\u5e38\u4f1a\u6c42\u52a9\u4e8e\u641c\u7d22\u5f15\u64ce\uff0c\u7136\u800c\u641c\u7d22\u5f15\u64ce\u7ed9\u6211\u4eec\u63a8\u8350\u7684\u4e0d\u662fXX\u6587\u5e93\u5c31\u662fXX\u7f51\u7ad9\uff0c\u90fd\u662f\u9700\u8981\u4f60\u4ed8\u8d39\u7684\uff0c\u7279\u522b\u5783\u573e\u3002\u5b9e\u9645\u4e0a\u56fd\u5bb6\u5bf9\u4e8e\u56fd\u5bb6\u6807\u51c6\u662f\u6709\u7edf\u4e00\u7684\u67e5\u8be2\u670d\u52a1\u5e73\u53f0\u7684\uff0c\u5e76\u4e14\u63d0\u4f9b\u4e0b\u8f7d\u670d\u52a1\u3002\u8fd9\u4e2a\u7f51\u5740\u5c31\u662f\uff1a<a href=\"https:\/\/std.samr.gov.cn\/\">https:\/\/std.samr.gov.cn\/<\/a> \uff0c\u5168\u56fd\u6807\u51c6\u4fe1\u606f\u516c\u5171\u670d\u52a1\u5e73\u53f0\u3002\u4e0d\u7528\u6ce8\u518c\u5c31\u80fd\u67e5\u8be2\u3001\u67e5\u770b\u548c\u4e0b\u8f7d\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"121\" src=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247.png\" alt=\"\" class=\"wp-image-649\" srcset=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247.png 641w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-300x57.png 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/figure>\n<\/div>\n\n\n<p>\u4e0b\u9762\u8bb0\u5f55\u4e00\u4e0b\u64cd\u4f5c\u6d41\u7a0b\uff0c\u4ee5\u641c\u7d22 GBT-30282-2023 \u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<p>\u7b2c\u4e00\u6b65\uff0c\u8bbf\u95ee<a href=\"https:\/\/std.samr.gov.cn\/\">https:\/\/std.samr.gov.cn\/<\/a>\uff0c\u5728\u641c\u7d22\u6846\u8f93\u516530282<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"575\" src=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-2-1024x575.png\" alt=\"\" class=\"wp-image-651\" srcset=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-2-1024x575.png 1024w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-2-300x168.png 300w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-2-768x431.png 768w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-2.png 1277w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>2.\u4ece\u67e5\u8be2\u7ed3\u679c\u4e2d\u627e\u5230\u8981\u67e5\u770b\u7684\u6761\u76ee\uff0c\u70b9\u51fb\u6807\u9898\u8fdb\u5165\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"740\" src=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-1-1024x740.png\" alt=\"\" class=\"wp-image-650\" srcset=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-1-1024x740.png 1024w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-1-300x217.png 300w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-1-768x555.png 768w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-1.png 1296w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>3. \u70b9\u51fb\u5de6\u4fa7\u6d6e\u52a8\u7684\u9ec4\u8272\u6309\u94ae\uff1a \u67e5\u770b\u6587\u672c \uff0c\u4f1a\u5728\u8df3\u8f6c\u5230\u4e00\u4e2a\u65b0\u9875\u9762\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"865\" src=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-3.png\" alt=\"\" class=\"wp-image-652\" srcset=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-3.png 1008w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-3-300x257.png 300w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-3-768x659.png 768w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/figure>\n\n\n\n<p>4. \u8fd9\u4e2a\u5c31\u662f\u6700\u7ec8\u7684\u5728\u7ebf\u9884\u89c8\u4e0e\u4e0b\u8f7d\u7684\u6309\u94ae\u4e86\u3002\u70b9\u51fb\u540e\u4f1a\u5f39\u7a97\u4e00\u4e2a\u5bf9\u8bdd\u6846\u8981\u6c42\u8f93\u5165\u9a8c\u8bc1\u7801\uff08\u56fe\u7247\u9a8c\u8bc1\u7801\uff09\u3002\u8f93\u5165\u5b8c\u9a8c\u8bc1\u7801\u5c31\u53ef\u4ee5\u67e5\u770b\u548c\u4e0b\u8f7d\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"589\" src=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-4-1024x589.png\" alt=\"\" class=\"wp-image-653\" srcset=\"https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-4-1024x589.png 1024w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-4-300x173.png 300w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-4-768x442.png 768w, https:\/\/znl.pub\/wp-content\/uploads\/2025\/04\/\u56fe\u7247-4.png 1249w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<!--nextpage-->\n\n\n\n<p>\u4e0b\u9762\u8bb0\u5f55\u4e00\u6bb5\u6d4f\u89c8\u5668\u63a7\u5236\u53f0\u8fd0\u884c\u7684\u4ee3\u7801\uff0c\u5c06\u7f51\u9875\u5143\u7d20\u8f6c\u53d8\u6210pdf\u6587\u6863\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ 1. \u52a0\u8f7d\u5fc5\u8981\u7684\u5e93\nfunction loadScript(url) {\n  return new Promise((resolve, reject) => {\n    const script = document.createElement('script');\n    script.src = url;\n    script.onload = resolve;\n    script.onerror = reject;\n    document.head.appendChild(script);\n  });\n}\n\nasync function init() {\n\n   document.getElementById('viewer').style = '';\n  \/\/ \u68c0\u67e5\u662f\u5426\u5df2\u52a0\u8f7dhtml2canvas\n  if (typeof html2canvas === 'undefined') {\n    await loadScript('https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/html2canvas\/1.4.1\/html2canvas.min.js');\n  }\n  \n  \/\/ \u68c0\u67e5\u662f\u5426\u5df2\u52a0\u8f7djsPDF\n  if (typeof window.jspdf === 'undefined') {\n    await loadScript('https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jspdf\/2.5.1\/jspdf.umd.min.js');\n  }\n  \n  \/\/ 2. \u9009\u62e9\u8981\u5bfc\u51fa\u7684DOM\u5143\u7d20 - \u4f7f\u7528.page\u9009\u62e9\u5668\n  const elements = Array.from(document.querySelectorAll('.page'));\n  if (elements.length === 0) {\n    console.error('\u6ca1\u6709\u627e\u5230.page\u7c7b\u7684\u5143\u7d20\uff0c\u8bf7\u68c0\u67e5\u9875\u9762\u7ed3\u6784');\n    return;\n  }\n  \n  \/\/ 3. \u521b\u5efaPDF\u6587\u6863\n  const { jsPDF } = window.jspdf;\n  const pdf = new jsPDF({\n    orientation: 'portrait',\n    unit: 'mm'\n  });\n  \n  \/\/ 4. \u9010\u4e2a\u5904\u7406DOM\u5143\u7d20\n  for (let i = 0; i &lt; elements.length; i++) {\n    const element = elements&#91;i];\n    \n    try {\n      \/\/ \u5c06DOM\u5143\u7d20\u8f6c\u6362\u4e3acanvas\n      const canvas = await html2canvas(element, {\n        scale: 1, \/\/ \u63d0\u9ad8\u5206\u8fa8\u7387\n        logging: true,\n        allowTaint: true,\n        scrollX: 0,\n        scrollY: 0,\n        \/\/ \u6dfb\u52a0\u66f4\u591a\u914d\u7f6e\u4ee5\u786e\u4fdd.page\u5143\u7d20\u6b63\u786e\u6e32\u67d3\n        windowWidth: element.scrollWidth,\n        windowHeight: element.scrollHeight\n      });\n      \n      \/\/ \u5c06canvas\u8f6c\u6362\u4e3a\u56fe\u50cf\u6570\u636e\n      const imgData = canvas.toDataURL('image\/jpeg', 1.0);\n      \n      \/\/ \u8ba1\u7b97PDF\u9875\u9762\u5c3a\u5bf8\n      const imgWidth = pdf.internal.pageSize.getWidth();\n      const imgHeight = (canvas.height * imgWidth) \/ canvas.width;\n      \n      \/\/ \u5982\u679c\u4e0d\u662f\u7b2c\u4e00\u9875\uff0c\u6dfb\u52a0\u65b0\u9875\n      if (i > 0) {\n        pdf.addPage();\n      }\n      \n      \/\/ \u6dfb\u52a0\u56fe\u50cf\u5230PDF\n      pdf.addImage(imgData, 'JPEG', 0, 0, imgWidth, imgHeight);\n      \n      console.log(`\u5df2\u5904\u7406\u7b2c ${i + 1}\/${elements.length} \u4e2a.page\u5143\u7d20`);\n    } catch (error) {\n      console.error(`\u5904\u7406\u7b2c ${i + 1} \u4e2a.page\u5143\u7d20\u65f6\u51fa\u9519:`, error);\n    }\n  }\n  \n  \/\/ 5. \u4fdd\u5b58PDF\u6587\u4ef6\n  pdf.save('pages_export.pdf');\n  console.log('PDF\u5bfc\u51fa\u5b8c\u6210\uff0c\u5305\u542b', elements.length, '\u4e2a\u9875\u9762');\n}\n\n\/\/ \u6267\u884c\u521d\u59cb\u5316\ninit().catch(console.error);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u8981\u627e\u4e00\u4e2a\u56fd\u5bb6\u6807\u51c6\u901a\u5e38\u4f1a\u6c42\u52a9\u4e8e\u641c\u7d22\u5f15\u64ce\uff0c\u7136\u800c\u641c\u7d22\u5f15\u64ce\u7ed9\u6211\u4eec\u63a8\u8350\u7684\u4e0d\u662fXX\u6587\u5e93\u5c31\u662fXX\u7f51\u7ad9\uff0c\u90fd\u662f\u9700\u8981\u4f60\u4ed8\u8d39\u7684\uff0c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-647","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/znl.pub\/index.php?rest_route=\/wp\/v2\/posts\/647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/znl.pub\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/znl.pub\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/znl.pub\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/znl.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=647"}],"version-history":[{"count":1,"href":"https:\/\/znl.pub\/index.php?rest_route=\/wp\/v2\/posts\/647\/revisions"}],"predecessor-version":[{"id":654,"href":"https:\/\/znl.pub\/index.php?rest_route=\/wp\/v2\/posts\/647\/revisions\/654"}],"wp:attachment":[{"href":"https:\/\/znl.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/znl.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/znl.pub\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}