Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG images _were_ working until v2.4.0 #515

Closed
michaelcbrook opened this issue Mar 16, 2019 · 9 comments
Closed

SVG images _were_ working until v2.4.0 #515

michaelcbrook opened this issue Mar 16, 2019 · 9 comments
Assignees
Labels
Milestone

Comments

@michaelcbrook
Copy link
Contributor

Preface: I've read the other issues describing that SVG's are not supported in Node but they are in the browser, such as here.

However, it did work as of version 2.3.0-beta. It seems since then, the update adding SVG support for browsers explicitly prohibited it from working in Node now, regardless if it was meant to. Is it possible to relax this so we can have the potential of using SVG's again instead of being explicitly denied with the error SVG is not supported in Node?

This is a fantastic package and we get a lot of use out of it, but this is causing us a huge headache right now and we're stuck having to use an old version just to maintain SVG support...

Thank you.

@RicardoNiepel
Copy link

With #528 the SVG support in general should be fixed.

For node support my suggestion will be to use

  • svg-to-png if PhantomJS as headless browser is ok
  • node-svg2img if no headless browser should be used, and Cairo is ok

@gitbrent gitbrent self-assigned this Mar 31, 2019
@gitbrent
Copy link
Owner

Hi @michaelcbrook

How was it working before in Node? Were you embedding the SVG as base64 or...?

@gitbrent
Copy link
Owner

Hi @RicardoNiepel

Thanks for the patch.

As for Node support, I still believe that including a ton of libraries (JSDOM alone has 26 dependencies) just to enable SVG on Node is massive overkill.

@RicardoNiepel
Copy link

Maybe we can enable it just as an extension?

There is only one extensibility point needed (where the node not supported error happens).

And maybe sometimes in the future it can be done without this large set of dependencies...

@gitbrent gitbrent added this to the 2.6.0 milestone Apr 17, 2019
@ronnyroeller
Copy link

+1

@gitbrent gitbrent added the feature:images-svg SVG Image items label Sep 24, 2019
@gitbrent gitbrent modified the milestones: 2.6.0, 3.0.0 Sep 24, 2019
@gitbrent
Copy link
Owner

FIXED!

Node can again generate SVG images.

Thanks to Pull #528, @michaelcbrook, @RicardoNiepel

=> node demo.js Image -local

-------------
STARTING DEMO
-------------

---==~==[ LOCAL MODE ]==~==---
* pptxgenjs ver: 3.0.0-beta.4
* save location: /Users/brentely/GitHub/PptxGenJS/demos/node

--------------
DEMO COMPLETE!
--------------

Demo file created:
 * PptxGenJS_Demo_Node_Image_201909232347

Screen Shot 2019-09-23 at 23 50 30

gitbrent added a commit that referenced this issue Sep 24, 2019
Also Pull #528 was the main fix here
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
@Evgenus
Copy link

Evgenus commented Jun 7, 2021

зображення

зображення

Generated from browser works fine.

@gitbrent Am I doing something wrong?

@Evgenus
Copy link

Evgenus commented Jun 8, 2021

I've tried also versions 3.0.0 and 3.3.0. Got the same result. Does SVG work in node? I'm a bit confused because I see lots of issues about it closed and also some remarks in comments and in the changelog.

I'm especially interested in SVG from base64 ability.

Will appreciate any reply.

@gitbrent
Copy link
Owner

Issue #963 opened to address the node SVG issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants