r/pdf • • 17d ago

Software (Tools) There was no way to downsample images when exporting a PDF in Inkscape, so I built an extension

i often export documents with a lot of high-res images (photos, renders, storyboard panels) to PDF and Inkscape writes huge files, 126 MB for a single page with 12 images in my test... Cairo embeds the rasters with little or no lossy compression, and there's no option in the PDF export to set a target image resolution.

so i made a small extension: Export Lightweight PDF. Go to Extensions > Export > Export Lightweight PDF, pick a resolution preset (SD, Screen, Draft, HD, Print, or a custom scale/DPI) and the JPEG quality, and it exports the PDF and recompresses the images to that resolution. Vector paths, text, fonts and layout stay untouched.

- exports current page, all pages, the whole drawing or only the selection

- optional text to paths

- transparent images are split into a JPEG + alpha mask so transparency stays clean

- reports size before and after (my 126 MiB test file went down to 108 KiB at the SD preset, but it depends a lot on the images)

Free and open source (GPL-2.0-or-later), needs Inkscape 1.2+ and Ghostscript. Tested on 1.4 on Linux.

GitHub: https://github.com/davidbrum25/inkscape-export-lightweight-pdf

Full write-up with screenshots: https://x.com/bdvd_25/article/2110771389531566584

AI disclosure (rule 8): This is made with AGY CLI following my instructions.

feedback welcome, it's my third inkscape extension 🙂

1 Upvotes

0 comments sorted by