java - 使用java在幻灯片中创建段落项目符号

标签 java google-slides-api

我正在尝试使用带有Java 的Google Slides API 生成带有嵌套项目符号 的幻灯片。 我在实现它时遵循了文档,但是我得到了嵌套的项目符号但不是预期的(嵌套有不同的项目符号样式左对齐)。

请浏览图片和代码以更好地理解我的问题。

预期:

enter image description here

获得:

enter image description here

代码:

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")) ));  

关于我哪里出错的任何建议......

最佳答案

基于关于 Bullet glyph Text style 的 Google Slide API 文档:

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.

关于java - 使用java在幻灯片中创建段落项目符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52587282/

相关文章:

java - 我如何解码具有允许在 jibx 中使用多个枚举值的属性的 XML 文档?

java - 删除标点符号问题

google-drive-api - Google 幻灯片 - 以编程方式获取发布到 Web 链接

google-apps-script - 谷歌幻灯片 : Select a slide from Apps Script

python-3.x - Google Slides API 更新表格背景颜色

java - 计算沿线最接近其他点的距离(又名 "project")

java - 您无权访问此服务器上的/schema/beans/spring-beans-3.1.xsd

java - WildFly 9.0 如何添加 PostgreSQL 数据源?

google-apps-script - Google Suite - Apps 脚本 - 通过 API 将幻灯片下载为 PNG 文件

google-slides-api - 如何使用 Google Slides rest API 设置表格单元格填充属性?