0

I am creating SVG files programmatically and I want to export them in DXF or EPS for a laser cutter and CNC router. Illustrator can export to DXF with settings "1 pixel = 1 unit."

Inkscape has built-in export to EPS with this command

inkscape -f input.svg -E output.eps

shows on software such as VCarvePro as three times smaller. I found no relevant vector export option in the help page, only commands relevant to bitmaps and rasterizing.

1 Answer 1

1

For an existing document, you need to set this in the document's document settings.

In Inkscape 0.92.3, you need to:

  1. Open File > Document properties, first tab ('Page')
  2. Set 'Display units' to 'px' (Edit: I think for EPS, you may need to use 'pt' here), copy the number it now says in the 'Scale' field.
  3. Set 'Scale' to 1
  4. Now resize your drawing's content back to its previous size:
    a) Select all in all layers with Ctrl+Alt+A
    b) Open the transform dialog with Ctrl+Shift+M
    c) In the 'Scale' tab, select % as unit, check the 'Scale proportionally' checkbox, then in either the width or the height field, enter '/' and then paste the copied scale value.
    d) Click Apply.

To avoid doing this for new files, use the px (edit: pt?) template that you can find under File > New from template ... : default px (might be pt).

Sorry for the edits, please test and give feedback if px or pt work.

3
  • Thanks Moini. I tried both solutions with an existing document and a new document. With an existing document, I could not find "display units" and changed General > Defaults units, which had no effect at all, and Page Size > Custom size > Units from px to pt, which changed the width from 900 to 720. I also tried setting it from the template, or with the line <sodipodi:namedview inkscape:document-units="pt">. In all cases, the export to EPS had a width of 254 instead of 900. The manual export to DXF worked fine with a width of 900 and I want to do that programmatically.
    – emonigma
    Sep 8, 2018 at 14:30
  • Are you using 0.92.3? As far as I know, export to ps/eps via command line does indeed use 90 (before 0.92) / 96 (since 0.92) dpi only. dxf export should be different.
    – Moini
    Sep 8, 2018 at 20:17
  • Due to the pandemic, I didn't get a chance to test this, and now I'm unlikely to do so. But thank you for your help!
    – emonigma
    Dec 16, 2021 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.