pdfly icon indicating copy to clipboard operation
pdfly copied to clipboard

ENH: Add an uncompress functionality

Open 3052 opened this issue 2 years ago • 1 comments

Is it possible to uncompress PDF? similar to:

# uncompress
qpdf --stream-data=uncompress a.pdf b.pdf
# compress
qpdf b.pdf c.pdf

https://github.com/qpdf/qpdf/releases

3052 avatar Nov 27 '23 22:11 3052

Hi @3052

No, currently pdfly does not offer such functionality

Lucas-C avatar Dec 15 '23 12:12 Lucas-C

hey @MartinThoma, @Lucas-C i have tried working on this feature but i am not able to find out where you are referencing packages in pdfly?

I need to add uncompress.py there

Kaos599 avatar Oct 30 '24 13:10 Kaos599

i am not able to find out where you are referencing packages in pdfly?

You could intiate a new .py file in https://github.com/py-pdf/pdfly/tree/main/pdfly

And then reference it in https://github.com/py-pdf/pdfly/blob/main/pdfly/cli.py

Lucas-C avatar Oct 30 '24 14:10 Lucas-C

@Lucas-C I have implemented the feature but i am having trouble linting it with black, my local system with black shows no need for reformatting while the CI run fails with Black error.

Especially if i format it with Black then ruff results in an error and if format it with ruff then black results in error

Kaos599 avatar Oct 30 '24 15:10 Kaos599

i am having trouble linting it with black, my local system with black shows no need for reformatting while the CI run fails with Black error.

What is the error you are facing exactly?

And what is your version of black?

On my side:

$ black --version
black, 24.10.0 (compiled: yes)

Lucas-C avatar Oct 30 '24 16:10 Lucas-C

i am having trouble linting it with black, my local system with black shows no need for reformatting while the CI run fails with Black error.

What is the error you are facing exactly?

And what is your version of black?

On my side:

$ black --version
black, 24.10.0 (compiled: yes)

From my tinkering, everything is compliant except the I001 rule in ruff which checks for "Imports not at the top of the file." in the cli.py file

I dont know how but its somehow messing with black.

if i use ruff format cli.py it formats these.

And as for the version issue with black, i used github codespaces and that solved the issue.

Kaos599 avatar Oct 30 '24 17:10 Kaos599