PPTX

Comments

Add comments (annotations) to slides for review and collaboration

Adding Comments

Use the comments option on each slide to add comments with author, text, and position:

import { Presentation, Packer, Shape } from "@office-open/pptx";

const pres = new Presentation({
    slides: [
        {
            children: [
                new Shape({
                    x: 50,
                    y: 30,
                    width: 500,
                    height: 60,
                    text: "Slide with Comments",
                    fill: "4472C4",
                }),
            ],
            comments: [
                {
                    author: "Alice Wang",
                    text: "The title looks great!",
                    x: 200,
                    y: 50,
                    date: "2026-05-15T10:00:00Z",
                },
                {
                    author: "Bob Li",
                    text: "Consider changing the content color.",
                    x: 300,
                    y: 180,
                    initials: "BL",
                    date: "2026-05-15T11:00:00Z",
                },
            ],
        },
    ],
});

const buffer = await Packer.toBuffer(pres);

Comment Options

PropertyTypeDescription
authorstringAuthor display name
textstringComment text content
xnumberHorizontal position of the comment marker (px)
ynumberVertical position of the comment marker (px)
initialsstringAuthor initials (auto-derived from name if omitted)
datestringISO 8601 date string

Author Deduplication

Authors are automatically deduplicated across all slides. If the same author name appears on multiple slides, they share a single author entry with a unified initials and color index.

Copyright © 2026