3

I'm trying to generate slide with nested bullets using Google Slides API with Java. I've followed the documentation in implementing it, However I'm getting nested bullets but not intended (nested with different bullet style coming left aligned).

Please go through the images & code for better understanding of my issue.

Expected:

enter image description here

Getting:

enter image description here

Code:

Requests.add(new Request().setInsertText(new InsertTextRequest().setObjectId(shapeId).setText("Bold\nItal 2\n\tFoo\n\tBar\n\tBla")) ); 

Requests.add(new Request().setCreateParagraphBullets(new CreateParagraphBulletsRequest().setObjectId(shapeId).setTextRange(new Range().setType("ALL")) ));  

Any suggestions on where I'm going wrong...

Kos
  • 4,890
  • 9
  • 38
  • 42

1 Answers1

0

Based from Google Slide API documentation about Bullet glyph Text style:

Like normal text, bullet glyphs have a text style that controls how the glyph is rendered. These text styles cannot be modified using the Slides API directly. However, if you use an UpdateTextStyleRequest to update a complete paragraph that includes a bullet, the Slides API updates the bullet glyph's text style to match.

Bullet glyph text styles follow a slightly different inheritance hierarchy than normal text styles.

  1. A bullet at a certain nesting level first inherits from the TextStyle set in the NestingLevel.bullet_style field inside the bullet's List object.

  2. It next inherits from the corresponding NestingLevel.bullet_style in its parent placeholder's List.

  3. Finally it seeks to inherit from remaining parent placeholder objects.
Jessica Rodriguez
  • 2,899
  • 1
  • 12
  • 27