Default weasyprint fails --optimize-size is deprecated
weasyprint fails with the following error:
Running external command: weasyprint --optimize-size all --encoding ISO-8859-1 - /tmp/docspell-weasyprint/docspell-weasyprint14722854323928622648/out.pdf
Waiting for command to terminate…
[weasyprint (err)]: usage: weasyprint [-h] [-e ENCODING] [-s STYLESHEETS] [-m MEDIA_TYPE]
[weasyprint (err)]: [-u BASE_URL] [-a ATTACHMENTS]
[weasyprint (err)]: [--pdf-identifier PDF_IDENTIFIER]
[weasyprint (err)]: [--pdf-variant {pdf/a-1b,pdf/a-2b,pdf/a-3b,pdf/a-4b,pdf/a-2u,pdf/a-3u,pdf/a-4u,pdf/ua-1}]
[weasyprint (err)]: [--pdf-version PDF_VERSION] [--pdf-forms]
[weasyprint (err)]: [--uncompressed-pdf] [--custom-metadata] [-p]
[weasyprint (err)]: [--optimize-images] [-j JPEG_QUALITY] [--full-fonts]
[weasyprint (err)]: [--hinting] [-c CACHE] [-D DPI] [-v] [-d] [-q] [--version]
It seems that --optimize-size all is not a valid command anymore
The --optimize-size option and its short equivalent -O have been deprecated. To activate or deactivate different size optimizations, you can now use:
--uncompressed-pdf,
--optimize-images,
--full-fonts,
--hinting,
--dpi
https://doc.courtbouillon.org/weasyprint/stable/api_reference.html#command-line-api
I don't know what was intended here
I think we can just remove this option then or I would perhaps include --full-fonts and --hintig? There was no specific intention, only to optimize things when there is an option :) (and if it increases runtime that's ok)
Edit: I think for compatibility, I'd just remove it. People can always opt-in to something better.
Fine to me. Can you update the command?