{
  "id": "task_libraries:pdf-generation/python",
  "path": "/exapedia/python-pdf-generation-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python PDF generation libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python PDF generation libraries create PDF documents from code, templates, or HTML. An HTML renderer lays out each page from markup and CSS rather than from drawing commands at fixed coordinates. These libraries let apps generate invoices, reports, and certificates as PDF files."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python PDF generation libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pymupdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F123"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F127"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#reportlab",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#weasyprint",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F157"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pydyf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fpdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pdfkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F202"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#xhtmltwopdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F224"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#borb",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F241"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#pymupdf",
          "label": [
            {
              "t": "text",
              "text": "PyMuPDF"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F124"
        },
        {
          "t": "text",
          "text": ", a count that covers all its PDF work."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "HTML document input",
            "Text/table layout"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pymupdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F123"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#reportlab",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#weasyprint",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F157"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pydyf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fpdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pdfkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F202"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#xhtmltwopdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F224"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#borb",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F241"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "pymupdf",
          "name": [
            {
              "t": "fact",
              "fact": "F123"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pymupdf/PyMuPDF"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pymupdf"
            },
            {
              "label": "Docs",
              "href": "https://pymupdf.readthedocs.io/en/latest/story-class.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pymupdf.readthedocs.io/en/latest/story-class.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F123"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/vb64/markdown-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F139"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def add_section(self, section: Section, user_css: typing.Optional[str] = None) -> str:\n    \"\"\"Add markdown section to pdf.\"\"\"\n    where = section.rect + section.borders\n    html = self.m_d.render(self.apply_plugins(section.text))\n    story = fitz.Story(html=html, archive=section.root, user_css=user_css)\n    more = 1\n    while more:  # loop outputting the story\n        self.page_num += 1\n        section.page_count += 1\n        device = self.writer.begin_page(section.rect)\n        more, _ = story.place(where)  # layout into allowed rectangle\n        story.element_positions(self._recorder, {\"toc\": section.toc, \"pdfile\": self})\n        story.draw(device)\n        self.writer.end_page()\n\n    self.sections.append(section)\n\n    return html\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/vb64/markdown-pdf/blob/10c36d6e84de5c2d91c0c34dbf51cb49213ed428/markdown_pdf/__init__.py#L120-L137",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F138"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pymupdf%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F123"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pymupdf\ndocument = pymupdf.open()\npage = document.new_page()\npage.insert_text((72, 72), 'Hello World!')\ndocument.save('hello.pdf')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pymupdf.readthedocs.io/en/latest/recipes-text.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "recipes-text.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F128"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "reportlab",
          "name": [
            {
              "t": "fact",
              "fact": "F141"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/MrBitBucket/reportlab-mirror"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/reportlab"
            },
            {
              "label": "Docs",
              "href": "https://docs.reportlab.com/reportlab/userguide/ch5_platypus/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F13"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.reportlab.com/reportlab/userguide/ch5_platypus/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F141"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/ossf/cve-bin-tool",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F155"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def showtable(self, ident, widths=None):\n    \"\"\"\n    Displays a table.\n\n    Parameters:\n    - ident: The identifier of the table.\n    - widths: The widths of the columns (optional).\n    \"\"\"\n    if self.table_ident == ident:\n        self._spacer()\n        tbl = Table(self.table_data, colWidths=widths, repeatRows=1)\n        tbl.setStyle(self.table_style)\n        self.contents.append(tbl)\n        self.table_ident = None\n        # Optional notes if data in columns truncated\n        if len(self.note_data) > 0:\n            notes = [\"<br/><u>Notes</u>\"]\n            i = 1\n            for d in self.note_data:\n                notes.append(str(i) + \". \" + d)\n                i += 1\n            self.paragraph(\"<br/>\".join(notes))\n            self.note_data = []\n        self._spacer()\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/ossf/cve-bin-tool/blob/cb54cec50258577650303d063aaa0b180c29923b/cve_bin_tool/output_engine/pdfbuilder.py#L356-L379",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20reportlab%20for%20report%20tables%2C%20searchable%20OCR%20text%20layers%20and%20PDF%20shading%20functions&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F141"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from reportlab.pdfgen import canvas\ndef hello(c):\n    c.drawString(100,100,\"Hello World\")\nc = canvas.Canvas(\"hello.pdf\")\nhello(c)\nc.showPage()\nc.save()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.reportlab.com/reportlab/userguide/ch2_graphics/",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F146"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "weasyprint",
          "name": [
            {
              "t": "fact",
              "fact": "F157"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Kozea/WeasyPrint"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/weasyprint"
            },
            {
              "label": "Docs",
              "href": "https://doc.courtbouillon.org/weasyprint/stable/first_steps.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F164"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://doc.courtbouillon.org/weasyprint/stable/first_steps.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F157"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from weasyprint import HTML\nHTML('https://weasyprint.org/').write_pdf('/tmp/weasyprint-website.pdf')\n\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://doc.courtbouillon.org/weasyprint/stable/first_steps.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "first_steps.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=weasyprint%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F157"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F162"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pydyf",
          "name": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/CourtBouillon/pydyf"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pydyf"
            },
            {
              "label": "Docs",
              "href": "https://doc.courtbouillon.org/pydyf/stable/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F34"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://doc.courtbouillon.org/pydyf/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F170"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F35"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F36"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Kozea/WeasyPrint",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F183"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@staticmethod\ndef create_stitching_function(domain, encode, bounds, sub_functions):\n    return pydyf.Dictionary({\n        'FunctionType': 3,\n        'Domain': pydyf.Array(domain),\n        'Encode': pydyf.Array(encode),\n        'Bounds': pydyf.Array(bounds),\n        'Functions': pydyf.Array(sub_functions),\n    })\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Kozea/WeasyPrint/blob/69b19deb03ddf53907899ec450da03117c6a0a8c/weasyprint/pdf/stream.py#L317-L325",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20pydyf%20for%20report%20tables%2C%20searchable%20OCR%20text%20layers%20and%20PDF%20shading%20functions&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F170"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pydyf\ndocument = pydyf.PDF()\ndocument.add_page(pydyf.Dictionary({\n    'Type': '/Page',\n    'Parent': document.pages.reference,\n    'MediaBox': pydyf.Array([0, 0, 200, 200]),\n}))\nwith open('document.pdf', 'wb') as f:\n    document.write(f)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://doc.courtbouillon.org/pydyf/stable/first_steps.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "common_use_cases.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F175"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "fpdf",
          "name": [
            {
              "t": "fact",
              "fact": "F185"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/py-pdf/fpdf2"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/fpdf2"
            },
            {
              "label": "Docs",
              "href": "https://py-pdf.github.io/fpdf2/Tutorial.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F59"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://py-pdf.github.io/fpdf2/Tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F185"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F60"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F61"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/ocrmypdf/OCRmyPDF",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def render(self, output_path: Path) -> None:\n    \"\"\"Render page to PDF file.\n\n    Args:\n        output_path: Output PDF file path\n    \"\"\"\n    # Create PDF with custom page size\n    pdf = FPDF(\n        unit=\"pt\",\n        format=(\n            self.coord_transform.page_width_pt,\n            self.coord_transform.page_height_pt,\n        ),\n    )\n    pdf.set_auto_page_break(auto=False)\n\n    # Enable text shaping for complex scripts\n    pdf.set_text_shaping(True)\n\n    # Disable cell margin to ensure precise text positioning\n    # fpdf2's cell() adds c_margin padding by default, which shifts text\n    pdf.c_margin = 0\n\n    # Set text mode for invisible text\n    if self.invisible_text:\n        pdf.text_mode = TextMode.INVISIBLE\n    else:\n        pdf.text_mode = TextMode.FILL\n\n    # Render content to PDF\n    self.render_to_pdf(pdf)\n\n    # Write PDF\n    pdf.output(str(output_path))\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/ocrmypdf/OCRmyPDF/blob/86a5e723ea2b612e8df4a647056b0ebf3b3c97a5/src/ocrmypdf/fpdf_renderer/renderer.py#L271-L304",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F199"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20fpdf2%20for%20report%20tables%2C%20searchable%20OCR%20text%20layers%20and%20PDF%20shading%20functions&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F185"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from fpdf import FPDF\npdf = FPDF()\npdf.add_page()\npdf.set_font(\"helvetica\", style=\"B\", size=16)\npdf.cell(40, 10, \"Hello World!\")\npdf.output(\"tuto1.pdf\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://py-pdf.github.io/fpdf2/Tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "Tables.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F190"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pdfkit",
          "name": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/JazzCore/python-pdfkit"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pdfkit"
            },
            {
              "label": "Docs",
              "href": "https://api.github.com/repos/JazzCore/python-pdfkit/contents/README.rst"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F209"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/JazzCore/python-pdfkit/contents/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F202"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/sukeesh/Jarvis",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def md_to_pdf(self, jarvis):\n    jarvis.say('')\n    jarvis.say('This option will help you convert Markdown files to PDF')\n    while True:\n        md_file = jarvis.input('Enter the full path of the Markdown file (or type \"quit\" to exit): ').strip()\n        if md_file.lower() in ['q', 'quit', 'exit']:\n            jarvis.say(\"Goodbye!\", Fore.CYAN)\n            break\n\n        if not os.path.isfile(md_file):\n            jarvis.say('The file does not exist. Please try again.', Fore.RED)\n            continue\n\n        if not md_file.lower().endswith('.md'):\n            jarvis.say('The file must be a Markdown (.md) file.', Fore.RED)\n            continue\n\n        try:\n            with open(md_file, 'r', encoding='utf-8') as f:\n                md_content = f.read()\n\n            # Convert Markdown to HTML \n            html_content = markdown.markdown(md_content, extensions=['fenced_code', 'tables', 'toc'])\n\n            # Process HTML to convert relative image paths to absolute paths\n            html_content = self.convert_image_paths(html_content, os.path.dirname(os.path.abspath(md_file)))\n\n            pdf_file = os.path.splitext(md_file)[0] + '.pdf'\n\n            options = {\n                'enable-local-file-access': None,\n            }\n            config = pdfkit.configuration()\n\n            # Convert HTML to PDF \n            pdfkit.from_string(html_content, pdf_file, options=options, configuration=config)\n\n            jarvis.say(f\"Converted '{md_file}' to '{pdf_file}'.\", Fore.GREEN)\n        except Exception as e:\n            jarvis.say(f\"An error occurred: {e}\", Fore.RED)\n        break\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/sukeesh/Jarvis/blob/0c62c730de3af69d0105d0bbc7c65feee25c6f67/jarviscli/plugins/mdtopdf.py#L18-L58",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F217"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pdfkit%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F202"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/microsoft/intelligence-toolkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def add_download_pdf(\n    name, text, button_text=\"Download PDF\", is_markdown=True, disabled=False\n):\n    if not name.endswith(\".pdf\"):\n        name += \".pdf\"\n    # Convert text to HTML if it's in Markdown format\n    text = markdown2.markdown(text) if is_markdown else text\n    text = f\"<style>{style_pdf}</style> \\n\\n {text} <hr>{text_label}\"\n\n    # Generate PDF from HTML string\n    config_pdf = config_pdfkit()\n\n    with st.spinner(\"Preparing PDF download...\"):\n        with tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=False) as temp_file:\n            pdfkit.from_string(\n                text, temp_file.name, options=pdfkit_options, configuration=config_pdf\n            )\n\n            # Provide download button for the generated PDF\n            with open(temp_file.name, \"rb\") as f:\n                st.download_button(\n                    button_text,\n                    f,\n                    file_name=name,\n                    mime=\"application/pdf\",\n                    disabled=disabled,\n                )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/microsoft/intelligence-toolkit/blob/5a539a10d19809a3c82607640e1f89f89ce0ca14/app/util/download_pdf.py#L16-L42",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pdfkit%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F202"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pdfkit\npdfkit.from_string('Hello!', 'out.pdf')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/JazzCore/python-pdfkit/contents/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "xhtmltwopdf",
          "name": [
            {
              "t": "fact",
              "fact": "F224"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/xhtml2pdf/xhtml2pdf"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/xhtml2pdf"
            },
            {
              "label": "Docs",
              "href": "https://xhtml2pdf.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F231"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://xhtml2pdf.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F224"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nigma/django-easy-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F239"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def html_to_pdf(content, encoding=\"utf-8\",\n                link_callback=fetch_resources, **kwargs):\n    \"\"\"\n    Converts html ``content`` into PDF document.\n\n    :param unicode content: html content\n    :returns: PDF content\n    :rtype: :class:`bytes`\n    :raises: :exc:`~easy_pdf.exceptions.PDFRenderingError`\n    \"\"\"\n    src = BytesIO(content.encode(encoding))\n    dest = BytesIO()\n\n    pdf = pisa.pisaDocument(src, dest, encoding=encoding,\n                            link_callback=link_callback, **kwargs)\n    if pdf.err:\n        logger.error(\"Error rendering PDF document\")\n        for entry in pdf.log:\n            if entry[0] == xhtml2pdf.default.PML_ERROR:\n                logger_x2p.error(\"line %s, msg: %s, fragment: %s\", entry[1], entry[2], entry[3])\n        raise PDFRenderingError(\"Errors rendering PDF\", content=content, log=pdf.log)\n\n    if pdf.warn:\n        for entry in pdf.log:\n            if entry[0] == xhtml2pdf.default.PML_WARNING:\n                logger_x2p.warning(\"line %s, msg: %s, fragment: %s\", entry[1], entry[2], entry[3])\n\n    return dest.getvalue()\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nigma/django-easy-pdf/blob/327605b91a445b453d8969b341ef74b12ab00a83/easy_pdf/rendering.py#L51-L78",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F238"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=xhtml2pdf%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F224"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import io\n\nfrom xhtml2pdf import pisa\n\noutput = io.BytesIO()\n\npisa.CreatePDF(\n    \"<html><body><p>To PDF or not to PDF</p></body></html>\",  # page data\n    dest=output,                                              # destination \"file\"\n)\n\n# You can get the PDF file bytes with `.getbuffer()`\nprint(len(output.getbuffer()))\n\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://xhtml2pdf.readthedocs.io/en/latest/quickstart.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "quickstart.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F229"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "borb",
          "name": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/borb-pdf/borb"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/borb"
            },
            {
              "label": "Docs",
              "href": "https://api.github.com/repos/borb-pdf/borb/contents/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F248"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/borb-pdf/borb/contents/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F241"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pathlib import Path\nfrom borb.pdf import Document, Page, PageLayout, SingleColumnLayout, Paragraph, PDF\nd: Document = Document()\np: Page = Page()\nd.append_page(p)\nl: PageLayout = SingleColumnLayout(p)\nl.append_layout_element(Paragraph('Hello World!'))\nPDF.write(what=d, where_to=\"assets/output.pdf\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/borb-pdf/borb/contents/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=borb%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F241"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F246"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python PDF generation library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#reportlab",
          "label": [
            {
              "t": "text",
              "text": "ReportLab"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits reports with flowing layouts, tables, and page templates. "
        },
        {
          "t": "link",
          "href": "#weasyprint",
          "label": [
            {
              "t": "text",
              "text": "WeasyPrint"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits documents written as HTML and CSS. "
        },
        {
          "t": "link",
          "href": "#fpdf",
          "label": [
            {
              "t": "fact",
              "fact": "F185"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits pages built from text, tables, and images in Python."
        }
      ]
    },
    {
      "q": "What is PyMuPDF?",
      "a": [
        {
          "t": "link",
          "href": "#pymupdf",
          "label": [
            {
              "t": "text",
              "text": "PyMuPDF"
            }
          ]
        },
        {
          "t": "text",
          "text": " creates, converts, and edits PDF documents and lays out HTML and CSS through its Story feature. It also extracts and analyzes content from existing PDFs."
        }
      ]
    },
    {
      "q": "What is WeasyPrint?",
      "a": [
        {
          "t": "link",
          "href": "#weasyprint",
          "label": [
            {
              "t": "text",
              "text": "WeasyPrint"
            }
          ]
        },
        {
          "t": "text",
          "text": " renders HTML and CSS to PDF, including paged media layout. It relies on system libraries for rendering."
        }
      ]
    },
    {
      "q": "What is ReportLab?",
      "a": [
        {
          "t": "link",
          "href": "#reportlab",
          "label": [
            {
              "t": "text",
              "text": "ReportLab"
            }
          ]
        },
        {
          "t": "text",
          "text": " draws PDF pages on a canvas and builds flowing reports with tables, page templates, and styles through its Platypus layer."
        }
      ]
    },
    {
      "q": "What is xhtml2pdf?",
      "a": [
        {
          "t": "link",
          "href": "#xhtmltwopdf",
          "label": [
            {
              "t": "fact",
              "fact": "F224"
            }
          ]
        },
        {
          "t": "text",
          "text": " generates PDF from HTML and CSS on top of ReportLab. It supports a documented subset of markup and styles rather than full browser CSS."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, reportlab",
      "display": "ReportLab",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, reportlab",
      "display": "86.1M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, reportlab",
      "display": "BSD license (see license.txt for details), Copyright (c) 2000-2025, ReportLab Inc.",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, reportlab",
      "display": "5.1.0, Oct 2026",
      "asOf": "2026-10-22"
    },
    "F5": {
      "label": "Package release date, reportlab",
      "display": "Oct 2026",
      "asOf": "2026-10-22"
    },
    "F6": {
      "label": "Repository stars, reportlab",
      "display": "88",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Automatic page breaks, reportlab",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Tables, reportlab",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Embeds TrueType fonts, reportlab",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Encrypts PDFs, reportlab",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Output formats, reportlab",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "Install, reportlab",
      "display": "pip install reportlab",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "What it does, reportlab",
      "display": "Creates PDF documents with drawing APIs and a page-layout engine for report content.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, reportlab",
      "display": "Separates report content from layout",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, reportlab",
      "display": "Build reports from paragraph styles, page templates, and flowing content.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths lead, reportlab",
      "display": "Repeats table headers across pages",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "strengths, reportlab",
      "display": "Split long tables across pages and repeat their header rows.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, reportlab",
      "display": "Frames reject oversized content",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, reportlab",
      "display": "Resize or split elements that cannot fit inside a frame.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, reportlab",
      "display": "from reportlab.pdfgen.canvas import Canvas\nfrom reportlab.lib.styles import getSampleStyleSheet\nfrom reportlab.lib.units import inch\nfrom reportlab.platypus import Paragraph, Frame\nstyles = getSampleStyleSheet()\nstyleN = styles['Normal']\nstyleH = styles['Heading1']\nstory = []\n\n#add some flowables\nstory.append(Paragraph(\"This is a Heading\",styleH))\nstory.append(Paragraph(\"This is a paragraph in <i>Normal</i> style.\",\n    styleN))\nc  = Canvas('mydoc.pdf')\nf = Frame(inch, inch, 6*inch, 9*inch, showBoundary=1)\nf.addFromList(story,c)\nc.save()\n\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, reportlab",
      "display": "def showtable(self, ident, widths=None):\n    # ...\n    if self.table_ident == ident:\n        self._spacer()\n        tbl = Table(self.table_data, colWidths=widths, repeatRows=1)\n        tbl.setStyle(self.table_style)\n        self.contents.append(tbl)\n        self.table_ident = None\n        # Optional notes if data in columns truncated\n        if len(self.note_data) > 0:\n            notes = [\"<br/><u>Notes</u>\"]\n            i = 1\n            for d in self.note_data:\n                notes.append(str(i) + \". \" + d)\n                i += 1\n            self.paragraph(\"<br/>\".join(notes))\n            self.note_data = []\n        self._spacer()\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, reportlab",
      "display": "pdfbuilder.py · showtable()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, reportlab",
      "display": "ossf/cve-bin-tool",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, ossf/cve-bin-tool",
      "display": "1.8K",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, ossf/cve-bin-tool",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F26": {
      "label": "Library name, pydyf",
      "display": "pydyf",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Monthly downloads, pydyf",
      "display": "40.2M",
      "asOf": "2026-11-16"
    },
    "F28": {
      "label": "License, pydyf",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Package release, pydyf",
      "display": "0.13.0, Oct 2026",
      "asOf": "2026-10-14"
    },
    "F30": {
      "label": "Package release date, pydyf",
      "display": "Oct 2026",
      "asOf": "2026-10-14"
    },
    "F31": {
      "label": "Repository stars, pydyf",
      "display": "158",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Output formats, pydyf",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Install, pydyf",
      "display": "pip install pydyf",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "What it does, pydyf",
      "display": "Writes PDF objects and content streams through a low-level Python interface.",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "strengths lead, pydyf",
      "display": "Builds PDF objects directly",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "strengths, pydyf",
      "display": "Construct dictionaries, arrays, streams, and page resources explicitly.",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths lead, pydyf",
      "display": "Draws vector paths and graphics",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths, pydyf",
      "display": "Control rectangles, line styles, transforms, and fills through a content stream.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "limitations lead, pydyf",
      "display": "Text needs explicit font resources",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "limitations, pydyf",
      "display": "Supply font dictionaries and page resources when constructing text streams.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "Quickstart, pydyf",
      "display": "import pydyf\n\ndocument = pydyf.PDF()\n\ndraw = pydyf.Stream()\n\n# Draw a first rectangle\n# With the border in dash style\n# The dash line is 2 points full, 1 point empty\n# And the dash line begins with 2 full points\ndraw.rectangle(100, 100, 50, 70)\ndraw.set_dash([2, 1], 0)\ndraw.stroke()\n\n# Draw a second rectangle\n# The dash is reset to a full line\n# The line width is set\n# Move the bottom-left corner to (80, 80)\n# Fill the rectangle\ndraw.rectangle(50, 50, 20, 40)\ndraw.set_dash([], 0)\ndraw.set_line_width(10)\ndraw.set_matrix(1, 0, 0, 1, 80, 80)\ndraw.fill()\n\n# Add the stream with the two rectangles into the document\ndocument.add_object(draw)\n\n# Add a page to the document containing the draw\ndocument.add_page(pydyf.Dictionary({\n    'Type': '/Page',\n    'Parent': document.pages.reference,\n    'Contents': draw.reference,\n    'MediaBox': pydyf.Array([0, 0, 200, 200]),\n}))\n\n# Write to document.pdf\nwith open('document.pdf', 'wb') as f:\n    document.write(f)\n",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "Project function, pydyf",
      "display": "@staticmethod\ndef create_stitching_function(domain, encode, bounds, sub_functions):\n    return pydyf.Dictionary({\n        'FunctionType': 3,\n        'Domain': pydyf.Array(domain),\n        'Encode': pydyf.Array(encode),\n        'Bounds': pydyf.Array(bounds),\n        'Functions': pydyf.Array(sub_functions),\n    })\n",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "Project function reference, pydyf",
      "display": "stream.py · create_stitching_function()",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "Project repository, pydyf",
      "display": "Kozea/WeasyPrint",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Project stars, Kozea/WeasyPrint",
      "display": "9.8K",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project push date, Kozea/WeasyPrint",
      "display": "Nov 2026",
      "asOf": "2026-11-13"
    },
    "F47": {
      "label": "Library name, fpdf2",
      "display": "fpdf2",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Monthly downloads, fpdf2",
      "display": "21.4M",
      "asOf": "2026-11-16"
    },
    "F49": {
      "label": "License, fpdf2",
      "display": "LGPL-3.0-only",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Package release, fpdf2",
      "display": "2.9.0, Oct 2026",
      "asOf": "2026-10-29"
    },
    "F51": {
      "label": "Package release date, fpdf2",
      "display": "Oct 2026",
      "asOf": "2026-10-29"
    },
    "F52": {
      "label": "Repository stars, fpdf2",
      "display": "1.6K",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Automatic page breaks, fpdf2",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Tables, fpdf2",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Embeds TrueType fonts, fpdf2",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Encrypts PDFs, fpdf2",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Output formats, fpdf2",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Install, fpdf2",
      "display": "pip install fpdf2",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "What it does, fpdf2",
      "display": "Builds PDF documents with text, images, tables, font embedding, and page-break controls.",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "strengths lead, fpdf2",
      "display": "Breaks flowing text across pages",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "strengths, fpdf2",
      "display": "Cells and write text trigger page breaks at the configured bottom margin.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths lead, fpdf2",
      "display": "Builds tables from row data",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths, fpdf2",
      "display": "Add rows and cells through the table context manager.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "limitations lead, fpdf2",
      "display": "Complex scripts need shaping setup",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "limitations, fpdf2",
      "display": "Install uharfbuzz and enable set_text_shaping for complex script rendering.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "limitations lead, fpdf2",
      "display": "Opening restrictions need user passwords",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations, fpdf2",
      "display": "Set a user password when opening the document must require authentication.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Quickstart, fpdf2",
      "display": "from fpdf import FPDF\n\nTABLE_DATA = (\n    (\"First name\", \"Last name\", \"Age\", \"City\"),\n    (\"Jules\", \"Smith\", \"34\", \"San Juan\"),\n    (\"Mary\", \"Ramos\", \"45\", \"Orlando\"),\n    (\"Carlson\", \"Banks\", \"19\", \"Los Angeles\"),\n    (\"Lucas\", \"Cimon\", \"31\", \"Angers\"),\n)\npdf = FPDF()\npdf.add_page()\npdf.set_font(\"Times\", size=16)\nwith pdf.table() as table:\n    for data_row in TABLE_DATA:\n        row = table.row()\n        for datum in data_row:\n            row.cell(datum)\npdf.output('table.pdf')\n\n",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project function, fpdf2",
      "display": "def render(self, output_path: Path) -> None:\n    # ...\n    # Create PDF with custom page size\n    pdf = FPDF(\n        unit=\"pt\",\n        format=(\n            self.coord_transform.page_width_pt,\n            self.coord_transform.page_height_pt,\n        ),\n    )\n    pdf.set_auto_page_break(auto=False)\n\n    # Enable text shaping for complex scripts\n    pdf.set_text_shaping(True)\n\n    # Disable cell margin to ensure precise text positioning\n    # fpdf2's cell() adds c_margin padding by default, which shifts text\n    pdf.c_margin = 0\n\n    # Set text mode for invisible text\n    if self.invisible_text:\n        pdf.text_mode = TextMode.INVISIBLE\n    else:\n        pdf.text_mode = TextMode.FILL\n\n    # Render content to PDF\n    self.render_to_pdf(pdf)\n\n    # Write PDF\n    pdf.output(str(output_path))\n",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Project function reference, fpdf2",
      "display": "renderer.py · render()",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project repository, fpdf2",
      "display": "ocrmypdf/OCRmyPDF",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project stars, ocrmypdf/OCRmyPDF",
      "display": "35.3K",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project push date, ocrmypdf/OCRmyPDF",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F74": {
      "label": "Library name, pdfme",
      "display": "pdfme",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Monthly downloads, pdfme",
      "display": "10.3K",
      "asOf": "2026-11-16"
    },
    "F76": {
      "label": "License, pdfme",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Package release, pdfme",
      "display": "0.5.0, Dec 2025",
      "asOf": "2025-12-08"
    },
    "F78": {
      "label": "Package release date, pdfme",
      "display": "Dec 2025",
      "asOf": "2025-12-08"
    },
    "F79": {
      "label": "Repository stars, pdfme",
      "display": "323",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Automatic page breaks, pdfme",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Tables, pdfme",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Embeds TrueType fonts, pdfme",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Output formats, pdfme",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Install, pdfme",
      "display": "pip install pdfme",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "What it does, pdfme",
      "display": "Creates flowing PDF reports from document dictionaries or direct page-building APIs.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths lead, pdfme",
      "display": "Flows content onto new pages",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths, pdfme",
      "display": "Add paragraphs, tables, and content boxes without manually positioning every page.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths lead, pdfme",
      "display": "Builds rich content inside tables",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths, pdfme",
      "display": "Place paragraphs, images, or nested content in table cells.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations lead, pdfme",
      "display": "Embedded fonts retain complete files",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations, pdfme",
      "display": "Expect larger PDFs when embedding TrueType fonts without subsetting.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "limitations lead, pdfme",
      "display": "PNG images need Pillow",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations, pdfme",
      "display": "Install Pillow to convert PNG images before embedding them.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Quickstart, pdfme",
      "display": "from pdfme import PDF\n\npdf = PDF()\npdf.add_page()\npdf.text('This is a paragraph')\n\nwith open('document.pdf', 'wb') as f:\n    pdf.output(f)\n\n",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Developer need",
      "display": "Reusable report layouts",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Why choose reportlab",
      "display": "separate document content and page styles",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need in introduction",
      "display": "reusable report layouts",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Developer need",
      "display": "Tables and flowing text",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose fpdf2",
      "display": "text-aware automatic page breaks",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "tables and flowing text",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "When to consider reportlab",
      "display": "reusable page templates and report styling are central",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "Direct PDF structures",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose pydyf",
      "display": "explicit dictionaries, streams, and resources",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "direct PDF structures",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "When to consider pdfme",
      "display": "report content should flow without direct PDF-object construction",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Flowing report content",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose pdfme",
      "display": "paragraphs, tables, and content boxes across pages",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "flowing report content",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Page introduction",
      "display": "Python PDF generation libraries let application developers create PDF documents programmatically.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which Python PDF generation library should I choose?",
      "display": "ReportLab separates page layout and style from report content.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which Python PDF generation library should I choose?",
      "display": "fpdf2 automatically breaks cells and flowing text at page margins.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which Python PDF generation library should I choose?",
      "display": "pydyf is a low-level PDF generator.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which Python PDF generation library should I choose?",
      "display": "Python pdfme flows report content onto additional pages.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Do drawing commands automatically create another page?",
      "display": "ReportLab Platypus tables can split across pages.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Do drawing commands automatically create another page?",
      "display": "fpdf2 page breaking is specifically triggered by cells or write text reaching the bottom margin.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: How can a ReportLab table repeat its headings?",
      "display": "Configure rows to repeat when the table splits across pages.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Why can a ReportLab frame reject content?",
      "display": "A frame raises an exception when an element cannot fit; resize or split that content.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: What does complex-script shaping require in fpdf2?",
      "display": "Install uharfbuzz before enabling the shaping engine.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: What does complex-script shaping require in fpdf2?",
      "display": "Use set_text_shaping to enable shaping on the document.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Does encrypting a PDF always require a password to open it?",
      "display": "In fpdf2, omitting the optional user password leaves document content accessible for everyone.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Why can embedded fonts make a Python pdfme report large?",
      "display": "Its TrueType font embedding does not subset the font file.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Does Python pdfme need an extra package for PNG images?",
      "display": "PNG input is converted to JPEG with Pillow, which must be installed.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "Library name, pymupdf",
      "display": "PyMuPDF",
      "asOf": "2026-11-20"
    },
    "F124": {
      "label": "Monthly downloads, pymupdf",
      "display": "168.7M",
      "asOf": "2026-11-20"
    },
    "F125": {
      "label": "License, pymupdf",
      "display": "AGPL-3.0 or commercial",
      "asOf": "2026-11-20"
    },
    "F126": {
      "label": "Package release, pymupdf",
      "display": "2.1",
      "asOf": "2026-11-20"
    },
    "F127": {
      "label": "Package release date, pymupdf",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F128": {
      "label": "Install, pymupdf",
      "display": "python3 -m pip install PyMuPDF",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Quickstart, pymupdf",
      "display": "import pymupdf\ndocument = pymupdf.open()\npage = document.new_page()\npage.insert_text((72, 72), 'Hello World!')\ndocument.save('hello.pdf')\n",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Official description, pymupdf",
      "display": "Extracts, analyzes, converts, and edits PDF and other documents.",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Quickstart source file, pymupdf",
      "display": "docs/recipes-text.rst",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Repository stars, pymupdf",
      "display": "11.2K",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "HTML document input, pymupdf",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Text/table layout, pymupdf",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Authoring model, pymupdf",
      "display": "PDF document toolkit with page/content creation, HTML/CSS Story layout, and conversion/manipulation; broad package count is not content-generation-only adoption.",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "License options, pymupdf",
      "display": "Selected distribution declares GNU Affero GPL3.0 or an Artifex commercial license.",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Project function, pymupdf",
      "display": "def add_section(self, section: Section, user_css: typing.Optional[str] = None) -> str:\n    \"\"\"Add markdown section to pdf.\"\"\"\n    where = section.rect + section.borders\n    html = self.m_d.render(self.apply_plugins(section.text))\n    story = fitz.Story(html=html, archive=section.root, user_css=user_css)\n    more = 1\n    while more:  # loop outputting the story\n        self.page_num += 1\n        section.page_count += 1\n        device = self.writer.begin_page(section.rect)\n        more, _ = story.place(where)  # layout into allowed rectangle\n        story.element_positions(self._recorder, {\"toc\": section.toc, \"pdfile\": self})\n        story.draw(device)\n        self.writer.end_page()\n\n    self.sections.append(section)\n\n    return html\n",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Project source file, pymupdf",
      "display": "markdown_pdf/__init__.py",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Project full_name, pymupdf",
      "display": "vb64/markdown-pdf",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Project stargazers_count, pymupdf",
      "display": "163",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Library name, reportlab",
      "display": "ReportLab",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Monthly downloads, reportlab",
      "display": "90.0M",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "License, reportlab",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Package release, reportlab",
      "display": "5.1.0",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Package release date, reportlab",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Install, reportlab",
      "display": "python3 -m pip install reportlab",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Quickstart, reportlab",
      "display": "from reportlab.pdfgen import canvas\ndef hello(c):\n    c.drawString(100,100,\"Hello World\")\nc = canvas.Canvas(\"hello.pdf\")\nhello(c)\nc.showPage()\nc.save()\n",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Repository stars, reportlab",
      "display": "88",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "HTML document input, reportlab",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Text/table layout, reportlab",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Authoring model, reportlab",
      "display": "Programmatic PDF canvas plus Platypus flowing report/table layouts, page templates, and explicit report styles.",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Repository and star scope, reportlab",
      "display": "GitHub metrics refer to MrBitBucket/reportlab-mirror. Official upstream source is the ReportLab Mercurial repository, whose chapter source matches the official starter.",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Project function, reportlab",
      "display": "def showtable(self, ident, widths=None):\n    \"\"\"\n    Displays a table.\n\n    Parameters:\n    - ident: The identifier of the table.\n    - widths: The widths of the columns (optional).\n    \"\"\"\n    if self.table_ident == ident:\n        self._spacer()\n        tbl = Table(self.table_data, colWidths=widths, repeatRows=1)\n        tbl.setStyle(self.table_style)\n        self.contents.append(tbl)\n        self.table_ident = None\n        # Optional notes if data in columns truncated\n        if len(self.note_data) > 0:\n            notes = [\"<br/><u>Notes</u>\"]\n            i = 1\n            for d in self.note_data:\n                notes.append(str(i) + \". \" + d)\n                i += 1\n            self.paragraph(\"<br/>\".join(notes))\n            self.note_data = []\n        self._spacer()\n",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Project source file, reportlab",
      "display": "cve_bin_tool/output_engine/pdfbuilder.py",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Project full_name, reportlab",
      "display": "ossf/cve-bin-tool",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Project stargazers_count, reportlab",
      "display": "1.8K",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Library name, weasyprint",
      "display": "WeasyPrint",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Monthly downloads, weasyprint",
      "display": "44.5M",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "License, weasyprint",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Package release, weasyprint",
      "display": "70.0",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Package release date, weasyprint",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Install, weasyprint",
      "display": "pip install weasyprint",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Quickstart, weasyprint",
      "display": "from weasyprint import HTML\nHTML('https://weasyprint.org/').write_pdf('/tmp/weasyprint-website.pdf')\n\n",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Official description, weasyprint",
      "display": "Produces documents.",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Quickstart source file, weasyprint",
      "display": "docs/first_steps.rst",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Repository stars, weasyprint",
      "display": "9.8K",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "HTML document input, weasyprint",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Text/table layout, weasyprint",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Authoring model, weasyprint",
      "display": "Dedicated HTML/CSS-to-PDF document renderer, including paged-media layout; system rendering dependencies and document inputs remain explicit.",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Library name, pydyf",
      "display": "pydyf",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Monthly downloads, pydyf",
      "display": "42.5M",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "License, pydyf",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Package release, pydyf",
      "display": "0.13.0",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Package release date, pydyf",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Install, pydyf",
      "display": "python3 -m pip install pydyf",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Quickstart, pydyf",
      "display": "import pydyf\ndocument = pydyf.PDF()\ndocument.add_page(pydyf.Dictionary({\n    'Type': '/Page',\n    'Parent': document.pages.reference,\n    'MediaBox': pydyf.Array([0, 0, 200, 200]),\n}))\nwith open('document.pdf', 'wb') as f:\n    document.write(f)\n",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Repository stars, pydyf",
      "display": "158",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "HTML document input, pydyf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Text/table layout, pydyf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Authoring model, pydyf",
      "display": "Low-level Python PDF object/stream generator; higher-level renderers such as WeasyPrint supply layout, fonts, and HTML processing.",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project function, pydyf",
      "display": "@staticmethod\ndef create_stitching_function(domain, encode, bounds, sub_functions):\n    return pydyf.Dictionary({\n        'FunctionType': 3,\n        'Domain': pydyf.Array(domain),\n        'Encode': pydyf.Array(encode),\n        'Bounds': pydyf.Array(bounds),\n        'Functions': pydyf.Array(sub_functions),\n    })\n",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project source file, pydyf",
      "display": "weasyprint/pdf/stream.py",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project full_name, pydyf",
      "display": "Kozea/WeasyPrint",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Project stargazers_count, pydyf",
      "display": "9.8K",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Library name, fpdf2",
      "display": "fpdf2",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Monthly downloads, fpdf2",
      "display": "22.7M",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "License, fpdf2",
      "display": "LGPL-3.0-only",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Package release, fpdf2",
      "display": "2.9.0",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Package release date, fpdf2",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Install, fpdf2",
      "display": "python3 -m pip install fpdf2",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Quickstart, fpdf2",
      "display": "from fpdf import FPDF\npdf = FPDF()\npdf.add_page()\npdf.set_font(\"helvetica\", style=\"B\", size=16)\npdf.cell(40, 10, \"Hello World!\")\npdf.output(\"tuto1.pdf\")\n",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Repository stars, fpdf2",
      "display": "1.6K",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "HTML document input, fpdf2",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Text/table layout, fpdf2",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Authoring model, fpdf2",
      "display": "Python page/text/table authoring with a supported HTML subset, fonts, and optional complex-script text shaping.",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Text shaping prerequisite, fpdf2",
      "display": "The OCR example calls set_text_shaping(True), which requires the optional HarfBuzz binding described by the publisher. Its host supplies registered fonts, page text, and coordinates.",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "HTML coverage, fpdf2",
      "display": "write_html supports the documented subset rather than arbitrary browser HTML/CSS.",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project function, fpdf2",
      "display": "def render(self, output_path: Path) -> None:\n    \"\"\"Render page to PDF file.\n\n    Args:\n        output_path: Output PDF file path\n    \"\"\"\n    # Create PDF with custom page size\n    pdf = FPDF(\n        unit=\"pt\",\n        format=(\n            self.coord_transform.page_width_pt,\n            self.coord_transform.page_height_pt,\n        ),\n    )\n    pdf.set_auto_page_break(auto=False)\n\n    # Enable text shaping for complex scripts\n    pdf.set_text_shaping(True)\n\n    # Disable cell margin to ensure precise text positioning\n    # fpdf2's cell() adds c_margin padding by default, which shifts text\n    pdf.c_margin = 0\n\n    # Set text mode for invisible text\n    if self.invisible_text:\n        pdf.text_mode = TextMode.INVISIBLE\n    else:\n        pdf.text_mode = TextMode.FILL\n\n    # Render content to PDF\n    self.render_to_pdf(pdf)\n\n    # Write PDF\n    pdf.output(str(output_path))\n",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project source file, fpdf2",
      "display": "src/ocrmypdf/fpdf_renderer/renderer.py",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Project full_name, fpdf2",
      "display": "ocrmypdf/OCRmyPDF",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Project stargazers_count, fpdf2",
      "display": "35.3K",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Library name, pdfkit",
      "display": "pdfkit",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Monthly downloads, pdfkit",
      "display": "5.0M",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "License, pdfkit",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Package release, pdfkit",
      "display": "1.0.0",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Package release date, pdfkit",
      "display": "Nov 2021",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Install, pdfkit",
      "display": "python3 -m pip install pdfkit",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Quickstart, pdfkit",
      "display": "import pdfkit\npdfkit.from_string('Hello!', 'out.pdf')\n",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Official description, pdfkit",
      "display": "Converts HTML to PDF through wkhtmltopdf and the WebKit rendering engine.",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Quickstart source file, pdfkit",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Repository stars, pdfkit",
      "display": "2.0K",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "HTML document input, pdfkit",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Text/table layout, pdfkit",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Authoring model, pdfkit",
      "display": "Python wrapper around a separately installed wkhtmltopdf renderer for HTML-to-PDF conversion; publisher deprecation status is material.",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "External renderer and maintenance, pdfkit",
      "display": "Requires wkhtmltopdf; publisher marks the Python wrapper deprecated to match that project status.",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Project function, pdfkit",
      "display": "def md_to_pdf(self, jarvis):\n    jarvis.say('')\n    jarvis.say('This option will help you convert Markdown files to PDF')\n    while True:\n        md_file = jarvis.input('Enter the full path of the Markdown file (or type \"quit\" to exit): ').strip()\n        if md_file.lower() in ['q', 'quit', 'exit']:\n            jarvis.say(\"Goodbye!\", Fore.CYAN)\n            break\n\n        if not os.path.isfile(md_file):\n            jarvis.say('The file does not exist. Please try again.', Fore.RED)\n            continue\n\n        if not md_file.lower().endswith('.md'):\n            jarvis.say('The file must be a Markdown (.md) file.', Fore.RED)\n            continue\n\n        try:\n            with open(md_file, 'r', encoding='utf-8') as f:\n                md_content = f.read()\n\n            # Convert Markdown to HTML \n            html_content = markdown.markdown(md_content, extensions=['fenced_code', 'tables', 'toc'])\n\n            # Process HTML to convert relative image paths to absolute paths\n            html_content = self.convert_image_paths(html_content, os.path.dirname(os.path.abspath(md_file)))\n\n            pdf_file = os.path.splitext(md_file)[0] + '.pdf'\n\n            options = {\n                'enable-local-file-access': None,\n            }\n            config = pdfkit.configuration()\n\n            # Convert HTML to PDF \n            pdfkit.from_string(html_content, pdf_file, options=options, configuration=config)\n\n            jarvis.say(f\"Converted '{md_file}' to '{pdf_file}'.\", Fore.GREEN)\n        except Exception as e:\n            jarvis.say(f\"An error occurred: {e}\", Fore.RED)\n        break\n",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project source file, pdfkit",
      "display": "jarviscli/plugins/mdtopdf.py",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Project full_name, pdfkit",
      "display": "sukeesh/Jarvis",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Project stargazers_count, pdfkit",
      "display": "3.8K",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Project function, pdfkit",
      "display": "def add_download_pdf(\n    name, text, button_text=\"Download PDF\", is_markdown=True, disabled=False\n):\n    if not name.endswith(\".pdf\"):\n        name += \".pdf\"\n    # Convert text to HTML if it's in Markdown format\n    text = markdown2.markdown(text) if is_markdown else text\n    text = f\"<style>{style_pdf}</style> \\n\\n {text} <hr>{text_label}\"\n\n    # Generate PDF from HTML string\n    config_pdf = config_pdfkit()\n\n    with st.spinner(\"Preparing PDF download...\"):\n        with tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=False) as temp_file:\n            pdfkit.from_string(\n                text, temp_file.name, options=pdfkit_options, configuration=config_pdf\n            )\n\n            # Provide download button for the generated PDF\n            with open(temp_file.name, \"rb\") as f:\n                st.download_button(\n                    button_text,\n                    f,\n                    file_name=name,\n                    mime=\"application/pdf\",\n                    disabled=disabled,\n                )\n",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Project source file, pdfkit",
      "display": "app/util/download_pdf.py",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Project full_name, pdfkit",
      "display": "microsoft/intelligence-toolkit",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Project stargazers_count, pdfkit",
      "display": "112",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Library name, xhtml2pdf",
      "display": "xhtml2pdf",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Monthly downloads, xhtml2pdf",
      "display": "4.3M",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "License, xhtml2pdf",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Package release, xhtml2pdf",
      "display": "0.2.28",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Package release date, xhtml2pdf",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Install, xhtml2pdf",
      "display": "pip install xhtml2pdf[all]",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Quickstart, xhtml2pdf",
      "display": "import io\n\nfrom xhtml2pdf import pisa\n\noutput = io.BytesIO()\n\npisa.CreatePDF(\n    \"<html><body><p>To PDF or not to PDF</p></body></html>\",  # page data\n    dest=output,                                              # destination \"file\"\n)\n\n# You can get the PDF file bytes with `.getbuffer()`\nprint(len(output.getbuffer()))\n\n",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Official description, xhtml2pdf",
      "display": "Generates PDF from HTML and CSS.",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Quickstart source file, xhtml2pdf",
      "display": "docs/quickstart.rst",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Repository stars, xhtml2pdf",
      "display": "2.4K",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "HTML document input, xhtml2pdf",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Text/table layout, xhtml2pdf",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Authoring model, xhtml2pdf",
      "display": "HTML/CSS PDF generator based on ReportLab, with documented supported markup/styles rather than full modern browser CSS.",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Project function, xhtml2pdf",
      "display": "def html_to_pdf(content, encoding=\"utf-8\",\n                link_callback=fetch_resources, **kwargs):\n    \"\"\"\n    Converts html ``content`` into PDF document.\n\n    :param unicode content: html content\n    :returns: PDF content\n    :rtype: :class:`bytes`\n    :raises: :exc:`~easy_pdf.exceptions.PDFRenderingError`\n    \"\"\"\n    src = BytesIO(content.encode(encoding))\n    dest = BytesIO()\n\n    pdf = pisa.pisaDocument(src, dest, encoding=encoding,\n                            link_callback=link_callback, **kwargs)\n    if pdf.err:\n        logger.error(\"Error rendering PDF document\")\n        for entry in pdf.log:\n            if entry[0] == xhtml2pdf.default.PML_ERROR:\n                logger_x2p.error(\"line %s, msg: %s, fragment: %s\", entry[1], entry[2], entry[3])\n        raise PDFRenderingError(\"Errors rendering PDF\", content=content, log=pdf.log)\n\n    if pdf.warn:\n        for entry in pdf.log:\n            if entry[0] == xhtml2pdf.default.PML_WARNING:\n                logger_x2p.warning(\"line %s, msg: %s, fragment: %s\", entry[1], entry[2], entry[3])\n\n    return dest.getvalue()\n",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Project source file, xhtml2pdf",
      "display": "easy_pdf/rendering.py",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Project full_name, xhtml2pdf",
      "display": "nigma/django-easy-pdf",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Project stargazers_count, xhtml2pdf",
      "display": "366",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Library name, borb",
      "display": "borb",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Monthly downloads, borb",
      "display": "377.1K",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "License, borb",
      "display": "AGPL-3.0-or-later",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Package release, borb",
      "display": "3.0.9",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Package release date, borb",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Install, borb",
      "display": "python3 -m pip install borb",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Quickstart, borb",
      "display": "from pathlib import Path\nfrom borb.pdf import Document, Page, PageLayout, SingleColumnLayout, Paragraph, PDF\nd: Document = Document()\np: Page = Page()\nd.append_page(p)\nl: PageLayout = SingleColumnLayout(p)\nl.append_layout_element(Paragraph('Hello World!'))\nPDF.write(what=d, where_to=\"assets/output.pdf\")\n",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Official description, borb",
      "display": "Reads, creates, and edits PDF files.",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Quickstart source file, borb",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Repository stars, borb",
      "display": "3.6K",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "HTML document input, borb",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Text/table layout, borb",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Authoring model, borb",
      "display": "PDF document/page/layout primitives and report content such as paragraphs, tables, images, and lists; publisher offers AGPL and commercial licensing.",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Publisher licensing options, borb",
      "display": "Publisher advertises AGPL and a commercial license.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python PDF generation libraries ReportLab fpdf2 pydyf pdfme code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
