I'm trying to automate the conversion of Autocad DXF to SVG files and found out that Inkscape CLI can be used for this purpose.
The command I'm using is:
inkscape -z -l output.svg -f input.dxf
-z: without gui | -l: export plain SVG | -f: input file
When I run this command on Ubuntu 18.04, the conversion succeeds, however, when I run this command inside a docker container (derived from Alpine + RUN apk --no-cache add inkscape
), I get the following error:
input.dxf:1: parser error : Start tag expected, '<' not found 0 ^
** (inkscape:18): WARNING **: Specified document input.dxf cannot be opened (does not exist or not a valid SVG file)
It looks like Inkscape is trying to open the DXF file as an SVG file and fails because it expects XML like input (DXF files do not contain XML-like tags).
I tried to convert it to a PDF by using:
inkscape -z -A output.pdf -f input.dxf
-z: without gui | -A: export PDF | -f: input file
But the error is exactly the same.
Does anyone have an idea how I can further debug this scenario?
Update
I also have to mention that I'm disabling the DXF import dialog by modifying the file dxf_input.inx
by removing the <param />
block.