Added
- New `FPDF.pages_count` property, thanks to paulacampigotto
- Temporary changes to graphics state variables are now possible using `with FPDF.local_context():`, thanks to gmischler
- a mechanism to detect & downscale oversized images,
_cf._ [documentation](https://py-pdf.github.io/fpdf2/Images.html#oversized-images-detection-downscaling).
[Feedbacks](https://github.com/py-pdf/fpdf2/discussions) on this new feature are welcome!
- New `set_dash_pattern()`, which works with all lines and curves, thanks to gmischler.
- Templates now support drawing ellipses, thanks to gmischler
- New documentation on how to display equations, using Google Charts or `matplotlib`: [Maths](https://py-pdf.github.io/fpdf2/Maths.html)
- The whole documentation can now be downloaded as a PDF: [fpdf2-manual.pdf](https://py-pdf.github.io/fpdf2/fpdf2-manual.pdf)
- New sections have been added to [the tutorial](https://py-pdf.github.io/fpdf2/Tutorial.html), thanks to portfedh:
5. [Creating Tables](https://py-pdf.github.io/fpdf2/Tutorial.html#tuto-5-creating-tables)
6. [Creating links and mixing text styles](https://py-pdf.github.io/fpdf2/Tutorial.html#tuto-6-creating-links-and-mixing-text-styles)
- New translation of the tutorial in Hindi, thanks to Mridulbirla13: [हिंदी संस्करण](https://py-pdf.github.io/fpdf2/Tutorial-hi.html); [Deutsch](https://py-pdf.github.io/fpdf2/Tutorial-de.html), thanks to digidigital; and [Italian](https://py-pdf.github.io/fpdf2/Tutorial-it.html) thanks to xit4; [Русский](https://py-pdf.github.io/fpdf2/Tutorial-ru.html) thanks to AABur; and [português](https://py-pdf.github.io/fpdf2/Tutorial-pt.html) thanks to fuscati; [français](https://py-pdf.github.io/fpdf2/Tutorial-fr.html), thanks to Tititesouris
- While images transparency is still handled by default through the use of `SMask`,
this can be disabled by setting `pdf.allow_images_transparency = False`
in order to allow compliance with [PDF/A-1](https://en.wikipedia.org/wiki/PDF/A#Description)
- [`FPDF.arc`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.arc): new method added.
It enables to draw arcs in a PDF document.
- [`FPDF.solid_arc`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.solid_arc): new method added.
It enables to draw solid arcs in a PDF document. A solid arc combines an arc and a triangle to form a pie slice.
- [`FPDF.regular_polygon`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.regular_polygon): new method added, thanks to bettman-latin
Fixed
- All graphics state manipulations are now possible within a rotation context, thanks to gmischler
- The exception making the "x2" template field optional for barcode elements did not work correctly, fixed by gmischler
- It is now possible to get back to a previous page to add more content, _e.g._ with a 2-column layout, thanks to paulacampigotto
Changed
- All template elements now have a transparent default background instead of white, thanks to gmischler
- To reduce the size of generated PDFs, no `SMask` entry is inserted for images that are fully opaque
(= with an alpha channel containing only 0xff characters)
- The `rect`, `ellipse` & `circle` all have a `style` parameter in common.
They now all properly accept a value of `"D"` and raise a `ValueError` for invalid values.
Deprecated
- `dashed_line()` is now deprecated in favor of `set_dash_pattern()`