eikek / docspell

Assist in organizing your piles of documents, resulting from scanners, e-mails and other sources with miminal effort.
https://docspell.org
GNU Affero General Public License v3.0
1.65k stars 127 forks source link

Default weasyprint fails --optimize-size is deprecated #2780

Open tiborrr opened 2 months ago

tiborrr commented 2 months ago

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 , and --jpeg-quality .

https://doc.courtbouillon.org/weasyprint/stable/api_reference.html#command-line-api

I don't know what was intended here

eikek commented 2 months ago

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.

tiborrr commented 2 months ago

Fine to me. Can you update the command?