Convert and reduce pdf size while not losing quality. pdfRipper searches for all *.pdf files in the provided folder and compresses them in a row, it creates a new files with starting "optimized_" in their names. The program uses threading and will convert all *.pdf files in other threads.
You'll also need to install Ghostscript. Install Ghostscript into C:\gs if on Windows, else install it in /usr/bin if you choose manual installation instead using your package manager.
If on Linux/*BSD/Mac compile with:
make -j8 # 8 cores/threads to use in parallel compile
sudo/doas make install
# to uninstall it
sudo/doas make uninstallTested with Visual Studio Code Editor, but you need to install MingW, once downloaded extract it to C:\MingW, then re-open Visual Studio Code Editor, you might want to install C\C++ extensions if you plan to write C\C++ code with the editor. If you plan to contribute to this project go to File->Preferences->Settings and type to search for cppStandard and set it to c17 to both C++ and C.
I use One Monokai theme for the VScode Editor
In Visual Studio Code Editor, go to Terminal->Configure Tasks...->Create tasks.json from template and copy and paste this into it:
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++",
"command": "C:\\MingW\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-std=c++20",
"-ggdb",
"-lpthread",
"-Wall",
"-Wextra",
"-O2",
"-pipe",
"-pedantic",
"-Wundef",
"-Wshadow",
"-W",
"-Wwrite-strings",
"-Wcast-align",
"-Wstrict-overflow=5",
"-Wconversion",
"-Wpointer-arith",
"-Wformat=2",
"-Wsign-compare",
"-Wendif-labels",
"-Wredundant-decls",
"-Winit-self",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "C:\\MingW\\bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: C:\\MingW\\bin\\g++.exe"
}
]
}To convert some pdf files with the pdfRipper.bat script, copy the name of the destination folder or once the script is started you can provide the desired folder, but you will have to use Double Quotes if the folder has spaces in it's name, after that right click it in the opened CMD window and press enter.
To compile the main.cpp press CTRL + SHIFT + B , then from the same Desktop folder start the pdfRipper.bat script. Now you can delete the "main.exe" file
Optioanlly if you want to play around with the code from VSCode's console -- wait until it compiles, after that press CTRL + ` and paste this cp -r C:\Users\YOUR_USERNAME_GOES_HERE\Desktop\main.exe C:\MingW\bin;cd C:\MingW\bin;.\main.exe C:\
There is a test file here in the repository that you can convert yourself and see the program in action.