Skip to content

About set PDF Filter #3670

@Syntamin

Description

@Syntamin

Description of the bug

About set PDF Filter

How to reproduce the bug

Hello,

During my process of compressing PDFs using PyMuPDF, I noticed that after converting images to JPEG, the original object's Filter is set to /DCTDecode. However, when I used other online tools to compress PDFs, I observed that they seem to employ two layers of compression: one with JPEG compression (setting the Quality to 60 in DecodeParms), and another with the FlateDecode filter. This approach seems to significantly reduce the PDF size.

I would like to know if it is possible to achieve this using PyMuPDF. If so, after setting the Filter entry for the object, what additional steps are required to handle the content stream properly?

Thank you for your assistance.

Best regards,
Syntamin

PyMuPDF version

1.24.7

Operating system

MacOS

Python version

3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions