Add support for compressed files
There should be an option to save vector data of text based vector formats (like EPS, PDF, and SVG) to more compact versions. This will produce much smaller files.
Several levels of compression could be implemented. Lossy compression of image data (e.g. as JPEG) could save even more space.
Possible compression formats:
- EPS: gzip compression (
.eps.gz) - PDF: deflate compression for streams and images (
.pdf) - SVG: gzip compression (
.svgz)
I just hacked up a work around for this in my own project to save PDFs with Flate compression. The implementation of PDF already supports Flate compression (at least it seems to work) but due to the way the API is structured you can't actually turn it on without reimplementing PDFDocument.
Thanks for your feedback @noelwelsh. I have implemented a compression option for PDFGraphics2D now—other formats will follow soon. It's already in master and will be included in the upcoming 0.11 release.
This bug will stay open until compression is ready for EPS and SVG, too.
Great! Looking forward to the next release.