-
Notifications
You must be signed in to change notification settings - Fork 662
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 in node.js doesn't work #963
Comments
Maybe this helps. It works for me like this:
The string created I can then use in imgOptions Object.
I don't know what the demo does but this creates working Presentations with v 3.4.0 |
@Evgenus - i'm not seeing this issue, the node Image demo works fine. Looking at the demo code, it refs 2 SVGs: a base64 one (which should always work) and a remove file: // BOTTOM-RIGHT:
slide.addText("Type: SVG", { x: 9.5, y: 3.3, w: 4.0, h: 0.4, color: "0088CC" });
slide.addImage({ path: IMAGE_PATHS.wikimedia_svg.path, x: 9.5, y: 3.8, w: 2.0, h: 2.0 }); // TEST: `path`
slide.addImage({ data: SVG_BASE64, x: 11.1, y: 5.1, w: 1.5, h: 1.5 }); // TEST: `data` Ensure your => node demo.js Image -local
--------------------==~==~==~==[ STARTING DEMO... ]==~==~==~==--------------------
* pptxgenjs ver: 3.7.0-beta-20210521-2050
* save location: /Users/brentely/GitHub/PptxGenJS/demos/node
--------------------==~==~==~==[ ...DEMO COMPLETE ]==~==~==~==--------------------
EX1 exported: PptxGenJS_Demo_Image_20210706193029030.pptx |
Can this issue be reopened? The problem is caused on line 110 in gen-media.ts Lines 104 to 115 in 035cf6b
The console error message was commented out after this issue was presumed to have been fixed, but the next line still embeds a placeholder error image, which is displayed in some viewers, and ignored in others. I've opened a PR #1315 that will fix this. However it might be time to reconsider whether this png preview is needed at all. |
Steps to confirm that this is a bug in PpptxGenJS: cd demos/node
npm install
node demo.js Image
unzip PptxGenJS_Demo_Image_<timestamp>.pptx In the folder The file |
hey @Evgenus were you able to make this work? node version doesn't work for me either. I'm using v3.12 |
Hi.
I'm trying to build a presentation on the server-side (express) containing SVGs.
Tried on versions 3.0, 3.3, 3.6 the result is the same. I've got an image inside of the presentation indicating an error. Also doesn't work in tests. It is confusing because I see lots of issues fixed and also some remarks in comments and in the changelog.
Can you please clarify if that function should work? Maybe I'm doing something wrong? Maybe missing some dependency?
Will appreciate any reply.
The text was updated successfully, but these errors were encountered: