// --------------------------------------------------------
    // DIVISIONE NOME / COGNOME
    // --------------------------------------------------------

    var person = splitName(names[i]);

    var textContent =
        person.firstName +
        "\r" +
        person.lastName;


    // --------------------------------------------------------
    // TESTO COME PARAGRAFO CENTRATO
    // --------------------------------------------------------

    var textWidthBox = mmToPt(75);
    var textHeightBox = mmToPt(25);

    var textLeft =
        centerX -
        (textWidthBox / 2);

    var textTop =
        y -
        textOffset;

    var textItem =
        doc.textFrames.areaText(
            doc.pathItems.rectangle(
                textTop,
                textLeft,
                textWidthBox,
                textHeightBox
            )
        );

    textItem.contents = textContent;


    // --------------------------------------------------------
    // STILE TESTO
    // --------------------------------------------------------

    var attr =
        textItem.textRange.characterAttributes;

    attr.textFont = textFont;
    attr.size = fontSize;
    attr.fillColor = customColor;


    // --------------------------------------------------------
    // PARAGRAFO CENTRATO
    // --------------------------------------------------------

    textItem.textRange.paragraphAttributes.justification =
        Justification.CENTER;


    // --------------------------------------------------------
    // INSERIMENTO NEL GRUPPO
    // --------------------------------------------------------

    textItem.move(
        itemGroup,
        ElementPlacement.PLACEATEND
    );


    // --------------------------------------------------------
    // LINEA ORIZZONTALE
    // 75 MM - 10 MM SOPRA IL CENTRO DEL CERCHIO
    // --------------------------------------------------------

    var lineY =
        centerY +
        lineOffsetFromCenter;

    var lineX1 =
        centerX -
        (lineLength / 2);

    var lineX2 =
        centerX +
        (lineLength / 2);


    var line =
        doc.pathItems.add();

    line.setEntirePath([
        [lineX1, lineY],
        [lineX2, lineY]
    ]);

    line.stroked = true;
    line.strokeColor = customColor;
    line.strokeWidth = lineStrokeWidth;
    line.filled = false;

    line.move(
        itemGroup,
        ElementPlacement.PLACEATEND
    );

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: