Skip to content

Meeting Agenda

A clean, single-page meeting agenda with a timed schedule table, metadata block, and notes section — ready to print or share as a PDF.

A fixed set of agenda items is used to demonstrate layout techniques; the parametric controls let you personalise the header without changing the overall structure. Start times are computed by accumulating durations from a user-supplied start hour and minute.

  • Accent rule lines — drawLine used as a visual separator below the header and between the table header and rows.
  • Alternating row backgrounds — drawRectangle with a light fill on every odd row to aid readability.
  • Time arithmetic — durations accumulated in minutes, formatted as HH:MM without any date library.
  • Mixed column widths — time column is narrow and right-aligned; topic column is wide and left-aligned.
Parameter Effect
Title Meeting name shown in the header
Chair Chairperson name in the metadata block
Date Meeting date string
Venue Room or location
Start hour / minute When the first agenda item begins
"use strict";
const { PDFDocument, StandardFonts, rgb } = require('pdf-lib');
const W = 595, H = 842, M = 50;
function getParameterDefinitions() {
return [
{ name: 'title', type: 'text', default: 'Q2 Planning Meeting', caption: 'Meeting title' },
{ name: 'chair', type: 'text', default: 'Sarah Jones', caption: 'Chairperson' },
{ name: 'date', type: 'text', default: '14 April 2026', caption: 'Date' },
{ name: 'venue', type: 'text', default: 'Room 4B', caption: 'Venue' },
{ name: 'startH', type: 'number', widget: 'slider', default: 10, min: 6, max: 17, caption: 'Start hour' },
{ name: 'startM', type: 'number', widget: 'slider', default: 0, min: 0, max: 55, step: 5, caption: 'Start minute' },
{ name: 'accent', type: 'color', default: '#1a4f8a', caption: 'Accent colour' },
];
}
const ITEMS = [
{ duration: 5, topic: 'Welcome and apologies', presenter: 'Chair' },
{ duration: 10, topic: 'Minutes of previous meeting', presenter: 'Secretary' },
{ duration: 20, topic: 'Q1 review — key metrics', presenter: 'Finance lead' },
{ duration: 25, topic: 'Q2 objectives and OKRs', presenter: 'All' },
{ duration: 10, topic: 'Budget allocation update', presenter: 'Finance lead' },
{ duration: 15, topic: 'Roadmap priorities', presenter: 'Product lead' },
{ duration: 10, topic: 'Risks and blockers', presenter: 'All' },
{ duration: 5, topic: 'Any other business', presenter: 'Chair' },
{ duration: 5, topic: 'Next meeting date and close', presenter: 'Chair' },
];
function fmtTime(totalMins) {
var h = Math.floor(totalMins / 60) % 24;
var m = totalMins % 60;
return (h < 10 ? '0' : '') + h + ':' + (m < 10 ? '0' : '') + m;
}
function hexToRgb(hex) {
var r = parseInt(hex.slice(1, 3), 16) / 255;
var g = parseInt(hex.slice(3, 5), 16) / 255;
var b = parseInt(hex.slice(5, 7), 16) / 255;
return rgb(r, g, b);
}
async function main({ title, chair, date, venue, startH, startM, accent }) {
const doc = await PDFDocument.create();
const bold = await doc.embedFont(StandardFonts.HelveticaBold);
const reg = await doc.embedFont(StandardFonts.Helvetica);
const page = doc.addPage([W, H]);
const accentClr = hexToRgb(accent);
const dark = rgb(0.10, 0.10, 0.10);
const muted = rgb(0.45, 0.45, 0.45);
const stripe = rgb(0.95, 0.97, 1.00);
const white = rgb(1, 1, 1);
// ── Header ────────────────────────────────────────────────────────────────
page.drawRectangle({ x: 0, y: H - 70, width: W, height: 70, color: accentClr });
page.drawText(title, { x: M, y: H - 42, size: 20, font: bold, color: white });
page.drawLine({
start: { x: M, y: H - 75 }, end: { x: W - M, y: H - 75 },
thickness: 2, color: accentClr,
});
// ── Metadata block ────────────────────────────────────────────────────────
const col2 = W / 2 + 10;
let y = H - 105;
function meta(label, value, x) {
page.drawText(label, { x, y, size: 8, font: bold, color: muted });
page.drawText(value, { x, y: y - 14, size: 11, font: reg, color: dark });
}
meta('Date', date, M);
meta('Chairperson', chair, col2);
y -= 42;
meta('Venue', venue, M);
const totalDur = ITEMS.reduce(function(s, i) { return s + i.duration; }, 0);
meta('Duration', totalDur + ' minutes', col2);
y -= 28;
page.drawLine({
start: { x: M, y }, end: { x: W - M, y },
thickness: 0.5, color: rgb(0.80, 0.80, 0.80),
});
// ── Table ─────────────────────────────────────────────────────────────────
y -= 22;
const colTime = M;
const colDur = M + 68;
const colTopic = M + 110;
const colPres = W - M - 120;
const rowH = 24;
// Header row
page.drawRectangle({ x: M, y: y - 6, width: W - M * 2, height: rowH, color: accentClr });
page.drawText('Time', { x: colTime + 4, y: y + 6, size: 9, font: bold, color: white });
page.drawText('Dur.', { x: colDur + 4, y: y + 6, size: 9, font: bold, color: white });
page.drawText('Topic', { x: colTopic + 4, y: y + 6, size: 9, font: bold, color: white });
page.drawText('Presenter', { x: colPres + 4, y: y + 6, size: 9, font: bold, color: white });
// Data rows
var cursor = startH * 60 + startM;
ITEMS.forEach(function(item, idx) {
y -= rowH;
if (idx % 2 === 0) {
page.drawRectangle({ x: M, y: y - 6, width: W - M * 2, height: rowH, color: stripe });
}
var timeStr = fmtTime(cursor);
var durStr = item.duration + ' min';
page.drawText(timeStr, { x: colTime + 4, y: y + 6, size: 10, font: bold, color: accentClr });
page.drawText(durStr, { x: colDur + 4, y: y + 6, size: 9, font: reg, color: muted });
page.drawText(item.topic, { x: colTopic + 4, y: y + 6, size: 10, font: reg, color: dark });
page.drawText(item.presenter, { x: colPres + 4, y: y + 6, size: 10, font: reg, color: dark });
cursor += item.duration;
});
// End time row
y -= rowH;
page.drawLine({ start: { x: M, y: y + rowH - 6 }, end: { x: W - M, y: y + rowH - 6 }, thickness: 0.5, color: rgb(0.75, 0.75, 0.75) });
page.drawText(fmtTime(cursor) + ' — Meeting close', {
x: colTime + 4, y: y + 6, size: 10, font: bold, color: accentClr,
});
// ── Notes section ─────────────────────────────────────────────────────────
y -= 40;
page.drawText('Notes', { x: M, y, size: 11, font: bold, color: dark });
y -= 14;
for (var n = 0; n < 6; n++) {
page.drawLine({ start: { x: M, y }, end: { x: W - M, y }, thickness: 0.4, color: rgb(0.82, 0.82, 0.82) });
y -= 18;
}
// ── Footer ────────────────────────────────────────────────────────────────
page.drawLine({ start: { x: M, y: 52 }, end: { x: W - M, y: 52 }, thickness: 0.5, color: rgb(0.80, 0.80, 0.80) });
page.drawText('Confidential — for meeting participants only', { x: M, y: 38, size: 8, font: reg, color: muted });
const pg = 'Page 1 of 1';
page.drawText(pg, { x: W - M - reg.widthOfTextAtSize(pg, 8), y: 38, size: 8, font: reg, color: muted });
return doc;
}
module.exports = { main, getParameterDefinitions };