I'm wondering why it hasn't been mentioned before, but I tested a bunch of different svg->pdf converters and found that the best one is Headless Chrome. It produces the most precise results for me. Before switching to Chrome, I was trying to fight with Inkscape bugs, but many of them are too serious and I can't do much about it (transparency bugs, wrong fonts, etc).
chrome \
--headless \
--disable-gpu \
--no-pdf-header-footer \
--print-to-pdf=output.pdf \
input.svg
It needs some tweaks to use custom PDF size (A4 or US Letter is default depending on your system?), but I was able to set custom size after some googling and playing with CSS and SVG attributes (check out this answer on stackoverflow)
Update with example of putting the CSS for the page size in a <style>
block in the SVG:
<svg
width="154.63478"
height="213.94911"
... >
<style>
@page {
size: 155mm154.63478mm 214mm;213.94911mm;
margin: 0;
}
svg {
width: 154.63478mm;
height: 213.94911mm;
}
</style>
<!-- Your SVG content here -->
</svg>