The onBeforeEventExport event is fired during image export. It allows you to provide alternative text for the event box (image export doesn't support HTML in event boxes).
DayPilot.Calendar.onBeforeEventExport(args);args.areas - array of active areas (since 2025.4.6770)
args.backColor- background color
args.barBackColor - color of the duration bar background
args.barColor - color of the duration bar
args.barWidth - width of the duration bar in pixels
args.borderColor - event border color
args.e - exported event (DayPilot.Event)
args.fontColor - event font color
args.fontFamily - event font family
args.fontSize - font size
args.fontStyle - event font style ("bold” | "
args.horizontalAlignment ("left" | "right" | "center")
args.text - exported text
Basic HTML to text conversion - replaces line breaks:
dp.onBeforeEventExport = function(args) {
args.text = args.e.client.html().replace("<br>", "\n");
};