--top and --left parameters use user units in surfaces requiring points
PDF, PS, and EPS surfaces require units in points, but are converting the lengths passed in the --top and --left parameters to user units. This results in incorrect margins, as illustrated below. Version is 2.52.2.
Say we have an image, teapot.png, referenced in the file teapot.svg:
<svg width="1920" height="1271" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<image xlink:href="file:///path/to/teapot.png" width="1920" height="1271"/>
</svg>
Now let's add the image to an A4 page, bounded by a 1cm margin, and compare the results.
./rsvg-convert -f <format> -b <green | red> -a --page-width=210mm --page-height=297mm --left=1cm --top=1cm -w 190mm -h 277mm teapot.svg -o a4_teapot.<format>
PNG: a4_teapot.png
SVG: a4_teapot.svg
PDF: a4_teapot.pdf
My PR making SVGs use user specified units fixes that, returning: a4_teapot_ok.pdf
Edited by Daniel Petri Rocha