import { SpecialZoomLevel, Viewer } from '@react-pdf-viewer/core';
import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout';
import '@react-pdf-viewer/core/lib/styles/index.css';
import '@react-pdf-viewer/default-layout/lib/styles/index.css';
const defaultLayoutPluginInstance = defaultLayoutPlugin({
toolbarPlugin: {
fullScreenPlugin: {
onEnterFullScreen: (zoom) => {
zoom(SpecialZoomLevel.PageFit);
},
onExitFullScreen: (zoom) => {
zoom(SpecialZoomLevel.PageFit);
},
},
},
});
return (
<div
style={{
height: '100%',
}}
>
<Viewer fileUrl="/assets/pdf-open-parameters.pdf" plugins={[defaultLayoutPluginInstance]} />
</div>
);