v59.0b1
Pre-releaseThis version is experimental, don't use it in production. If you find bugs, please report them!
Read about this release on our blog.
Command-line API
-
The
--optimize-sizeoption and its short equivalent-Ohave been deprecated. To activate or deactivate different size optimizations, you can now use:--uncompressed-pdf,--optimize-images,--full-fonts,--hinting,--dpi <resolution>, and--jpeg-quality <quality>.
-
A new
--cache-folder <folder>option has been added to store temporary data in the given folder on the disk instead of keeping them in memory.
Python API
-
Global rendering options are now given in
**optionsinstead of dedicated parameters, with slightly different names. It means that the signature of theHTML.render(),HTML.write_pdf()andDocument.write_pdf()has changed. Here are the steps to port your Python code to v59.0:-
Use named parameters for these functions, not positioned parameters.
-
Rename some the parameters:
image_cachebecomescache(see below),identifierbecomespdf_identifier,variantbecomespdf_variant,versionbecomespdf_version,formsbecomespdf_forms,
-
-
The
optimize_sizeparameter ofHTML.render(),HTML.write_pdf()andDocument()has been removed and will be ignored. You can now use theuncompressed_pdf,full_fonts,hinting,dpiandjpeg_qualityparameters that are included in**options. -
The
cacheparameter can be included in**optionsto replaceimage_cache. If it is a dictionary, this dictionary will be used to store temporary data in memory, and can be even shared between multiple documents. If it’s a folder Path or string, WeasyPrint stores temporary data in the given temporary folder on disk instead of keeping them in memory.
New features
- #1853, #1854: Reduce PDF size, with financial support from Code & Co.
- #1824, #1829: Reduce memory use for images
- #1858: Add an option to keep hinting information in embedded fonts
Bug fixes
- #1855: Fix position of emojis in justified text
- #1852: Don’t crash when line can be split before trailing spaces
- #1843: Fix syntax of dates in metadata
- #1827, #1832: Fix word-spacing problems with nested tags
Documentation
- #1841: Add a paragraph about unsupported calc() function
Contributors
- Guillaume Ayoub
- Lucie Anglade
- Alex Ch
- whi_ne
- Jonas Castro
Backers and sponsors
- Castedo Ellerman
- Kobalt
- Spacinov
- Grip Angebotssoftware
- Crisp BV
- Manuel Barkhau
- SimonSoft
- Menutech
- KontextWork
- NCC Group
- René Fritz
- Moritz Mahringer
- Yanal-Yvez Fargialla
- Piotr Horzycki
- Healthchecks.io
- TrainingSparkle
- Hammerbacher
- Synapsium