Pptxgenjs: reduce space between bullet and text

Created on 11 Oct 2017  路  7Comments  路  Source: gitbrent/PptxGenJS

No idea how I can reduce the space between the bullet and text ?

Many help for your help

image

question

Most helpful comment

This would be valuable as an option or a function I can call without changing the code.

All 7 comments

Hi @ade212

There's no option to adjust this spacing that I can find in PowerPoint.

The default is a normal looking amount though:

screen shot 2017-10-11 at 20 55 45

There is one way, let me explain how

image

the result
image

pptx used below ..
without modification P1.pptx
P1.pptx
the result is in p2.pptx the
P2.pptx

Hi @ade212 ,

Ah, you found it. Paragraph indent does adjust that space. I'm already using a default for that value, and that's what you're looking to adjust. Looking at the colored bullets above, those various indent levels are this default * 1, etc.

Try adjusting the value on line 3336: var bulletLvl0Margin = 342900;

914400 is one inch, so the default being used is about 1/3 of an inch.

Hi @gitbrent ,

In order to provide an easier way to change this value for the spacing between the bullet and the text, I created a new variable and changed some code in you library so I can change this from my script. Here are the modifications done in case somebody else is looking for a solution:

  1. Create a variable in the Presentation Property Defaults:
    after line 183 add:
/** @type {Number} global variable to define the default indent space, also used for space between bullet and text */
    gObjPptx.defaultIndentSize = 342900;
  1. Replace the hardcoded value with the Presentation Property
    line 3552
var bulletLvl0Margin = 342900;

replace with:

var bulletLvl0Margin = gObjPptx.defaultIndentSize;
  1. Create the setter function
    around line 4375 add:
    /**
     * Sets the Presentation's default Indent size
     */
    this.setDefaultIndentSize = function setDefaultIndentSize(intSize) {
        gObjPptx.defaultIndentSize = intSize || 342900;
    };

After this, you can use it in your script like:

var pptx = new PptxGenJS();
// set the default indent size to be around 1/5 of an inch (0.18 inch)
pptx.setDefaultIndentSize(171450);

Best Regards,
Adrian

This would be valuable as an option or a function I can call without changing the code.

No idea how I can reduce the space between the bullet and text ?

Many help for your help

image

need help, unable to resolve this issue

@skittishsahil

Screen Shot 2021-04-28 at 22 10 17

Screen Shot 2021-04-28 at 22 08 55

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Skiizoo picture Skiizoo  路  6Comments

luism-s picture luism-s  路  3Comments

Slidemagic picture Slidemagic  路  4Comments

shyam2794 picture shyam2794  路  6Comments

yodasodabob picture yodasodabob  路  6Comments