{"id":224948,"date":"2024-05-11T19:51:33","date_gmt":"2024-05-11T11:51:33","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/224948.html"},"modified":"2024-05-11T19:51:40","modified_gmt":"2024-05-11T11:51:40","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python-%e5%8e%8b%e7%bc%a9pdf%e6%96%87%e4%bb%b6%e4%bb%a3%e7%a0%81%e5%88%b0%e5%9b%ba%e5%ae%9a%e5%a4%a7%e5%b0%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/224948.html","title":{"rendered":"\u5982\u4f55\u7528python \u538b\u7f29pdf\u6587\u4ef6\u4ee3\u7801\u5230\u56fa\u5b9a\u5927\u5c0f"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25144155\/ef47e5c6-479c-4425-89f5-d1ff4a736d19.webp\" alt=\"\u5982\u4f55\u7528python \u538b\u7f29pdf\u6587\u4ef6\u4ee3\u7801\u5230\u56fa\u5b9a\u5927\u5c0f\" \/><\/p>\n<p><p>\u4f7f\u7528Python\u538b\u7f29PDF\u6587\u4ef6\u5230\u56fa\u5b9a\u5927\u5c0f\u4e3b\u8981\u6d89\u53ca<strong>PyMuPDF\u3001Pillow<\/strong>\u548c<strong>PyPDF2<\/strong>\u7b49\u5e93\u3002\u8fd9\u4e9b\u5e93\u5408\u4f5c\u53ef\u4ee5\u7cbe\u7ec6\u63a7\u5236PDF\u7684\u538b\u7f29\u8fc7\u7a0b\uff0c\u5305\u62ec\u56fe\u50cf\u91cd\u538b\u7f29\u3001\u53bb\u9664\u65e0\u7528\u8d44\u6e90\u548c\u9875\u9762\u5185\u5bb9\u7684\u91cd\u7ec4\u3002\u7279\u522b\u5730\uff0cPyMuPDF\uff08\u4e5f\u79f0\u4e3afitz\uff09\u63d0\u4f9b\u4e86\u975e\u5e38\u9ad8\u6548\u7684\u8bbf\u95ee\u548c\u4fee\u6539PDF\u6587\u4ef6\u7684\u624b\u6bb5\uff0c\u662f\u8fdb\u884cPDF\u538b\u7f29\u65f6\u7684\u5173\u952e\u6280\u672f\u4e4b\u4e00\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u5e93\u8fbe\u5230\u538b\u7f29PDF\u5230\u56fa\u5b9a\u5927\u5c0f\u7684\u76ee\u6807\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5\u5fc5\u8981\u7684Python\u5e93<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u7f16\u5199\u538b\u7f29\u4ee3\u7801\u4e4b\u524d\uff0c\u9996\u5148\u786e\u4fdd\u4f60\u7684Python\u73af\u5883\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86\u4e0a\u8ff0\u63d0\u53ca\u7684\u5e93\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">pip install PyMuPDF Pillow PyPDF2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u8fd9\u4e9b\u5e93\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528Python\u811a\u672c\u8fdb\u884cPDF\u7684\u538b\u7f29\u5de5\u4f5c\u4e86\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u8bfb\u53d6PDF\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528PyMuPDF\u5e93\u6765\u8bfb\u53d6\u4f60\u5e0c\u671b\u538b\u7f29\u7684PDF\u6587\u4ef6\u3002\u901a\u8fc7\u8be5\u5e93\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u8bbf\u95eePDF\u4e2d\u7684\u6bcf\u9875\u5185\u5bb9\u3001\u56fe\u50cf\u4ee5\u53ca\u5176\u4ed6\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import fitz  # PyMuPDF<\/p>\n<p>def open_pdf(file_path):<\/p>\n<p>    document = fitz.open(file_path)<\/p>\n<p>    return document<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u56fe\u50cf\u538b\u7f29<\/h3>\n<\/p>\n<p><p>PDF\u6587\u4ef6\u4e2d\u7684\u56fe\u50cf\u662f\u6587\u4ef6\u5927\u5c0f\u7684\u4e3b\u8981\u6784\u6210\u90e8\u5206\u3002\u4f7f\u7528Pillow\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9PDF\u4e2d\u7684\u6bcf\u4e2a\u56fe\u50cf\u8fdb\u884c\u68c0\u67e5\u548c\u91cd\u538b\u7f29\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<p>import io<\/p>\n<p>def compress_image(image_stream, quality=50):<\/p>\n<p>    image = Image.open(io.BytesIO(image_stream))<\/p>\n<p>    img_byte_arr = io.BytesIO()<\/p>\n<p>    image.save(img_byte_arr, format=image.format, quality=quality)<\/p>\n<p>    return img_byte_arr.getvalue()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c<code>quality<\/code>\u53c2\u6570\u5141\u8bb8\u4f60\u6839\u636e\u9700\u8981\u8bbe\u7f6e\u8f93\u51fa\u56fe\u50cf\u8d28\u91cf\uff0c\u6570\u5b57\u8d8a\u4f4e\uff0c\u538b\u7f29\u6bd4\u8d8a\u9ad8\uff0c\u4f46\u56fe\u50cf\u8d28\u91cf\u4e5f\u4f1a\u76f8\u5bf9\u964d\u4f4e\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u91cd\u7ec4PDF\u5185\u5bb9<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5b8c\u56fe\u50cf\u540e,\u63a5\u4e0b\u6765\u7684\u6b65\u9aa4\u662f\u91cd\u7ec4PDF\u7684\u5185\u5bb9\uff0c\u79fb\u9664\u65e0\u7528\u8d44\u6e90\uff0c\u5e76\u5c06\u4e0a\u4e00\u6b65\u9aa4\u4e2d\u538b\u7f29\u540e\u7684\u56fe\u50cf\u91cd\u65b0\u5199\u5165PDF\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def recompress_pdf(document):<\/p>\n<p>    for page_num in range(len(document)):<\/p>\n<p>        page = document.load_page(page_num)<\/p>\n<p>        pix = page.get_pixmap()<\/p>\n<p>        compressed_image = compress_image(pix.tobytes())<\/p>\n<p>        page.insert_image(page.rect, stream=compressed_image)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u8f93\u51fa\u538b\u7f29\u540e\u7684PDF<\/h3>\n<\/p>\n<p><p>\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u6240\u6709\u9875\u9762\u548c\u56fe\u50cf\u90fd\u5df2\u7ecf\u6309\u7167\u6307\u5b9a\u7684\u53c2\u6570\u8fdb\u884c\u4e86\u91cd\u538b\u7f29\u3002\u73b0\u5728\u662f\u65f6\u5019\u5c06\u5904\u7406\u540e\u7684PDF\u5185\u5bb9\u8f93\u51fa\u5230\u4e00\u4e2a\u65b0\u6587\u4ef6\u4e86\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def save_compressed_pdf(document, output_path):<\/p>\n<p>    document.save(output_path, garbage=4, deflate=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e2a\u7b80\u5355\u7684\u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u4fee\u6539\u8fc7\u7684PDF\u6587\u4ef6\u4fdd\u5b58\u5230\u6307\u5b9a\u7684\u8def\u5f84\u3002<code>garbage=4, deflate=True<\/code>\u53c2\u6570\u786e\u4fddPDF\u6587\u4ef6\u5728\u4fdd\u5b58\u65f6\u8fdb\u884c\u4e86\u989d\u5916\u7684\u538b\u7f29\u4f18\u5316\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u6574\u5408\u4e0e\u6d4b\u8bd5<\/h3>\n<\/p>\n<p><p>\u5c06\u4e0a\u9762\u7684\u51fd\u6570\u6574\u5408\u5230\u4e00\u4e2a\u811a\u672c\u4e2d\uff0c\u4f60\u5c31\u53ef\u4ee5\u5f00\u59cb\u6d4b\u8bd5\u538b\u7f29PDF\u6587\u4ef6\u5230\u56fa\u5b9a\u5927\u5c0f\u7684\u6548\u679c\u4e86\u3002\u6ce8\u610f\uff0c\u5230\u8fbe\u56fa\u5b9a\u5927\u5c0f\u7684\u76ee\u6807\u53ef\u80fd\u9700\u8981\u901a\u8fc7\u8c03\u8282\u56fe\u50cf\u538b\u7f29\u54c1\u8d28\u548c\u79fb\u9664PDF\u4e2d\u66f4\u591a\u975e\u5fc5\u8981\u5185\u5bb9\u7b49\u624b\u6bb5\u591a\u6b21\u5c1d\u8bd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def compress_pdf_to_fixed_size(file_path, output_path):<\/p>\n<p>    document = open_pdf(file_path)<\/p>\n<p>    recompress_pdf(document)<\/p>\n<p>    save_compressed_pdf(document, output_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u8fdb\u9636\u4f18\u5316<\/h3>\n<\/p>\n<p><p>\u538b\u7f29PDF\u6587\u4ef6\u5230\u56fa\u5b9a\u5927\u5c0f\u662f\u4e00\u4e2a\u591a\u53d8\u91cf\u4f18\u5316\u95ee\u9898\u3002\u9664\u4e86\u4e0a\u8ff0\u63d0\u53ca\u7684\u57fa\u672c\u65b9\u6cd5\uff0c\u8fdb\u4e00\u6b65\u7684\u4f18\u5316\u53ef\u80fd\u5305\u62ec\u5b57\u4f53\u5b50\u96c6\u5316\u3001\u5220\u9664\u5143\u6570\u636e\u3001\u4f18\u5316PDF\u7ed3\u6784\u7b49\u590d\u6742\u64cd\u4f5c\u3002\u8fd9\u4e9b\u9ad8\u7ea7\u6280\u672f\u53ef\u80fd\u9700\u8981\u6839\u636e\u5177\u4f53\u7684PDF\u6587\u4ef6\u7ed3\u6784\u548c\u5185\u5bb9\u8fdb\u884c\u5b9a\u5236\u5316\u5904\u7406\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0d\u65ad\u8bd5\u9a8c\u4e0e\u4f18\u5316\uff0c\u4f60\u5c06\u80fd\u591f\u66f4\u52a0\u7cbe\u51c6\u5730\u63a7\u5236PDF\u7684\u6700\u7ec8\u5927\u5c0f\uff0c\u540c\u65f6\u4fdd\u6301\u5185\u5bb9\u7684\u5b8c\u6574\u6027\u548c\u53ef\u8bfb\u6027\u3002\u8bb0\u4f4f\uff0c\u4e0d\u540c\u7684PDF\u6587\u4ef6\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684\u5904\u7406\u7b56\u7565\uff0c\u56e0\u6b64\u4fdd\u6301\u7075\u6d3b\u548c\u521b\u65b0\u7684\u601d\u7ef4\u662f\u8fbe\u6210\u6700\u4f73\u538b\u7f29\u6548\u679c\u7684\u5173\u952e\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u5982\u4f55\u4f7f\u7528Python\u538b\u7f29PDF\u6587\u4ef6\u7684\u4ee3\u7801\uff1f<\/strong><\/p>\n<p>Python\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5e93\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u538b\u7f29PDF\u6587\u4ef6\u3002\u5176\u4e2d\u4e00\u4e2a\u5e38\u7528\u7684\u5e93\u662fPyPDF2\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">import PyPDF2\n\ndef compress_pdf(input_file, output_file, max_size):\n    with open(input_file, &#039;rb&#039;) as file:\n        pdf = PyPDF2.PdfFileReader(file)\n        \n        if pdf.filesize &gt;= max_size:\n            print(f&quot;\u539f\u59cbPDF\u6587\u4ef6\u5927\u5c0f\uff1a{pdf.filesize \/ 1024 \/ 1024} MB&quot;)\n            \n            pdf_writer = PyPDF2.PdfFileWriter()\n\n            for page_num in range(pdf.getNumPages()):\n                page = pdf.getPage(page_num)\n                page.compressContentStreams()  # \u538b\u7f29\u5185\u5bb9\u6d41\n                pdf_writer.addPage(page)\n\n            with open(output_file, &#039;wb&#039;) as output:\n                pdf_writer.write(output)\n            \n            print(f&quot;\u538b\u7f29\u540ePDF\u6587\u4ef6\u5927\u5c0f\uff1a{pdf_writer.filesize \/ 1024 \/ 1024} MB&quot;)\n        else:\n            print(&quot;PDF\u6587\u4ef6\u5df2\u7ecf\u5c0f\u4e8e\u6307\u5b9a\u5927\u5c0f\uff0c\u65e0\u9700\u538b\u7f29\u3002&quot;)\n\ncompress_pdf(&#039;input.pdf&#039;, &#039;output.pdf&#039;, 5 * 1024 * 1024)  # \u5c06input.pdf\u538b\u7f29\u52305MB\u4ee5\u5185\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4f7f\u7528PyPDF2\u5e93\u8bfb\u53d6\u8f93\u5165\u7684PDF\u6587\u4ef6\uff0c\u5e76\u68c0\u67e5\u5176\u6587\u4ef6\u5927\u5c0f\u662f\u5426\u8d85\u8fc7\u4e86\u6307\u5b9a\u7684\u5927\u5c0f\u3002\u5982\u679c\u8d85\u8fc7\u4e86\uff0c\u5b83\u5c06\u521b\u5efa\u4e00\u4e2a\u65b0\u7684PdfFileWriter\u5bf9\u8c61\uff0c\u91c7\u7528\u5185\u5bb9\u6d41\u538b\u7f29\u6280\u672f\u538b\u7f29\u6bcf\u4e2a\u9875\u9762\u7684\u5185\u5bb9\u6d41\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u65b0\u7684PDF\u6587\u4ef6\u4e2d\u3002\u6700\u540e\uff0c\u5b83\u5c06\u4fdd\u5b58\u538b\u7f29\u540e\u7684PDF\u6587\u4ef6\u3002<\/p>\n<p><strong>\u5982\u4f55\u7528Python\u538b\u7f29PDF\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5728\u7535\u5b50\u90ae\u4ef6\u4e2d\u53d1\u9001\uff1f<\/strong><\/p>\n<p>Python\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5e93\uff0c\u53ef\u4ee5\u7528\u6765\u538b\u7f29PDF\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5728\u7535\u5b50\u90ae\u4ef6\u4e2d\u53d1\u9001\u3002\u5176\u4e2d\u4e00\u4e2a\u5e38\u7528\u7684\u5e93\u662fPyPDF2\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801\u7247\u6bb5\uff1a<\/p>\n<pre><code class=\"language-python\">import PyPDF2\nimport os\n\ndef compress_pdf(input_file, output_file):\n    with open(input_file, &#039;rb&#039;) as file:\n        pdf = PyPDF2.PdfFileReader(file)\n\n        pdf_writer = PyPDF2.PdfFileWriter()\n\n        for page_num in range(pdf.getNumPages()):\n            page = pdf.getPage(page_num)\n            page.compressContentStreams()  # \u538b\u7f29\u5185\u5bb9\u6d41\n            pdf_writer.addPage(page)\n\n        with open(output_file, &#039;wb&#039;) as output:\n            pdf_writer.write(output)\n\n        print(&quot;PDF\u6587\u4ef6\u5df2\u6210\u529f\u538b\u7f29\u3002&quot;)\n\n# \u793a\u4f8b\u7528\u6cd5\uff1a\u5c06\u6587\u4ef6input.pdf\u538b\u7f29\u540e\u4fdd\u5b58\u4e3aoutput.pdf\ncompress_pdf(&#039;input.pdf&#039;, &#039;output.pdf&#039;)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4f1a\u4f7f\u7528PyPDF2\u5e93\u6253\u5f00\u8f93\u5165\u7684PDF\u6587\u4ef6\uff0c\u5e76\u5c06\u6bcf\u4e2a\u9875\u9762\u7684\u5185\u5bb9\u6d41\u538b\u7f29\u540e\uff0c\u5c06\u538b\u7f29\u540e\u7684\u9875\u9762\u6dfb\u52a0\u5230\u4e00\u4e2a\u65b0\u7684PDF\u6587\u4ef6\u4e2d\u3002\u6700\u540e\uff0c\u5b83\u5c06\u4fdd\u5b58\u538b\u7f29\u540e\u7684PDF\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u4fee\u6539\u8f93\u5165\u6587\u4ef6\u548c\u8f93\u51fa\u6587\u4ef6\u7684\u540d\u79f0\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528Python\u5c06\u591a\u4e2aPDF\u6587\u4ef6\u5408\u5e76\u5e76\u8fdb\u884c\u538b\u7f29\uff1f<\/strong><\/p>\n<p>Python\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5e93\uff0c\u53ef\u4ee5\u7528\u6765\u5408\u5e76\u548c\u538b\u7f29\u591a\u4e2aPDF\u6587\u4ef6\u3002\u5176\u4e2d\u4e00\u4e2a\u5e38\u7528\u7684\u5e93\u662fPyPDF2\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">import PyPDF2\nimport os\n\ndef merge_and_compress_pdf(input_files, output_file):\n    pdf_writer = PyPDF2.PdfFileWriter()\n    \n    for input_file in input_files:\n        with open(input_file, &#039;rb&#039;) as file:\n            pdf = PyPDF2.PdfFileReader(file)\n            \n            for page_num in range(pdf.getNumPages()):\n                page = pdf.getPage(page_num)\n                page.compressContentStreams()  # \u538b\u7f29\u5185\u5bb9\u6d41\n                pdf_writer.addPage(page)\n    \n    with open(output_file, &#039;wb&#039;) as output:\n        pdf_writer.write(output)\n    \n    print(&quot;PDF\u6587\u4ef6\u5df2\u6210\u529f\u5408\u5e76\u548c\u538b\u7f29\u3002&quot;)\n\n# \u793a\u4f8b\u7528\u6cd5\uff1a\u5c06\u6587\u4ef6input1.pdf\u548cinput2.pdf\u5408\u5e76\u540e\u538b\u7f29\uff0c\u4fdd\u5b58\u4e3aoutput.pdf\nmerge_and_compress_pdf([&#039;input1.pdf&#039;, &#039;input2.pdf&#039;], &#039;output.pdf&#039;)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4f1a\u5c06\u591a\u4e2aPDF\u6587\u4ef6\u9010\u4e2a\u6253\u5f00\uff0c\u5e76\u5c06\u6bcf\u4e2a\u9875\u9762\u7684\u5185\u5bb9\u6d41\u538b\u7f29\u540e\uff0c\u5c06\u6240\u6709\u9875\u9762\u6dfb\u52a0\u5230\u4e00\u4e2a\u65b0\u7684PDF\u6587\u4ef6\u4e2d\u3002\u6700\u540e\uff0c\u5b83\u5c06\u4fdd\u5b58\u5408\u5e76\u548c\u538b\u7f29\u540e\u7684PDF\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u4fee\u6539\u8f93\u5165\u6587\u4ef6\u7684\u540d\u79f0\u548c\u8f93\u51fa\u6587\u4ef6\u7684\u540d\u79f0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u538b\u7f29PDF\u6587\u4ef6\u5230\u56fa\u5b9a\u5927\u5c0f\u4e3b\u8981\u6d89\u53caPyMuPDF\u3001Pillow\u548cPyPDF2\u7b49\u5e93\u3002\u8fd9\u4e9b\u5e93\u5408\u4f5c\u53ef\u4ee5 [&hellip;]","protected":false},"author":3,"featured_media":224957,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/224948"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=224948"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/224948\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/224957"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=224948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=224948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=224948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}