pts / pdfsizeopt

PDF file size optimizer
GNU General Public License v2.0
750 stars 65 forks source link

I'm excited! #166

Open FredWahl opened 1 year ago

FredWahl commented 1 year ago

I wrote a tool that automates jpegtran. You give it a path and then it runs jpegtran for every jpg file it finds. Very useful and written in c++. So I should be able to do the same for this tool. I have tons of pdf files. Whenever I find something useful, I save it as a pdf. Sadly, I don't know python but I have decided to learn. So this will be interesting once I have learned enough.

zvezdochiot commented 1 year ago

@FredWahl say:

Sadly, I don't know python but I have decided to learn.

See simple https://github.com/ImageProcessing-ElectronicPublications/python-pdf-jpeg-extract for begin.

Good Luck.

See also (C/C++):

FredWahl commented 1 year ago

Thank you. Interesting and a good reason to learn Python. I have found a sdk also. another question. Since I want to automate pdfsizeopt, what are the return values? I assume it returns 0 for success but are there other values? jpegtran returns 1 or 2 but I can't figure out what it means. Winrar can be automated as a cli and they have documented these.

FredWahl commented 1 year ago

Almost forgot. While I do have tons of pdf's, I have run other tools on them. I suspect pdfsizeopt wouldn't yield anything for most of them.Therefore, I wonder if there are pdf files for testing that are made in such a way that they are useful to see how much they can be reduced in size. I found pdfVera and their goal is to verify that pdf's meet ceratin criteria and there are many. It seems as if they have created "Hello, world" files which violate these rules. I have no idea how, maybe I should ask

zvezdochiot commented 1 year ago

@FredWahl say:

Interesting and a good reason to learn Python.

See https://github.com/rbrito/scripts . Reference: