Pptxgenjs: Base 64 quality

Created on 30 Jul 2019  路  6Comments  路  Source: gitbrent/PptxGenJS

hi,

I am currently working with D3JS and would like to share these graphs.

I managed to convert the SVG to base64 but the quality of the image in the .ppt is really, really bad.

am i doing wrong or we just can't get this properly with svg ?
treemap_1
treemap_2

images-svg bug

All 6 comments

Yeah, i see what you mean.

I'm not sure what a fix is off-hand, but you may notice the original size is probably smaller, hence the stretching effect:

Screen Shot 2019-07-30 at 22 01 30

I've been looking into this stretching effect but even if I change the original size I still have the same issue.
Theses pictures down below are the test i made : one with base64 300x150 original size and one with 800x400. (the first picture of each is the preview in chrome and the second one the render in the pptx file)

chrome_300x150
pptx_300x150

chrome_800x400
pptx_800x400

Thanks for your time

Thanks for the update/information.

I double-checked the code and base64 SVG images are created using the w/h size provided. It seemed like they were being set too small, hence the stretching, but that does not appear to be the case.

See https://github.com/gitbrent/PptxGenJS/pull/528
That fix worked for me. I would love to have that PR merged and a new version published to npm that I can use

@mmayer1 I just have to include the updated pptxgen.min.js file ?
thanks

Confirmed: Pull #528 fixes this issue.

Version 3.0 incorporates this change.

PREVIOUS:
Screen Shot 2019-09-23 at 23 02 09

VERSION 3.0:
Screen Shot 2019-09-23 at 23 02 01

Was this page helpful?
0 / 5 - 0 ratings