The onBeforeEventExport event is fired during image export (JPEG, PNG, SVG) and direct printing. It lets you customize the appearance of Scheduler events in the exported image, e.g. provide alternative text for the event box (image export doesn't support HTML in event boxes).
DayPilot.Scheduler.onBeforeEventExport(args);
args.areas
(array) - active areas to be included in the exported image; includes the areas that have been already defined (in the data source and in onBeforeEventRender)
args.barHeight
(number)
args.e
- exported event (DayPilot.Event), readonly
args.backColor
(string)
args.borderColor
(string)
args.fontSize
(string)
args.fontFamily
(string)
args.fontStyle
("normal" | "bold")
args.fontColor
(string)
args.format
(string) - the target format set using exportAs(), readonly
args.horizontalAlignment
("left" | "center" | "right")
args.text
- exported text (string)
args.textLeft
(string)
args.textPadding
(number)
args.textRight
(string)
args.verticalAlignment
("top" | "center" | "bottom")
Basic HTML to text conversion - replaces line breaks.
Scheduler config:
onBeforeEventExport: (args) => {
args.text = args.e.data.html.replace("<br>", "\n");
};