{
  "id": "task_libraries:html-to-pdf/python",
  "path": "/exapedia/python-html-to-pdf-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python HTML to PDF libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python HTML to PDF libraries render a web page or an HTML string as a PDF document. A dedicated renderer lays out HTML and CSS itself rather than printing the page from a headless browser. These libraries let apps generate invoices, reports, and receipts from the same templates they show on the web."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python HTML to PDF 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": "F129"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#playwright",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#weasyprint",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F164"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#selenium",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pdfkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#xhtml-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F217"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#seleniumbase",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyppeteer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F247"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            ]
          ],
          "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": "F130"
        },
        {
          "t": "text",
          "text": ", a count that covers all its PDF work."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "JavaScript rendering",
            "Chrome or Firefox"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pymupdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F129"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#playwright",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#weasyprint",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F164"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#selenium",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pdfkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#xhtml-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F217"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#seleniumbase",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyppeteer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F247"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "pymupdf",
          "name": [
            {
              "t": "fact",
              "fact": "F129"
            }
          ],
          "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": "F136"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pymupdf.readthedocs.io/en/latest/story-class.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F129"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/vb64/markdown-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                },
                {
                  "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": "F145"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pymupdf%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F129"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pymupdf\n\nHTML = \"\"\"\n<p style=\"font-family: sans-serif;color: blue\">Hello World!</p>\n\"\"\"\n\nMEDIABOX = pymupdf.paper_rect(\"letter\")  # output page format: Letter\nWHERE = MEDIABOX + (36, 36, -36, -36)  # leave borders of 0.5 inches\n\nstory = pymupdf.Story(html=HTML)  # create story from HTML\nwriter = pymupdf.DocumentWriter(\"output.pdf\")  # create the writer\n\nmore = 1  # will indicate end of input once it is set to 0\n\nwhile more:  # loop outputting the story\n    device = writer.begin_page(MEDIABOX)  # make new page\n    more, _ = story.place(WHERE)  # layout into allowed rectangle\n    story.draw(device)  # write on page\n    writer.end_page()  # finish page\n\nwriter.close()  # close output file\n\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pymupdf.readthedocs.io/en/latest/recipes-stories.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "recipes-stories.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F134"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "playwright",
          "name": [
            {
              "t": "fact",
              "fact": "F148"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/microsoft/playwright-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/playwright"
            },
            {
              "label": "Docs",
              "href": "https://playwright.dev/python/docs/api/class-page#page-pdf"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F14"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            },
            {
              "label": "Runs on",
              "value": [
                {
                  "t": "fact",
                  "fact": "F7"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://playwright.dev/python/docs/api/class-page#page-pdf",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F148"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/unclecode/crawl4ai",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def export_pdf(self, page: Page) -> bytes:\n    \"\"\"\n    Exports the current page as a PDF.\n\n    Args:\n        page (Page): The Playwright page object\n\n    Returns:\n        bytes: The PDF data\n    \"\"\"\n    pdf_data = await page.pdf(print_background=True)\n    return pdf_data\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/unclecode/crawl4ai/blob/cae74b203a33994f7e13b9052c3b0d5c93daa0e6/crawl4ai/async_crawler_strategy.py#L1624-L1635",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20playwright%20for%20paginated%20HTML%20templates%2C%20renderer%20error%20handling%20and%20browser%20PDF%20exports&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": "F148"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from playwright.sync_api import sync_playwright\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch()\n    page = browser.new_page()\n    page.goto(\"https://playwright.dev\")\n    print(page.title())\n    browser.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/microsoft/playwright/main/docs/src/library-python.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "library-python.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F153"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "weasyprint",
          "name": [
            {
              "t": "fact",
              "fact": "F164"
            }
          ],
          "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/api_reference.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F39"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://doc.courtbouillon.org/weasyprint/stable/api_reference.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F164"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F46"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F47"
                }
              ]
            }
          ],
          "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.html"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20weasyprint%20for%20paginated%20HTML%20templates%2C%20renderer%20error%20handling%20and%20browser%20PDF%20exports&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": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F164"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F169"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "selenium",
          "name": [
            {
              "t": "fact",
              "fact": "F176"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/SeleniumHQ/selenium"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/selenium"
            },
            {
              "label": "Docs",
              "href": "https://www.selenium.dev/documentation/webdriver/interactions/print_page/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F183"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.selenium.dev/documentation/webdriver/interactions/print_page/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F176"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/bellingcat/auto-archiver",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F192"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@logger.catch\ndef _enrich_full_page_pdf(self, sb: SB, to_enrich: Metadata):\n    \"\"\"\n    Enriches the full page PDF of the Metadata object.\n    This method is called by the enrich method.\n    \"\"\"\n    result = sb.driver.execute_cdp_cmd(\"Page.printToPDF\", {\"printBackground\": True, \"landscape\": False})\n\n    pdf_data = base64.b64decode(result[\"data\"])\n\n    pdf_filename = os.path.join(self.tmp_dir, f\"pdf{random_str(6)}.pdf\")\n    with open(pdf_filename, \"wb\") as f:\n        f.write(pdf_data)\n\n    to_enrich.add_media(Media(filename=pdf_filename), id=\"pdf\")\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/bellingcat/auto-archiver/blob/ceef7213eb36539978065dcd49ba162315e98b70/src/auto_archiver/modules/antibot_extractor_enricher/antibot_extractor_enricher.py#L314-L328",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=selenium%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F176"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from selenium import webdriver\nfrom selenium.webdriver.common.by import By\n\ndriver = webdriver.Chrome()\n\ndriver.get(\"https://www.selenium.dev/selenium/web/web-form.html\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.selenium.dev/documentation/webdriver/getting_started/",
                  "label": [
                    {
                      "t": "text",
                      "text": "first_script.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pdfkit",
          "name": [
            {
              "t": "fact",
              "fact": "F194"
            }
          ],
          "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": "F201"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "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": "F194"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/sukeesh/Jarvis",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F211"
                    }
                  ]
                },
                {
                  "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": "F210"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pdfkit%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F194"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/microsoft/intelligence-toolkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F215"
                    }
                  ]
                },
                {
                  "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": "F214"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pdfkit%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F194"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pdfkit\n\npdfkit.from_url('http://google.com', '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": "F199"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "xhtml-pdf",
          "name": [
            {
              "t": "fact",
              "fact": "F217"
            }
          ],
          "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/quickstart.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F65"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://xhtml2pdf.readthedocs.io/en/latest/quickstart.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F217"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F71"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nigma/django-easy-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                },
                {
                  "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": "F230"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20xhtml2pdf%20for%20paginated%20HTML%20templates%2C%20renderer%20error%20handling%20and%20browser%20PDF%20exports&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": "F217"
                    },
                    {
                      "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.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F222"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "seleniumbase",
          "name": [
            {
              "t": "fact",
              "fact": "F233"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/seleniumbase/SeleniumBase"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/seleniumbase"
            },
            {
              "label": "Docs",
              "href": "https://raw.githubusercontent.com/seleniumbase/SeleniumBase/v4.58.1/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F240"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/seleniumbase/SeleniumBase/v4.58.1/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F233"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from seleniumbase import sb_cdp\n\nsb = sb_cdp.Chrome(fast=True)\nsb.goto(\"https://hn.algolia.com/?query=seleniumbase\")\nelements = sb.find_elements(\"div.Story_title > a\")\nfor element in elements:\n    print(\"--> \" + element.text)\nsb.save_as_pdf(\"sb_news.pdf\", folder=\"./downloaded_files/\")\nprint(\"*** PDF saved to: ./downloaded_files/sb_news.pdf\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/seleniumbase/SeleniumBase/v4.58.1/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=seleniumbase%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F233"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F238"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyppeteer",
          "name": [
            {
              "t": "fact",
              "fact": "F247"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pyppeteer/pyppeteer"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyppeteer"
            },
            {
              "label": "Docs",
              "href": "https://raw.githubusercontent.com/pyppeteer/pyppeteer/2.0.0/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F254"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/pyppeteer/pyppeteer/2.0.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F247"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/jupyter/nbconvert",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F264"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def main(temp_file):\n    \"\"\"Run main pyppeteer script.\"\"\"\n    args = [\"--no-sandbox\"] if self.disable_sandbox else []\n    browser = await self._check_launch_reqs()(\n        handleSIGINT=False, handleSIGTERM=False, handleSIGHUP=False, args=args\n    )\n    page = await browser.newPage()\n    await page.emulateMedia(\"print\")\n    await page.waitFor(100)\n    await page.goto(f\"file://{temp_file.name}\", waitUntil=\"networkidle0\")\n    await page.waitFor(100)\n\n    pdf_params = {\"printBackground\": True}\n    if not self.paginate:\n        # Floating point precision errors cause the printed\n        # PDF from spilling over a new page by a pixel fraction.\n        dimensions = await page.evaluate(\n            \"\"\"() => {\n            const rect = document.body.getBoundingClientRect();\n            return {\n            width: Math.ceil(rect.width) + 1,\n            height: Math.ceil(rect.height) + 1,\n            }\n        }\"\"\"\n        )\n        width = dimensions[\"width\"]\n        height = dimensions[\"height\"]\n        # 200 inches is the maximum size for Adobe Acrobat Reader.\n        pdf_params.update(\n            {\n                \"width\": min(width, 200 * 72),\n                \"height\": min(height, 200 * 72),\n            }\n        )\n    pdf_data = await page.pdf(pdf_params)\n\n    await browser.close()\n    return pdf_data\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/jupyter/nbconvert/blob/5baf14103c3bca41cf3c0abd8717a9996b857028/nbconvert/exporters/webpdf.py#L91-L128",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F263"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pyppeteer%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F247"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import asyncio\nfrom pyppeteer import launch\n\nasync def main():\n    browser = await launch()\n    page = await browser.newPage()\n    await page.goto('https://example.com')\n    await page.screenshot({'path': 'example.png'})\n    await browser.close()\n\nasyncio.get_event_loop().run_until_complete(main())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/pyppeteer/pyppeteer/2.0.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F252"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python HTML to PDF library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#weasyprint",
          "label": [
            {
              "t": "text",
              "text": "WeasyPrint"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits invoices, reports, and other documents styled with print CSS. "
        },
        {
          "t": "link",
          "href": "#playwright",
          "label": [
            {
              "t": "text",
              "text": "Playwright"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits pages that need JavaScript to render. "
        },
        {
          "t": "link",
          "href": "#xhtml-pdf",
          "label": [
            {
              "t": "fact",
              "fact": "F217"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits basic layouts converted without a browser."
        }
      ]
    },
    {
      "q": "What is WeasyPrint?",
      "a": [
        {
          "t": "link",
          "href": "#weasyprint",
          "label": [
            {
              "t": "text",
              "text": "WeasyPrint"
            }
          ]
        },
        {
          "t": "text",
          "text": " turns HTML and CSS into PDF documents with print features such as page sizes, headers, and footers. It does not execute JavaScript."
        }
      ]
    },
    {
      "q": "How do I convert HTML to PDF with Playwright in Python?",
      "a": [
        {
          "t": "text",
          "text": "Open the page in headless Chromium with "
        },
        {
          "t": "link",
          "href": "#playwright",
          "label": [
            {
              "t": "text",
              "text": "Playwright"
            }
          ]
        },
        {
          "t": "text",
          "text": " and call "
        },
        {
          "t": "code",
          "text": "page.pdf"
        },
        {
          "t": "text",
          "text": ". The call supports print CSS, backgrounds, page sizes, and headers and footers."
        }
      ]
    },
    {
      "q": "WeasyPrint vs wkhtmltopdf: which should I use?",
      "a": [
        {
          "t": "link",
          "href": "#weasyprint",
          "label": [
            {
              "t": "text",
              "text": "WeasyPrint"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a maintained HTML and CSS renderer for paged documents. wkhtmltopdf, which "
        },
        {
          "t": "link",
          "href": "#pdfkit",
          "label": [
            {
              "t": "text",
              "text": "PDFKit"
            }
          ]
        },
        {
          "t": "text",
          "text": " wraps, carries a deprecation warning along with PDFKit itself."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, playwright",
      "display": "Playwright",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, playwright",
      "display": "129.4M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, playwright",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, playwright",
      "display": "1.65.2, Nov 2026",
      "asOf": "2026-11-14"
    },
    "F5": {
      "label": "Package release date, playwright",
      "display": "Nov 2026",
      "asOf": "2026-11-14"
    },
    "F6": {
      "label": "Repository stars, playwright",
      "display": "15.1K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Runtime, playwright",
      "display": "Chromium",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "HTML input, playwright",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Print CSS, playwright",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "JavaScript execution, playwright",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Headers and footers, playwright",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "Output formats, playwright",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "Install, playwright",
      "display": "pip install playwright",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "What it does, playwright",
      "display": "Controls browser pages and exports their print layouts as PDF.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, playwright",
      "display": "Executes page JavaScript",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, playwright",
      "display": "Render script-driven content in Chromium before exporting a PDF.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "strengths lead, playwright",
      "display": "Selects print or screen styles",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "strengths, playwright",
      "display": "Choose the media type before generating the PDF.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, playwright",
      "display": "Browser binaries need separate installation",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, playwright",
      "display": "Install Chromium before running the PDF example.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, playwright",
      "display": "from playwright.sync_api import sync_playwright\n\nhtml_content = \"\"\"\n<html>\n<head><title>Sample PDF</title></head>\n<body><h1>Hello, PDF!</h1></body>\n</html>\n\"\"\"\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch()\n    page = browser.new_page()\n    page.set_content(html_content)\n    page.pdf(path='sample.pdf', format='Letter')\n    browser.close()\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, playwright",
      "display": "async def export_pdf(self, page: Page) -> bytes:\n    \"\"\"\n    Exports the current page as a PDF.\n\n    Args:\n        page (Page): The Playwright page object\n\n    Returns:\n        bytes: The PDF data\n    \"\"\"\n    pdf_data = await page.pdf(print_background=True)\n    return pdf_data\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, playwright",
      "display": "async_crawler_strategy.py · export_pdf()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, playwright",
      "display": "unclecode/crawl4ai",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, unclecode/crawl4ai",
      "display": "87.4K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, unclecode/crawl4ai",
      "display": "Nov 2026",
      "asOf": "2026-11-13"
    },
    "F27": {
      "label": "Library name, weasyprint",
      "display": "WeasyPrint",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, weasyprint",
      "display": "42.1M",
      "asOf": "2026-11-16"
    },
    "F29": {
      "label": "License, weasyprint",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, weasyprint",
      "display": "70.0, Sep 2026",
      "asOf": "2026-09-08"
    },
    "F31": {
      "label": "Package release date, weasyprint",
      "display": "Sep 2026",
      "asOf": "2026-09-08"
    },
    "F32": {
      "label": "Repository stars, weasyprint",
      "display": "9.8K",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "HTML input, weasyprint",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Print CSS, weasyprint",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "JavaScript execution, weasyprint",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Headers and footers, weasyprint",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Output formats, weasyprint",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "Install, weasyprint",
      "display": "pip install weasyprint",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "What it does, weasyprint",
      "display": "Turns HTML pages into PDF documents.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, weasyprint",
      "display": "Supports paged print styles",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, weasyprint",
      "display": "Use CSS page rules, margins, and page counters for print layouts.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths lead, weasyprint",
      "display": "Renders HTML without browser automation",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "strengths, weasyprint",
      "display": "Generate PDFs with WeasyPrint’s own layout engine.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, weasyprint",
      "display": "JavaScript content needs another renderer",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, weasyprint",
      "display": "Render script-generated content before passing HTML to WeasyPrint.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "limitations lead, weasyprint",
      "display": "Relative assets need a base",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "limitations, weasyprint",
      "display": "Set base_url for relative image and stylesheet paths in HTML strings.",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Quickstart, weasyprint",
      "display": "from weasyprint import HTML, CSS\nHTML('https://weasyprint.org/').write_pdf('/tmp/weasyprint-website.pdf',\n    stylesheets=[CSS(string='body { font-family: serif !important }')])\n\n",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project function, weasyprint",
      "display": "def get_document(self):\n    # ...\n    base_url = self.get_base_url()\n    url_fetcher = self.get_url_fetcher()\n    font_config = self.get_font_config()\n\n    html = weasyprint.HTML(\n        string=super().rendered_content,\n        base_url=base_url,\n        url_fetcher=url_fetcher,\n    )\n\n    self._options.setdefault(\n        'stylesheets',\n        self.get_css(base_url, url_fetcher, font_config),\n    )\n\n    return html.render(\n        font_config=font_config,\n        **self._options,\n    )\n",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project function reference, weasyprint",
      "display": "views.py · get_document()",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project repository, weasyprint",
      "display": "fdemmer/django-weasyprint",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Project stars, fdemmer/django-weasyprint",
      "display": "399",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Project push date, fdemmer/django-weasyprint",
      "display": "Nov 2026",
      "asOf": "2026-11-01"
    },
    "F54": {
      "label": "Library name, xhtml2pdf",
      "display": "xhtml2pdf",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Monthly downloads, xhtml2pdf",
      "display": "4.1M",
      "asOf": "2026-11-16"
    },
    "F56": {
      "label": "License, xhtml2pdf",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Package release, xhtml2pdf",
      "display": "0.2.28, Oct 2026",
      "asOf": "2026-10-25"
    },
    "F58": {
      "label": "Package release date, xhtml2pdf",
      "display": "Oct 2026",
      "asOf": "2026-10-25"
    },
    "F59": {
      "label": "Repository stars, xhtml2pdf",
      "display": "2.4K",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "HTML input, xhtml2pdf",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Print CSS, xhtml2pdf",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Headers and footers, xhtml2pdf",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "Output formats, xhtml2pdf",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "Install, xhtml2pdf",
      "display": "pip install xhtml2pdf",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "What it does, xhtml2pdf",
      "display": "Converts HTML and CSS into PDF documents through Python.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, xhtml2pdf",
      "display": "Defines reusable page frames",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, xhtml2pdf",
      "display": "Place fixed headers and footers in static frames.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "strengths lead, xhtml2pdf",
      "display": "Writes PDF into memory",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "strengths, xhtml2pdf",
      "display": "Write PDF data into a BytesIO destination.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, xhtml2pdf",
      "display": "Table rows split at boundaries",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, xhtml2pdf",
      "display": "Split long content across rows when a cell exceeds its page space.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Quickstart, xhtml2pdf",
      "display": "from xhtml2pdf import pisa\n\n# enable logging\npisa.showLogging()\n\nhtml_source = \"<html><body><p>To PDF or not to PDF</p></body></html>\"\n\nwith open(\"test.pdf\", \"w+b\") as result_file:\n    # convert HTML to PDF\n    pisa_status = pisa.CreatePDF(\n        html_source,       # page data\n        dest=result_file,  # destination file\n    )\n\n    # Check for errors\n    if pisa_status.err:\n        print(\"An error occurred!\")\n\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project function, xhtml2pdf",
      "display": "def html_to_pdf(content, encoding=\"utf-8\",\n                link_callback=fetch_resources, **kwargs):\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-17"
    },
    "F74": {
      "label": "Project function reference, xhtml2pdf",
      "display": "rendering.py · html_to_pdf()",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project repository, xhtml2pdf",
      "display": "nigma/django-easy-pdf",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project stars, nigma/django-easy-pdf",
      "display": "366",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Project push date, nigma/django-easy-pdf",
      "display": "Jan 2022",
      "asOf": "2022-01-16"
    },
    "F78": {
      "label": "Library name, docraptor",
      "display": "DocRaptor",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Monthly downloads, docraptor",
      "display": "96.1K",
      "asOf": "2026-11-16"
    },
    "F80": {
      "label": "License, docraptor",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Package release, docraptor",
      "display": "3.1.0, Sep 2023",
      "asOf": "2023-09-27"
    },
    "F82": {
      "label": "Package release date, docraptor",
      "display": "Sep 2023",
      "asOf": "2023-09-27"
    },
    "F83": {
      "label": "Repository stars, docraptor",
      "display": "11",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Runtime, docraptor",
      "display": "Hosted Prince",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "HTML input, docraptor",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Print CSS, docraptor",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "JavaScript execution, docraptor",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Headers and footers, docraptor",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Output formats, docraptor",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Install, docraptor",
      "display": "pip install docraptor",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "What it does, docraptor",
      "display": "Calls a hosted API to turn HTML into PDF documents.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths lead, docraptor",
      "display": "Uses Prince for print rendering",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "strengths, docraptor",
      "display": "Apply print-media CSS through DocRaptor’s hosted Prince engine.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "strengths lead, docraptor",
      "display": "Offers selectable JavaScript engines",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "strengths, docraptor",
      "display": "Enable JavaScript processing when the document needs scripts.",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "limitations lead, docraptor",
      "display": "JavaScript starts disabled",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "limitations, docraptor",
      "display": "Enable the javascript parameter for script-generated content.",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "limitations lead, docraptor",
      "display": "Test documents carry a watermark",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "limitations, docraptor",
      "display": "Use a production request when the PDF must be unwatermarked.",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Quickstart, docraptor",
      "display": "import docraptor\n\ndoc_api = docraptor.DocApi()\n# this key works in test mode!\ndoc_api.api_client.configuration.username = 'YOUR_API_KEY_HERE'\n\ntry:\n    response = doc_api.create_doc({\n        'test': True,  # test documents are free but watermarked\n        'document_type': 'pdf',\n        'document_content': '<html><body>Hello World!</body></html>',\n        # 'document_url': 'https://docraptor.com/examples/invoice.html',\n        # 'javascript': True,\n        # 'prince_options': # {\n        #    'media': 'print', # @media 'screen' or 'print' CSS\n        #    'baseurl': 'https://yoursite.com', # the base URL for any relative URLs\n        # },\n    })\n\n    # create_doc() returns a binary string\n    with open('docraptor-hello.pdf', 'w+b') as f:\n        binary_formatted_response = bytearray(response)\n        f.write(binary_formatted_response)\n        f.close()\n    print('Successfully created docraptor-hello.pdf!')\nexcept docraptor.rest.ApiException as error:\n    print(error.status)\n    print(error.reason)\n    print(error.body)\n\n",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "CSS page layouts",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose weasyprint",
      "display": "paged print rules and counters",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "CSS page layouts",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "When to consider playwright",
      "display": "the document depends on JavaScript execution",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "Repeated headers and footers",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose xhtml2pdf",
      "display": "static page frames",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "repeated headers and footers",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "When to consider weasyprint",
      "display": "CSS page rules fit the required layout",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need",
      "display": "JavaScript-driven browser content",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Why choose playwright",
      "display": "browser JavaScript execution",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need in introduction",
      "display": "JavaScript-driven browser content",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "When to consider weasyprint",
      "display": "static HTML and print CSS are sufficient",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Developer need",
      "display": "Hosted Prince rendering",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Why choose docraptor",
      "display": "hosted print-media rendering",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "Developer need in introduction",
      "display": "hosted Prince rendering",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "When to consider weasyprint",
      "display": "rendering should run inside the application environment",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "Page introduction",
      "display": "Python HTML to PDF libraries let application developers render HTML content as PDF documents.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: What is the best Python HTML-to-PDF library?",
      "display": "Choose WeasyPrint for paged CSS layouts.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: What is the best Python HTML-to-PDF library?",
      "display": "xhtml2pdf uses static frames for repeated page content.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: What is the best Python HTML-to-PDF library?",
      "display": "Playwright runs JavaScript in a browser context.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: What is the best Python HTML-to-PDF library?",
      "display": "DocRaptor uses Prince for hosted print rendering.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can WeasyPrint render JavaScript-generated content?",
      "display": "WeasyPrint explicitly excludes JavaScript execution; supply already-rendered HTML or use a browser-based renderer.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: How do I choose print or screen CSS for browser PDFs?",
      "display": "Playwright page.pdf uses print media by default; call emulate_media first to choose screen media.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Why are images or styles missing from an HTML string?",
      "display": "WeasyPrint needs a base URL to resolve relative asset paths when the input is an HTML string.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: How can I repeat headers and footers on every page?",
      "display": "xhtml2pdf provides static frames for repeated headers and footers.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: How can I repeat headers and footers on every page?",
      "display": "DocRaptor positions headers and footers inside explicitly sized page margins.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Why is JavaScript missing from a DocRaptor PDF?",
      "display": "DocRaptor disables JavaScript by default; enable the appropriate JavaScript parameter when generating the document.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Why does an HTML table shrink when converted to PDF?",
      "display": "xhtml2pdf splits tables at row boundaries and defaults oversized-cell handling to shrink; choose a different fit mode or split the content.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "Library name, pymupdf",
      "display": "PyMuPDF",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Monthly downloads, pymupdf",
      "display": "168.7M",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "License, pymupdf",
      "display": "AGPLv3",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Package release, pymupdf",
      "display": "2.1",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release date, pymupdf",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Install, pymupdf",
      "display": "pip install pymupdf",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Quickstart, pymupdf",
      "display": "import pymupdf\n\nHTML = \"\"\"\n<p style=\"font-family: sans-serif;color: blue\">Hello World!</p>\n\"\"\"\n\nMEDIABOX = pymupdf.paper_rect(\"letter\")  # output page format: Letter\nWHERE = MEDIABOX + (36, 36, -36, -36)  # leave borders of 0.5 inches\n\nstory = pymupdf.Story(html=HTML)  # create story from HTML\nwriter = pymupdf.DocumentWriter(\"output.pdf\")  # create the writer\n\nmore = 1  # will indicate end of input once it is set to 0\n\nwhile more:  # loop outputting the story\n    device = writer.begin_page(MEDIABOX)  # make new page\n    more, _ = story.place(WHERE)  # layout into allowed rectangle\n    story.draw(device)  # write on page\n    writer.end_page()  # finish page\n\nwriter.close()  # close output file\n\n",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Official description, pymupdf",
      "display": "Extracts, analyzes, converts, and manipulates PDF and other documents.",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Quickstart source file, pymupdf",
      "display": "docs/recipes-stories.rst",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Repository stars, pymupdf",
      "display": "11.2K",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "JavaScript rendering, pymupdf",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Chrome or Firefox, pymupdf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Rendering path, pymupdf",
      "display": "Public Story HTML/CSS layout integrated with a DocumentWriter, alongside PDF document manipulation; not a full live browser.",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Python and native dependencies, pymupdf",
      "display": "Requires-Python: >=3.11; Selected native/Python document renderer; no Chrome/Firefox runtime in this path.",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Licensing model, pymupdf",
      "display": "Community AGPLv3 or a separate Artifex commercial license; example project grants do not relicense this SDK.",
      "asOf": "2026-11-20"
    },
    "F144": {
      "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"
    },
    "F145": {
      "label": "Project source file, pymupdf",
      "display": "markdown_pdf/__init__.py",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Project full_name, pymupdf",
      "display": "vb64/markdown-pdf",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Project stargazers_count, pymupdf",
      "display": "163",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Library name, playwright",
      "display": "Playwright",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Monthly downloads, playwright",
      "display": "134.2M",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "License, playwright",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Package release, playwright",
      "display": "1.65.2",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Package release date, playwright",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Install, playwright",
      "display": "pip install playwright\nplaywright install chromium",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Quickstart, playwright",
      "display": "from playwright.sync_api import sync_playwright\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch()\n    page = browser.new_page()\n    page.goto(\"https://playwright.dev\")\n    print(page.title())\n    browser.close()\n",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Repository stars, playwright",
      "display": "15.1K",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "JavaScript rendering, playwright",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Chrome or Firefox, playwright",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Rendering path, playwright",
      "display": "General browser automation; Page.pdf uses headless Chromium and supports print CSS, backgrounds, page sizing, and headers/footers.",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Python and native dependencies, playwright",
      "display": "Requires-Python: >=3.10; Browser binary required for PDF output.",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project function, playwright",
      "display": "async def export_pdf(self, page: Page) -> bytes:\n    \"\"\"\n    Exports the current page as a PDF.\n\n    Args:\n        page (Page): The Playwright page object\n\n    Returns:\n        bytes: The PDF data\n    \"\"\"\n    pdf_data = await page.pdf(print_background=True)\n    return pdf_data\n",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project source file, playwright",
      "display": "crawl4ai/async_crawler_strategy.py",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project full_name, playwright",
      "display": "unclecode/crawl4ai",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Project stargazers_count, playwright",
      "display": "87.5K",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Library name, weasyprint",
      "display": "WeasyPrint",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Monthly downloads, weasyprint",
      "display": "44.5M",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "License, weasyprint",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Package release, weasyprint",
      "display": "70.0",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Package release date, weasyprint",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Install, weasyprint",
      "display": "pip install weasyprint",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Quickstart, weasyprint",
      "display": "from weasyprint import HTML\nHTML('https://weasyprint.org/').write_pdf('/tmp/weasyprint-website.pdf')\n\n",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Repository stars, weasyprint",
      "display": "9.8K",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "JavaScript rendering, weasyprint",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Chrome or Firefox, weasyprint",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Rendering path, weasyprint",
      "display": "Dedicated HTML/CSS paged-document renderer with print-oriented features and no JavaScript execution.",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Python and native dependencies, weasyprint",
      "display": "Requires-Python: >=3.10; Pango platform dependencies required.",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Library name, selenium",
      "display": "Selenium",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Monthly downloads, selenium",
      "display": "30.5M",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "License, selenium",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Package release, selenium",
      "display": "4.53.0",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Package release date, selenium",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Install, selenium",
      "display": "pip install selenium",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Quickstart, selenium",
      "display": "from selenium import webdriver\nfrom selenium.webdriver.common.by import By\n\ndriver = webdriver.Chrome()\n\ndriver.get(\"https://www.selenium.dev/selenium/web/web-form.html\")\n",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Official description, selenium",
      "display": "Provides the official Python bindings for Selenium WebDriver.",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Quickstart source file, selenium",
      "display": "examples/python/tests/getting_started/first_script.py",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Repository stars, selenium",
      "display": "34.6K",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "JavaScript rendering, selenium",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Chrome or Firefox, selenium",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Rendering path, selenium",
      "display": "WebDriver browser automation with a standardized print_page operation; returned PDF data is base64 text.",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Python and native dependencies, selenium",
      "display": "Requires-Python: >=3.10; Browser binary required for PDF output.",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Project function, selenium",
      "display": "@logger.catch\ndef _enrich_full_page_pdf(self, sb: SB, to_enrich: Metadata):\n    \"\"\"\n    Enriches the full page PDF of the Metadata object.\n    This method is called by the enrich method.\n    \"\"\"\n    result = sb.driver.execute_cdp_cmd(\"Page.printToPDF\", {\"printBackground\": True, \"landscape\": False})\n\n    pdf_data = base64.b64decode(result[\"data\"])\n\n    pdf_filename = os.path.join(self.tmp_dir, f\"pdf{random_str(6)}.pdf\")\n    with open(pdf_filename, \"wb\") as f:\n        f.write(pdf_data)\n\n    to_enrich.add_media(Media(filename=pdf_filename), id=\"pdf\")\n",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Project source file, selenium",
      "display": "src/auto_archiver/modules/antibot_extractor_enricher/antibot_extractor_enricher.py",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Project full_name, selenium",
      "display": "bellingcat/auto-archiver",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Project stargazers_count, selenium",
      "display": "1.2K",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Library name, pdfkit",
      "display": "PDFKit",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Monthly downloads, pdfkit",
      "display": "5.0M",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "License, pdfkit",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Package release, pdfkit",
      "display": "1.0.0",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Package release date, pdfkit",
      "display": "Nov 2021",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Install, pdfkit",
      "display": "pip install pdfkit",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Quickstart, pdfkit",
      "display": "import pdfkit\n\npdfkit.from_url('http://google.com', 'out.pdf')\n",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Official description, pdfkit",
      "display": "Converts HTML to PDF through wkhtmltopdf and its WebKit rendering engine.",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Quickstart source file, pdfkit",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Repository stars, pdfkit",
      "display": "2.0K",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "JavaScript rendering, pdfkit",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Chrome or Firefox, pdfkit",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Rendering path, pdfkit",
      "display": "Python wrapper for the separate wkhtmltopdf WebKit command-line renderer; both projects carry a deprecation warning.",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Python and native dependencies, pdfkit",
      "display": "Requires-Python: ; wkhtmltopdf binary required.",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Maintenance status, pdfkit",
      "display": "Deprecated together with wkhtmltopdf.",
      "asOf": "2026-11-20"
    },
    "F209": {
      "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"
    },
    "F210": {
      "label": "Project source file, pdfkit",
      "display": "jarviscli/plugins/mdtopdf.py",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Project full_name, pdfkit",
      "display": "sukeesh/Jarvis",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project stargazers_count, pdfkit",
      "display": "3.8K",
      "asOf": "2026-11-20"
    },
    "F213": {
      "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"
    },
    "F214": {
      "label": "Project source file, pdfkit",
      "display": "app/util/download_pdf.py",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Project full_name, pdfkit",
      "display": "microsoft/intelligence-toolkit",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Project stargazers_count, pdfkit",
      "display": "112",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Library name, xhtml2pdf",
      "display": "xhtml2pdf",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Monthly downloads, xhtml2pdf",
      "display": "4.3M",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "License, xhtml2pdf",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Package release, xhtml2pdf",
      "display": "0.2.28",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Package release date, xhtml2pdf",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Install, xhtml2pdf",
      "display": "pip install xhtml2pdf[all]",
      "asOf": "2026-11-20"
    },
    "F223": {
      "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"
    },
    "F224": {
      "label": "Repository stars, xhtml2pdf",
      "display": "2.4K",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "JavaScript rendering, xhtml2pdf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Chrome or Firefox, xhtml2pdf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Rendering path, xhtml2pdf",
      "display": "HTML/CSS-to-PDF conversion built around Python/ReportLab; uses its own supported HTML/CSS subset rather than a live browser.",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Python and native dependencies, xhtml2pdf",
      "display": "Requires-Python: >=3.10; Selected native/Python document renderer; no Chrome/Firefox runtime in this path.",
      "asOf": "2026-11-20"
    },
    "F229": {
      "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"
    },
    "F230": {
      "label": "Project source file, xhtml2pdf",
      "display": "easy_pdf/rendering.py",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Project full_name, xhtml2pdf",
      "display": "nigma/django-easy-pdf",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project stargazers_count, xhtml2pdf",
      "display": "366",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Library name, seleniumbase",
      "display": "SeleniumBase",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Monthly downloads, seleniumbase",
      "display": "1.3M",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "License, seleniumbase",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Package release, seleniumbase",
      "display": "4.58.1",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Package release date, seleniumbase",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Install, seleniumbase",
      "display": "pip install seleniumbase",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Quickstart, seleniumbase",
      "display": "from seleniumbase import sb_cdp\n\nsb = sb_cdp.Chrome(fast=True)\nsb.goto(\"https://hn.algolia.com/?query=seleniumbase\")\nelements = sb.find_elements(\"div.Story_title > a\")\nfor element in elements:\n    print(\"--> \" + element.text)\nsb.save_as_pdf(\"sb_news.pdf\", folder=\"./downloaded_files/\")\nprint(\"*** PDF saved to: ./downloaded_files/sb_news.pdf\")\n",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Official description, seleniumbase",
      "display": "Crawls, scrapes, and tests the web, with pytest support.",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Quickstart source file, seleniumbase",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Repository stars, seleniumbase",
      "display": "13.3K",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "JavaScript rendering, seleniumbase",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Chrome or Firefox, seleniumbase",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Rendering path, seleniumbase",
      "display": "Browser automation framework with a separate pure-CDP mode and first-party save_as_pdf/print_to_pdf helpers.",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Python and native dependencies, seleniumbase",
      "display": "Requires-Python: >=3.10; Browser binary required for PDF output.",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Library name, pyppeteer",
      "display": "pyppeteer",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Monthly downloads, pyppeteer",
      "display": "693.2K",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "License, pyppeteer",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Package release, pyppeteer",
      "display": "2.0.0",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Package release date, pyppeteer",
      "display": "Feb 2024",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Install, pyppeteer",
      "display": "pip install pyppeteer",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Quickstart, pyppeteer",
      "display": "import asyncio\nfrom pyppeteer import launch\n\nasync def main():\n    browser = await launch()\n    page = await browser.newPage()\n    await page.goto('https://example.com')\n    await page.screenshot({'path': 'example.png'})\n    await browser.close()\n\nasyncio.get_event_loop().run_until_complete(main())\n",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Official description, pyppeteer",
      "display": "Automates headless Chrome or Chromium through an unofficial port of Puppeteer.",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Quickstart source file, pyppeteer",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Repository stars, pyppeteer",
      "display": "3.9K",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "JavaScript rendering, pyppeteer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Chrome or Firefox, pyppeteer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Rendering path, pyppeteer",
      "display": "Async Chrome/Chromium automation port with a public PDF operation; current package is unmaintained and recommends Playwright.",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Python and native dependencies, pyppeteer",
      "display": "Requires-Python: >=3.8,<4.0; Browser binary required for PDF output.",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Maintenance status, pyppeteer",
      "display": "Official repo says unmaintained and recommends Playwright.",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Project function, pyppeteer",
      "display": "async def main(temp_file):\n    \"\"\"Run main pyppeteer script.\"\"\"\n    args = [\"--no-sandbox\"] if self.disable_sandbox else []\n    browser = await self._check_launch_reqs()(\n        handleSIGINT=False, handleSIGTERM=False, handleSIGHUP=False, args=args\n    )\n    page = await browser.newPage()\n    await page.emulateMedia(\"print\")\n    await page.waitFor(100)\n    await page.goto(f\"file://{temp_file.name}\", waitUntil=\"networkidle0\")\n    await page.waitFor(100)\n\n    pdf_params = {\"printBackground\": True}\n    if not self.paginate:\n        # Floating point precision errors cause the printed\n        # PDF from spilling over a new page by a pixel fraction.\n        dimensions = await page.evaluate(\n            \"\"\"() => {\n            const rect = document.body.getBoundingClientRect();\n            return {\n            width: Math.ceil(rect.width) + 1,\n            height: Math.ceil(rect.height) + 1,\n            }\n        }\"\"\"\n        )\n        width = dimensions[\"width\"]\n        height = dimensions[\"height\"]\n        # 200 inches is the maximum size for Adobe Acrobat Reader.\n        pdf_params.update(\n            {\n                \"width\": min(width, 200 * 72),\n                \"height\": min(height, 200 * 72),\n            }\n        )\n    pdf_data = await page.pdf(pdf_params)\n\n    await browser.close()\n    return pdf_data\n",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Project source file, pyppeteer",
      "display": "nbconvert/exporters/webpdf.py",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Project full_name, pyppeteer",
      "display": "jupyter/nbconvert",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Project stargazers_count, pyppeteer",
      "display": "1.9K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python HTML to PDF libraries WeasyPrint xhtml2pdf Playwright DocRaptor CSS JavaScript pagination code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
