Print and PDF Export
The scheduler 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 someone prints the page that contains the scheduler. In addition to that, you can call the print method on the instance which grabs only the markup of the scheduler, 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 scheduler 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 scheduler will open a new window and print its content.
const MY_MODULES = [print];
const [inst, setInst] = React.useState(null);
const printView = () => {
inst.print();
};
<Button onClick={printView}>Print scheduler</Button>
<Eventcalendar
view={{
scheduler: {
type: 'week'
}
}}
ref={setInst}
modules={MY_MODULES}
/>

import { print } from '@mobiscroll/print';
import { Button, Eventcalendar, getJson, Page, setOptions } from '@mobiscroll/react';
import { useCallback, useEffect, useMemo, useState } from 'react';
const MY_MODULES = [print];
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
function App() {
const [myEvents, setEvents] = useState([]);
const [inst, setInst] = useState(null);
const myView = useMemo(
() => ({
scheduler: { type: 'week' },
}),
[],
);
const printView = useCallback(() => {
inst.print();
}, [inst]);
useEffect(() => {
getJson(
'https://trial.mobiscroll.com/events/?vers=5',
(events) => {
setEvents(events);
},
'jsonp',
);
}, []);
return (
<Page>
<Button onClick={printView}>Print scheduler</Button>
<Eventcalendar
clickToCreate={ }
dragToCreate={ }
dragToMove={ }
dragToResize={ }
eventDelete={ }
data={myEvents}
view={myView}
ref={setInst}
modules={MY_MODULES}
/>
</Page>
);
}
export default App;
import { print } from '@mobiscroll/print';
import {
Button,
Eventcalendar,
getJson,
MbscCalendarEvent,
MbscEventcalendarView,
Page,
setOptions ,
} from '@mobiscroll/react';
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
const MY_MODULES = [print];
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const App: FC = () => {
const [myEvents, setEvents] = useState<MbscCalendarEvent[]>([]);
const [inst, setInst] = useState<Eventcalendar | null>(null);
const myView = useMemo<MbscEventcalendarView>(
() => ({
scheduler: { type: 'week' },
}),
[],
);
const printView = useCallback(() => {
inst!.print();
}, [inst]);
useEffect(() => {
getJson(
'https://trial.mobiscroll.com/events/?vers=5',
(events: MbscCalendarEvent[]) => {
setEvents(events);
},
'jsonp',
);
}, []);
return (
<Page>
<Button onClick={printView}>Print scheduler</Button>
<Eventcalendar
clickToCreate={ }
dragToCreate={ }
dragToMove={ }
dragToResize={ }
eventDelete={ }
data={myEvents}
view={myView}
ref={setInst}
modules={MY_MODULES}
/>
</Page>
);
};
export default App;