rsvg-convert: SVG --> PDF: embedded bitmaps rendered in low resolution
The output of
rsvg-convert -d 300 -p 300 -f pdf -o rsvg-convert-bug.pdf rsvg-convert-bug.svg
is:
The image part is rendered in low-res, definitely much lower than the 300dpi specified.
(in fact, changing user-specified resolution should not have any effect since, as I understand it, the user-specified resolution is for rasterization of the vector part using filters; but this the only parameter one could use to try to fix the problem, so I had to give it a try)
Trying to reproduce the problem with a minimal example, I created:
Interestingly, this one converts to PDF just fine -- no loss of resolution. Inspection of the insides of the two SVGs shows that in both example the images are embedded as PNG files.
So, I'm clueless as to what is going on with the first example.
Moreover, when rendering to PDF, the PNGs can be embedded in a lossless mode (/FlateDecode), no rasterization is needed. And this is exactly what seems to be happening with the second example, but, for some reason, not the first one.
P.S.
I am using rsvg-convert (development) compiled from source: librsvg-2.51.4.tar.bz2. I've also run these tests on 2.50.7 -- same problem. My libcairo is v1.16.0
I've also tried rendering with rsvg-convert to PNG -- no problems in both examples / release versions. So it has definitely something to do with just the PDF renderer.
The only current work-around I could think of would be to render with -z N (scale N times) and then use another tool to scale the PDF down N times. But, I guess, there must be an easier fix.