# The fpdf Package

> Thanks to @megc1 for surfacing the capabilities of this package

Reference:

* [Homepage](https://pyfpdf.readthedocs.io/en/latest/)
* [Official Tutorial](https://pyfpdf.readthedocs.io/en/latest/Tutorial/index.html)
* [Source Code](https://github.com/reingart/pyfpdf)
* [An unofficial Tutorial](http://www.blog.pythonlibrary.org/2018/06/05/creating-pdfs-with-pyfpdf-and-python/)

## Installation

First install the package using Pip, if necessary:

```bash
pip install fpdf
```

## Usage

A basic usage example to generate a new PDF document:

```python
from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_font("Arial", "B", 16)
pdf.cell(40, 10, "Hello World!")
pdf.output("my_generated_document.pdf", "F")
```

See the package documentation and tutorial for more examples.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://prof-rossetti.gitbook.io/intro-to-python/notes/python/packages/fpdf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
