Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tiborrr opened this issue Sep 13, 2024 · 2 comments
Open

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

tiborrr opened this issue Sep 13, 2024 · 2 comments
Labels
joex affects the joex component

Comments

@tiborrr
Copy link
Contributor

tiborrr commented Sep 13, 2024

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

@tiborrr tiborrr changed the title Default weasyprint fails because of incorrect command --optimize-size all not valid anymore Default weasyprint fails --optimize-size is deprecated Sep 13, 2024
@eikek
Copy link
Owner

eikek commented Sep 14, 2024

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.

@eikek eikek added the joex affects the joex component label Sep 14, 2024
@tiborrr
Copy link
Contributor Author

tiborrr commented Sep 14, 2024

Fine to me. Can you update the command?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
joex affects the joex component
Projects
None yet
Development

No branches or pull requests

2 participants