I have SVG images produced by PlantUML, which has some parts of drawing outside of canvas. It makes it difficult to use such images and I need to crop drawing to canvas size. As I produce UML diagrams with script anyways, it would be really efficient to perform a cropping there as well.
So far I've tried two things: a) resize canvas to drawing with Inkscape
inkscape --verb=FitCanvasToDrawing --verb=FileSave --verb=FileClose *.svg
This works fine, but I need to crop drawing to canvas size and this operation seems to be unavailable.
b) resize with rsvg-convert
rsvg-convert image.svg -w 1870 -h 1195 -f svg -o image.svg
This does exactly croping to the desired size, but image size increases ~10 times as now there are some binary images embedded into SVG. This is not acceptable for me.