Monday 31 December 2012

Using Inkscape to crop an image

As noted from my Quail replacement series of posts, the image from Qgis Print Composer has to be cleaned up to be made into a useful printable format. One of the issues is that the Print composer’s SVG output, due to limitations of the SVG export tool they are using, goes outside the rectangle of the Print composer and therefore has to be cropped back. I experimented with using the cropping in Word, but this makes it difficult to also resize the image to make it appear at the size I want, so it is better to crop the image first in Inkscape. The steps to do this are as follows:

  1. Open the SVG in Inkscape
  2. Select All (Ctrl-A)
  3. Group (Ctrl-G)
  4. Select the Rectangle tool (F4)
  5. Draw a rectangle over the area you want to be cropped. The rectangle will cover what you want to be kept.
  6. Select All (Ctrl-A) again.
  7. On the Object menu select Clip –> Set.
  8. Save the resulting clipped image (Ctrl-S)
  9. Select All, then Copy.
  10. Paste the resulting image into Word using Paste Special then Paste As… Enhanced Metafile.

Generally the only problem I have experienced is getting the image onto the clipboard at step 9 so not sure what is happening here, whether it is Inkscape or Word that is to blame for the image not being on the clipboard when I came to do the Paste.

I am working with this process to paste sixty SVGs into my map document for the Nelson section, which will come up as a 35 page document. One page printed so far as a sample confirms a very high quality printout, but the export creates some issues with resizing the paths. This time the station symbols for open stations (Founders Park) were acceptable with increased thickness, but the contour lines have all become much heavier and therefore quite intrusive. I have decided to leave them as is for now but I will have to revisit this for the next map document when I move on to the next region, which will be Otago-Southland and I expect will be started in the next couple of days.