Printing the View
The agenda includes print optimized styling through the print add-on. This needs to be added to the download package or installed separately from a dedicated NPM package.
Print styling is applied when print is called on a page that contains the agenda. In addition to that, you can call the print method on the instance which grabs only the markup of the agenda places it onto a temporary page and calls the browsers printing function. This is especially useful when you want to add a button to only print the agenda rather than the whole page.
Besides printing, PDF export is possible through the print dialog of the browser.
Demo
By calling the print method, the agenda will open a new window and print its content.
html<mbsc-eventcalendar #mycal
[view]="calView"
[modules]="calendarModules">
</mbsc-eventcalendar>
<mbsc-button (click)="printCal()">
Print agenda
</mbsc-button>
tsimport { print } from '@mobiscroll/print';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('mycal', { static: false })
inst!: MbscEventcalendar;
calendarModules = [print];
calView = {
agenda: { type: 'month' }
};
printCal(): void {
this.inst.print();
}
}

import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewChild } from '@angular/core';
import {
MbscCalendarEvent,
MbscEventcalendar,
MbscEventcalendarView,
MbscModule,
setOptions ,
} from '@mobiscroll/angular';
import { print } from '@mobiscroll/print';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [CommonModule, MbscModule],
})
export class AppComponent implements OnInit {
constructor(private http: HttpClient) {}
@ViewChild('calendar', { static: false })
calendar!: MbscEventcalendar;
myEvents: MbscCalendarEvent[] = [];
myModules = [print];
myView: MbscEventcalendarView = {
agenda: { type: 'month' },
};
print(): void {
this.calendar.print();
}
ngOnInit(): void {
this.http.jsonp<MbscCalendarEvent[]>('https://trial.mobiscroll.com/events/?vers=5', 'callback').subscribe((resp) => {
this.myEvents = resp;
});
}
}
<mbsc-page class="mds-full-height">
<div class="mds-full-height mbsc-flex-col">
<div class="mbsc-flex-none">
<mbsc-button (click)="print()" startIcon="print">Print agenda</mbsc-button>
</div>
<div class="mds-overflow-hidden mbsc-flex-1-1">
<mbsc-eventcalendar #calendar [data]="myEvents" [modules]="myModules" [view]="myView"></mbsc-eventcalendar>
</div>
</div>
</mbsc-page>
.mds-full-height {
height: 100%;
}
.mds-overflow-hidden {
overflow: hidden;
}