Fullscreen Mode

PSPDFKit for Web does not support a fullscreen mode at this point, but you can implement this yourself using the fullscreen API.

The following example outlines an approach that works on multiple browsers:

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
function requestFullscreen(element) {
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if (element.webkitRequestFullscreen) {
    element.webkitRequestFullscreen();
  } else if (element.msRequestFullscreen) {
    element.msRequestFullscreen();
  }
}

requestFullscreen(pspdfkitContainer);
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
function requestFullscreen(element) {
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if (element.webkitRequestFullscreen) {
    element.webkitRequestFullscreen();
  } else if (element.msRequestFullscreen) {
    element.msRequestFullscreen();
  }
}

requestFullscreen(pspdfkitContainer);