d2 icon indicating copy to clipboard operation
d2 copied to clipboard

SVGs imported into PowerPoint are missing icons included via URLs

Open MLNW opened this issue 2 years ago • 5 comments

When I drop the SVG of a diagram including icons into PowerPoint the icons themselves are missing. Here is an example diagram:

classes: {
  container_image: {
    shape: image
    icon: https://icon.icepanel.io/Technology/svg/Podman.svg
  }
  users: {
    shape: image
    icon: https://icons.terrastruct.com/essentials%2F359-users.svg
  }
}

image: Container Image {
  class: container_image
}

users: Users {
  class: users
}

image <- users
Expected Actual
image image
VS code, Firefox ... PowerPoint
d2 --version
v0.6.3

MLNW avatar Feb 27 '24 10:02 MLNW

See also #1853

zachcp avatar Mar 12 '24 17:03 zachcp

@MLNW I can't reproduce. I exported to ppt and this is result:

Screenshot 2024-04-17 at 7 44 06 PM

Am I misunderstanding the issue? Do you mean you made an SVG with D2 and then imported that SVG into a ppt? If so, you can pass arg "--bundle" to inline the images into the data, which should work everywhere.

alixander avatar Apr 18 '24 02:04 alixander

Yes, I used the VS Code Extension to export the diagram as SVG and then imported that into PowerPoint. How would I use the --bundle parameter in VS Code?

MLNW avatar Apr 18 '24 06:04 MLNW

Hm VSCode extension needs to support the option. Can you file this issue in https://github.com/terrastruct/d2-vscode/issues ?

alixander avatar Apr 18 '24 17:04 alixander

I just tried to use the work around via --bundle that you proposed. It leads to the same result. I also saw that the CLI already defaults to use bundle.

❯ d2
d2 v0.6.5
Usage:
...

Flags:
...
  -b, --bundle                 $D2_BUNDLE            when outputting SVG, bundle all assets and layers into the output file (default true)
...

MLNW avatar Jul 16 '24 07:07 MLNW