| <<<Back 1 day (to 2022/07/29) | Fwd 1 day (to 2022/07/31) >>> | 20220730 |
artifexirc-bot | <tbrowder> chrisl: thnx for reminding me of gdb (i haven't used c/c++ in a long time). however | 12:01.45 |
| <tbrowder> i discovered a local version of libpaper was causing the problem. i removed it and ps2pdf works fine now. thank you for ghostscript, i couldn't do any of my fav coding without PostScript!! | 12:03.52 |
| <delight-aug> Hi! I'm trying to convert 22MB pdf consisting solely of images to a 3MB document | 15:00.31 |
| <delight-aug> I get a good result with -dPDFSETTINGS=/ebook, but it weigths 5MB. And when I try -dPDFSETTINGS=/screen, I get unreadable quallity but 1.6MB | 15:02.01 |
| <delight-aug> The command I'm using: | 15:02.44 |
| <delight-aug> gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -r100 -dNOPAUSE -dBATCH -sOutputFile=compressed_PDF_file.pdf SKM_C25822072816210.pdf | 15:02.46 |
| <delight-aug> So, the qustion is — how to get something in-between? Thanks in advance for any help | 15:03.22 |
| <delight-aug> Ooops, actually the `-r100` option is redunant in the command, I was just trying if it can help me | 15:04.12 |
| <xx> delight-aug: extract images, convert them into worse quality until the size is what you want, create new pdf from those images | 15:48.21 |
| <KenSharp> Or have Ghostscript do it for you in one pass, that's exactly what the PDFSETTINGS is doing. | 15:51.23 |
| <KenSharp> But instead of using one set of canned settings you need to adjust each control individually, if you find the canned settings don't do what you want. | 15:51.50 |
| <KenSharp> The individual settings are documented, along with how they are configured for each of the presets: | 15:52.53 |
| <KenSharp> https://ghostscript.com/doc/current/VectorDevices.htm#COMMON | 15:52.54 |
| <delight-aug> Thanks! How can I proprly extract images? I've tried `pdfimages` command, but it gave 15 images of around 11MB in size, while the PDF is just 22MB | 15:57.48 |
| <delight-aug> OK, I managed to use the -dPDFSETTINGS=/ebook preset and override -dColorImageResolution instead of adjusting each control individually | 16:12.03 |
| <xx> delight-aug: it's not a ghostscript question, but the answer is to use `pdfimages -all /path/to/pdf` to get the images without them being converted | 16:12.15 |
| <delight-aug> OK, thanks! | 16:12.28 |
| <xx> ghostscript can probably change the quality of every image separately, but I find it faster to just extract them all, edit them in imagemagick or whatever too you want, and create a new pdf from it | 16:13.22 |
| <xx> s/too/tool/ | 16:13.36 |
| <<<Back 1 day (to 2022/07/29) | Forward 1 day (to 2022/07/31)>>> | |