Forum How do I...?

Clipped SVG Files

afingret
Hi,

We performed a quick test creating PDF files from SVG files. We were interested to see whether "clipped" (using clipping path) geometry would render a smaller PDF file size than the same geometry not clipped.

First we opened the SVG in Chrome and went to make two PDF's using the built-in print function. The results were:

Entire SVG - PDF size = 141KB
Clipped SVG - PDF size = 29KB

Awesome right? The rendered, clipped SVG produces a smaller PDF, as anticipated. Next, we ran the same test through Prince. The results were:

Entire SVG - PDF size = 281KB
Clipped SVG - PDF size = 282KB

Strange result... I'm just wondering what's going on in prince (and presumably the postscript driver) to produce this unanticipated result. For our application, it would be ideal if Prince behaved more like Chrome when rendering the PDF. Any thoughts?
mikeday
The clipping path is being embedded directly in the PDF as a clipping path, so it isn't actually throwing away any of the clipped geometry in advance. This is something we could look at for a future release of Prince.
afingret
Hi Mike,

Is this feature on the roadmap? We are close to production now (finally) and our application would really benefit from smaller, clipped SVG files.
mikeday
Our latest builds do this now!
mikeday
And this is included in Prince 11.