rsvg-convert wrong output PDF size for SVG which size is defined in real-world units
TL;DR: rsvg-convert -f pdf
outputs wrongly sized PDFs if input SVG drawing size is specified by real-world units (millimeters, points, ...) and --dpi-x
and --dpi-y
parameters values differs from "72".
SVG drawing size can be specified in real-world units, like inches, or computer-screen units, like pixels. I've tried to convert two SVGs, one 4x4in (rect_in.svg
) and another 384x384px (rect_px.svg
), both at 72dpi, default (no --dpi-x
and --dpi-y
specified, which should fall back to 90dpi) and 96dpi.
What I expect to obtain is that for SVG specified in real-world unit the resulting PDF will be of the same size (so --dpi-x
and --dpi-y
parameters will be ignored), while for SVG specified in computer-screen units resulting PDF size must change. Instead of this I get all PDF wrongly sized except if 72dpi is specified. Here is a detailed list of what I get:
-
rect_in.svg
at 72dpi: 4x4in PDF; -
rect_in.svg
at default: 5x5in PDF -> should be 4x4in; -
rect_in.svg
at 96dpi: ~5.3x5.3in PDF -> should be 4x4in; -
rect_px.svg
at 72dpi: ~5.3x5.3in PDF; -
rect_px.svg
at default: ~5.3x5.3in PDF -> should be ~4.3x4.3in; -
rect_px.svg
at 96dpi: ~5.3x5.3in PDF -> should be 4x4in;
Here you can find input and output files: test_files.zip. This results have been obtained on rsvg-convert 2.46.0. The version in my distro repos, 2.44.15, behaves differently.
P.S.: issue #132 (closed) seems to report the same bug.