Closed evisong closed 5 years ago
I was also wondering about SVG export. Is it just a matter of adding the command line options or is SVG export fundamentally different from the pixel formats?
Oh, interesting, I didn't receive any notifications for this issue...
The thing is that I am using puppeteer (a wrapped headless chrome) for rendering and there is no method to render an SVG directly. It seems that the export backend of drawio supports SVG export though. I will have to check if there is a way to handle this. But it is not as straight-forward as other pixel formats.
@evisong as a workaround for your current issues: you can either increase the size of the PNG using --scale
or use a PDF export, which you can convert to SVG using inkscape.
SVG export is fully client-side.
@davidjgraph could you give me a hint where to start?
I think i found the relevant code path. However, supporting SVG in drawio-batch is pretty hard as this uses a completely different mechanism and is not based on the backend. Instead, I would have to construct the graph internally in the export script. That's a lot more work... :/ I think I will skip this for the moment.
Actually, I found a way to make this work with the current export code.
Hi,
I've been integrating
drawio-batch
into a book authoring project, aiming to convert source draw.io XML diagrams to images, and then used in markdown documents.I found that even using Export in draw.io, the exported PNG would be a little fuzzy, but the exported SVG is perfectly as sharp as the source diagram.
I've tried
drawio-batch my-diagram.xml my-diagram.svg
, it prompts an error:Is it possible to add the svg support?
Thanks.