Skip to content

Conversation

@mikemeerschaert
Copy link
Contributor

This PR fixes several bugs related to placeholders on master slides that can be observed in this minimal demo repo

Valign and Margin in master slides

When creating a placeholder on a master slide, the valign and margin options are disregarded on the layout slide (in ppt, go to View > Slide Master and examine the items added to the layout slide, even if you specify valign and/or margin, the items on the layout slide will still have the default values.

This issue is somewhat related to #640. The fix for that issue fixed the generated slides that use the master and placeholders from within the library, but unfortunately, it didn't fix the issue on the master slides themselves.

This causes issues when you generate a pptx and then you want to add more slides to that file manually in PowerPoint using the generated master slides.

Bullets in master slides

This one is very specific and probably doesn't come up much, but it came up for me, and since I was already in the library fixing the above issue, I decided to also developed a fix for this one.

When you supply type: "bullet" and a custom characterCode to bulleted text in a placeholder, the placeholder still uses the default bullet code 2022. The easy workaround is to just not supply a type and it will default to bullet, but it is very confusing when you run into it.

e.g.

presentation.defineSlideMaster({
  title: "Bullet point demo",
  background: { color: "FFFFFF" },
  objects: [
    {
      placeholder: {
        options: {
          name: "Bullets",
          type: "body",
          bullet: {
            type: "bullet",
            characterCode: "25CF",
          },
          x: 0.5,
          y: 0.1,
          w: 9,
          h: 1,
          fontSize: 12,
          fontFace: "Arial",
        },
        text: "bullet 1\nbullet 2\nbullet 3",
      },
    },
  ],
})

@gitbrent gitbrent added this to the 4.1.0 milestone Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants