jgraph / drawio-desktop

Official electron build of draw.io
https://www.diagrams.net
Apache License 2.0
50.75k stars 5.02k forks source link

Command line export with layers leads to error #1904

Open ludos1978 opened 1 week ago

ludos1978 commented 1 week ago

Preflight Checklist

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

Describe the bug More complex graphic fail to export when only exporting specific layers. Tested on osx.

To Reproduce Steps to reproduce the behavior:

  1. Use draw.io with the command line export function: e.g.: /Applications/draw.io.app/Contents/MacOS/draw.io -e -x -f svg -l BG,BG-Top,Front,Deliveries,001 Moduluebersicht-2.drawio -o Moduluebersicht-2-20241105-001.svg
  2. Returns Error: "Error: Export failed: Moduluebersicht-2.drawio.svg"

If exporting to a pdf with only one or more chosen layers, it will generate a empty pdf. For all other tested formats (svg, png) it will return with an generic error.

Expected behavior It should generate a svg with the chosen layers (HG).

draw.io version (In the Help->About menu of the draw.io editor):

Desktop (please complete the following information):

Additional context The file i experienced the problems with is attached, as the error does not happen with simple files. I have experienced problems with layer export before, for example if the background layer is left on the default name, it cannot be exported on the command line.

Moduluebersicht-2.zip

pierreay commented 1 week ago

Hey,

I'm also experiencing the issue. I'm using the latest version (24.7.17). Attached the file with the problem: layers.drawio.zip

Here is the command I tried, for the 2 layers with both ID and labels:

drawio --crop -x -o export.pdf -l step1 layers.drawio
drawio --crop -x -o export.pdf -l bg layers.drawio
drawio --crop -x -o export.pdf -l WIyWlLk6GJQsqaUBKTNV-1 layers.drawio
drawio --crop -x -o export.pdf -l IFQMtbSxKNAzqy7ulAJy-22 layers.drawio

Where I got the following output:

Error: Export failed: layers.drawio