{"id":1147631,"date":"2025-01-13T16:27:21","date_gmt":"2025-01-13T08:27:21","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1147631.html"},"modified":"2025-01-13T16:27:23","modified_gmt":"2025-01-13T08:27:23","slug":"python%e5%a6%82%e4%bd%95%e7%94%9f%e6%88%90pdf%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1147631.html","title":{"rendered":"python\u5982\u4f55\u751f\u6210pdf\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25165815\/51f9fbd2-0555-4777-816b-9e32dffd4c9e.webp\" alt=\"python\u5982\u4f55\u751f\u6210pdf\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>Python\u751f\u6210PDF\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528ReportLab\u5e93\u3001FPDF\u5e93\u3001WeasyPrint\u5e93\u3001\u4ee5\u53caPyPDF2\u5e93\u3002\u8fd9\u4e9b\u5e93\u5404\u6709\u7279\u70b9\uff0c\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u3002\u6700\u5e38\u7528\u548c\u529f\u80fd\u5f3a\u5927\u7684\u8981\u6570ReportLab\uff0c\u5b83\u80fd\u591f\u521b\u5efa\u590d\u6742\u7684PDF\u6587\u6863\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001REPORTLAB\u5e93<\/p>\n<\/p>\n<p><p>ReportLab\u662fPython\u751f\u6210PDF\u6587\u4ef6\u7684\u6700\u5f3a\u5927\u3001\u6700\u7075\u6d3b\u7684\u5e93\u4e4b\u4e00\u3002\u5b83\u5141\u8bb8\u7528\u6237\u521b\u5efa\u590d\u6742\u7684PDF\u6587\u6863\uff0c\u652f\u6301\u7ed8\u56fe\u3001\u6587\u672c\u3001\u8868\u683c\u3001\u56fe\u50cf\u7b49\u591a\u79cd\u5143\u7d20\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528ReportLab\u751f\u6210PDF\u6587\u4ef6\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5ReportLab<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5ReportLab\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install reportlab<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u751f\u6210\u57fa\u672cPDF\u6587\u4ef6<\/strong><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u751f\u6210\u4e00\u4e2a\u7b80\u5355\u7684PDF\u6587\u4ef6\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-python\">from reportlab.lib.pagesizes import letter<\/p>\n<p>from reportlab.pdfgen import canvas<\/p>\n<p>def create_pdf(filename):<\/p>\n<p>    c = canvas.Canvas(filename, pagesize=letter)<\/p>\n<p>    width, height = letter<\/p>\n<p>    c.drawString(100, 750, &quot;Hello, World!&quot;)<\/p>\n<p>    c.showPage()<\/p>\n<p>    c.save()<\/p>\n<p>create_pdf(&quot;output.pdf&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a\u201coutput.pdf\u201d\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u9875\u9762\u4e0a\u7ed8\u5236\u4e86\u201cHello, World!\u201d\u6587\u672c\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6dfb\u52a0\u66f4\u591a\u5185\u5bb9<\/strong><\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528ReportLab\u6dfb\u52a0\u66f4\u591a\u590d\u6742\u7684\u5185\u5bb9\uff0c\u5305\u62ec\u56fe\u50cf\u3001\u8868\u683c\u3001\u7ed8\u56fe\u7b49\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u6dfb\u52a0\u56fe\u50cf\u548c\u8868\u683c\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-python\">from reportlab.lib import colors<\/p>\n<p>from reportlab.lib.pagesizes import letter<\/p>\n<p>from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Image<\/p>\n<p>def create_pdf(filename):<\/p>\n<p>    doc = SimpleDocTemplate(filename, pagesize=letter)<\/p>\n<p>    elements = []<\/p>\n<p>    # \u6dfb\u52a0\u56fe\u50cf<\/p>\n<p>    img = Image(&#39;path\/to\/image.jpg&#39;, 2 * inch, 2 * inch)<\/p>\n<p>    elements.append(img)<\/p>\n<p>    # \u6dfb\u52a0\u8868\u683c<\/p>\n<p>    data = [[&#39;Item&#39;, &#39;Description&#39;, &#39;Price&#39;],<\/p>\n<p>            [&#39;1&#39;, &#39;Product 1&#39;, &#39;$10&#39;],<\/p>\n<p>            [&#39;2&#39;, &#39;Product 2&#39;, &#39;$20&#39;],<\/p>\n<p>            [&#39;3&#39;, &#39;Product 3&#39;, &#39;$30&#39;]]<\/p>\n<p>    table = Table(data)<\/p>\n<p>    table.setStyle(TableStyle([(&#39;BACKGROUND&#39;, (0, 0), (-1, 0), colors.grey),<\/p>\n<p>                               (&#39;TEXTCOLOR&#39;, (0, 0), (-1, 0), colors.whitesmoke),<\/p>\n<p>                               (&#39;ALIGN&#39;, (0, 0), (-1, -1), &#39;CENTER&#39;),<\/p>\n<p>                               (&#39;FONTNAME&#39;, (0, 0), (-1, 0), &#39;Helvetica-Bold&#39;),<\/p>\n<p>                               (&#39;FONTSIZE&#39;, (0, 0), (-1, 0), 14),<\/p>\n<p>                               (&#39;BOTTOMPADDING&#39;, (0, 0), (-1, 0), 12),<\/p>\n<p>                               (&#39;BACKGROUND&#39;, (0, 1), (-1, -1), colors.beige),<\/p>\n<p>                               (&#39;GRID&#39;, (0, 0), (-1, -1), 1, colors.black)]))<\/p>\n<p>    elements.append(table)<\/p>\n<p>    doc.build(elements)<\/p>\n<p>create_pdf(&quot;output.pdf&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5728PDF\u4e2d\u6dfb\u52a0\u4e86\u4e00\u5f20\u56fe\u50cf\u548c\u4e00\u4e2a\u7b80\u5355\u7684\u8868\u683c\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001FPDF\u5e93<\/p>\n<\/p>\n<p><p>FPDF\u662f\u53e6\u4e00\u4e2a\u5e38\u7528\u7684Python\u5e93\uff0c\u7528\u4e8e\u751f\u6210PDF\u6587\u4ef6\u3002\u5b83\u6bd4ReportLab\u66f4\u7b80\u5355\uff0c\u4f46\u529f\u80fd\u76f8\u5bf9\u8f83\u5c11\u3002\u9002\u7528\u4e8e\u9700\u8981\u5feb\u901f\u751f\u6210\u7b80\u5355PDF\u6587\u4ef6\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5FPDF<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5FPDF\u5e93\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install fpdf<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u751f\u6210\u57fa\u672cPDF\u6587\u4ef6<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u4f7f\u7528FPDF\u751f\u6210\u4e00\u4e2a\u7b80\u5355PDF\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-python\">from fpdf import FPDF<\/p>\n<p>class PDF(FPDF):<\/p>\n<p>    def header(self):<\/p>\n<p>        self.set_font(&#39;Arial&#39;, &#39;B&#39;, 12)<\/p>\n<p>        self.cell(0, 10, &#39;Sample PDF&#39;, 0, 1, &#39;C&#39;)<\/p>\n<p>    def footer(self):<\/p>\n<p>        self.set_y(-15)<\/p>\n<p>        self.set_font(&#39;Arial&#39;, &#39;I&#39;, 8)<\/p>\n<p>        self.cell(0, 10, f&#39;Page {self.page_no()}&#39;, 0, 0, &#39;C&#39;)<\/p>\n<p>    def chapter_title(self, title):<\/p>\n<p>        self.set_font(&#39;Arial&#39;, &#39;B&#39;, 12)<\/p>\n<p>        self.cell(0, 10, title, 0, 1, &#39;L&#39;)<\/p>\n<p>        self.ln(10)<\/p>\n<p>    def chapter_body(self, body):<\/p>\n<p>        self.set_font(&#39;Arial&#39;, &#39;&#39;, 12)<\/p>\n<p>        self.multi_cell(0, 10, body)<\/p>\n<p>        self.ln()<\/p>\n<p>def create_pdf(filename):<\/p>\n<p>    pdf = PDF()<\/p>\n<p>    pdf.add_page()<\/p>\n<p>    pdf.chapter_title(&#39;Introduction&#39;)<\/p>\n<p>    pdf.chapter_body(&#39;This is a sample PDF generated using FPDF library.&#39;)<\/p>\n<p>    pdf.output(filename)<\/p>\n<p>create_pdf(&#39;output.pdf&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2aPDF\u6587\u4ef6\uff0c\u5e76\u5728\u9875\u9762\u4e0a\u6dfb\u52a0\u4e86\u6807\u9898\u548c\u6b63\u6587\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001WEASYPRINT\u5e93<\/p>\n<\/p>\n<p><p>WeasyPrint\u662f\u4e00\u4e2a\u73b0\u4ee3\u7684HTML\/CSS\u5230PDF\u8f6c\u6362\u5e93\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u4f7f\u7528HTML\u548cCSS\u6765\u751f\u6210PDF\u6587\u4ef6\uff0c\u975e\u5e38\u9002\u5408\u9700\u8981\u751f\u6210\u590d\u6742\u5e03\u5c40\u7684PDF\u6587\u4ef6\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5WeasyPrint<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5WeasyPrint\u5e93\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install weasyprint<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u751f\u6210\u57fa\u672cPDF\u6587\u4ef6<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u4f7f\u7528WeasyPrint\u751f\u6210\u4e00\u4e2a\u7b80\u5355PDF\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-python\">from weasyprint import HTML<\/p>\n<p>def create_pdf(filename):<\/p>\n<p>    html = &quot;&quot;&quot;<\/p>\n<p>    &lt;html&gt;<\/p>\n<p>    &lt;head&gt;<\/p>\n<p>        &lt;style&gt;<\/p>\n<p>            body { font-family: Arial, sans-serif; }<\/p>\n<p>            h1 { color: #333; }<\/p>\n<p>        &lt;\/style&gt;<\/p>\n<p>    &lt;\/head&gt;<\/p>\n<p>    &lt;body&gt;<\/p>\n<p>        &lt;h1&gt;Hello, World!&lt;\/h1&gt;<\/p>\n<p>        &lt;p&gt;This is a sample PDF generated using WeasyPrint library.&lt;\/p&gt;<\/p>\n<p>    &lt;\/body&gt;<\/p>\n<p>    &lt;\/html&gt;<\/p>\n<p>    &quot;&quot;&quot;<\/p>\n<p>    HTML(string=html).write_pdf(filename)<\/p>\n<p>create_pdf(&#39;output.pdf&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528HTML\u548cCSS\u5b9a\u4e49\u4e86PDF\u7684\u5185\u5bb9\u548c\u6837\u5f0f\uff0c\u5e76\u751f\u6210\u4e86\u4e00\u4e2aPDF\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001PYPDF2\u5e93<\/p>\n<\/p>\n<p><p>PyPDF2\u662f\u4e00\u4e2a\u7528\u4e8e\u64cd\u4f5cPDF\u6587\u4ef6\u7684\u5e93\uff0c\u867d\u7136\u5b83\u4e0d\u80fd\u76f4\u63a5\u751f\u6210PDF\u6587\u4ef6\uff0c\u4f46\u53ef\u4ee5\u7528\u4e8e\u5408\u5e76\u3001\u62c6\u5206\u3001\u52a0\u5bc6\u548c\u89e3\u5bc6PDF\u6587\u4ef6\u7b49\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5PyPDF2<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5PyPDF2\u5e93\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install PyPDF2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5408\u5e76PDF\u6587\u4ef6<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u4f7f\u7528PyPDF2\u5408\u5e76\u4e24\u4e2aPDF\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-python\">import PyPDF2<\/p>\n<p>def merge_pdfs(input_files, output_file):<\/p>\n<p>    pdf_writer = PyPDF2.PdfFileWriter()<\/p>\n<p>    for file in input_files:<\/p>\n<p>        pdf_reader = PyPDF2.PdfFileReader(file)<\/p>\n<p>        for page_num in range(pdf_reader.getNumPages()):<\/p>\n<p>            page = pdf_reader.getPage(page_num)<\/p>\n<p>            pdf_writer.addPage(page)<\/p>\n<p>    with open(output_file, &#39;wb&#39;) as out:<\/p>\n<p>        pdf_writer.write(out)<\/p>\n<p>input_files = [&#39;file1.pdf&#39;, &#39;file2.pdf&#39;]<\/p>\n<p>merge_pdfs(input_files, &#39;merged.pdf&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5408\u5e76\u4e86\u4e24\u4e2aPDF\u6587\u4ef6\u5e76\u751f\u6210\u4e86\u4e00\u4e2a\u65b0\u7684PDF\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u751f\u6210PDF\u6587\u4ef6\u7684\u5e93\uff0c\u6bcf\u79cd\u5e93\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\u548c\u9002\u7528\u573a\u666f\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>ReportLab<\/strong>\uff1a\u529f\u80fd\u5f3a\u5927\uff0c\u9002\u7528\u4e8e\u9700\u8981\u521b\u5efa\u590d\u6742PDF\u6587\u6863\u7684\u573a\u666f\u3002<\/li>\n<li><strong>FPDF<\/strong>\uff1a\u7b80\u5355\u6613\u7528\uff0c\u9002\u7528\u4e8e\u5feb\u901f\u751f\u6210\u7b80\u5355PDF\u6587\u4ef6\u7684\u573a\u666f\u3002<\/li>\n<li><strong>WeasyPrint<\/strong>\uff1a\u57fa\u4e8eHTML\u548cCSS\uff0c\u9002\u7528\u4e8e\u9700\u8981\u751f\u6210\u590d\u6742\u5e03\u5c40PDF\u6587\u4ef6\u7684\u573a\u666f\u3002<\/li>\n<li><strong>PyPDF2<\/strong>\uff1a\u7528\u4e8e\u64cd\u4f5c\u5df2\u6709\u7684PDF\u6587\u4ef6\uff0c\u5982\u5408\u5e76\u3001\u62c6\u5206\u3001\u52a0\u5bc6\u548c\u89e3\u5bc6\u3002<\/li>\n<\/ul>\n<p><p>\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8PDF\u751f\u6210\u7684\u6548\u7387\u548c\u8d28\u91cf\u3002\u901a\u8fc7\u8fd9\u4e9b\u5e93\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u5728Python\u4e2d\u751f\u6210\u548c\u64cd\u4f5cPDF\u6587\u4ef6\uff0c\u6ee1\u8db3\u5404\u79cd\u5e94\u7528\u573a\u666f\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u751f\u6210PDF\u6587\u4ef6\uff1f<\/strong><br \/>\u4f7f\u7528Python\u751f\u6210PDF\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u5e93\u6765\u5b9e\u73b0\u3002\u5176\u4e2d\u6700\u6d41\u884c\u7684\u5e93\u5305\u62ecReportLab\u548cPyPDF2\u3002ReportLab\u53ef\u4ee5\u521b\u5efa\u65b0\u7684PDF\u6587\u6863\uff0c\u800cPyPDF2\u53ef\u4ee5\u7528\u6765\u8bfb\u53d6\u3001\u5408\u5e76\u548c\u4fee\u6539\u73b0\u6709\u7684PDF\u6587\u4ef6\u3002\u8981\u5f00\u59cb\uff0c\u60a8\u53ef\u4ee5\u5b89\u88c5ReportLab\u5e93\uff0c\u901a\u8fc7\u8fd0\u884c<code>pip install reportlab<\/code>\u547d\u4ee4\uff0c\u5e76\u4f7f\u7528\u5b83\u6765\u5b9a\u4e49\u9875\u9762\u3001\u6587\u672c\u3001\u56fe\u5f62\u7b49\u3002<\/p>\n<p><strong>\u751f\u6210\u7684PDF\u6587\u4ef6\u53ef\u4ee5\u5305\u542b\u54ea\u4e9b\u5185\u5bb9\uff1f<\/strong><br \/>\u901a\u8fc7Python\u751f\u6210\u7684PDF\u6587\u4ef6\u53ef\u4ee5\u5305\u542b\u6587\u672c\u3001\u56fe\u50cf\u3001\u8868\u683c\u548c\u77e2\u91cf\u56fe\u5f62\u7b49\u5143\u7d20\u3002\u4f7f\u7528ReportLab\uff0c\u60a8\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5b57\u4f53\u3001\u989c\u8272\u548c\u5e03\u5c40\uff0c\u4f7f\u751f\u6210\u7684PDF\u6587\u6863\u7b26\u5408\u7279\u5b9a\u7684\u89c6\u89c9\u9700\u6c42\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u6dfb\u52a0\u9875\u7709\u3001\u9875\u811a\u548c\u6c34\u5370\u7b49\u529f\u80fd\uff0c\u4ee5\u589e\u5f3a\u6587\u6863\u7684\u4e13\u4e1a\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406PDF\u6587\u4ef6\u7684\u683c\u5f0f\u548c\u6837\u5f0f\uff1f<\/strong><br \/>\u5728\u751f\u6210PDF\u6587\u4ef6\u65f6\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u4e0d\u540c\u7684\u53c2\u6570\u6765\u63a7\u5236\u683c\u5f0f\u548c\u6837\u5f0f\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\u3001\u989c\u8272\u548c\u5bf9\u9f50\u65b9\u5f0f\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u9875\u9762\u8fb9\u8ddd\u548c\u5c3a\u5bf8\u3002ReportLab\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684API\uff0c\u4ee5\u4fbf\u4e8e\u7528\u6237\u6839\u636e\u9700\u6c42\u81ea\u5b9a\u4e49\u6587\u6863\u7684\u5916\u89c2\u3002\u5bf9\u4e8e\u9700\u8981\u66f4\u590d\u6742\u5e03\u5c40\u7684\u6587\u6863\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Platypus\u6a21\u5757\uff0c\u5b83\u652f\u6301\u591a\u79cd\u5e03\u5c40\u5143\u7d20\u7684\u7ec4\u5408\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u751f\u6210PDF\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528ReportLab\u5e93\u3001FPDF\u5e93\u3001WeasyPrint\u5e93\u3001 [&hellip;]","protected":false},"author":3,"featured_media":1147640,"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\/1147631"}],"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=1147631"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1147631\/revisions"}],"predecessor-version":[{"id":1147646,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1147631\/revisions\/1147646"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1147640"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1147631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1147631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1147631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}