DayPilot.Scheduler.onBeforeEventExport

The onBeforeEventExport event is fired during image export (JPEGPNGSVG) and direct printing. It lets you customize the appearance of events in the exported image, e.g. provide alternative text for the event box (image export doesn't support HTML in event boxes).

Declaration

DayPilot.Scheduler.onBeforeEventExport(args);

Parameters

  • 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.horizontalAlignment ("left" | "center" | "right")
  • args.text - exported text (string)
  • args.textLeft (string)
  • args.textPadding (number)
  • args.textRight (string)
  • args.verticalAlignment ("top" | "center" | "bottom")

Example

Basic HTML to text conversion - replaces line breaks:

dp.onBeforeEventExport = function(args) {
  args.text = args.e.client.html().replace("<br>", "\n");
};