Unplanned
Last Updated: 29 May 2020 13:48 by ADMIN
moegal
Created on: 06 Mar 2020 13:47
Category: PDFViewer
Type: Feature Request
4
Full screen/exit full screen support
How can I add a button for full screen/exit full screen for the pdf viewer. I would like to keep the navigation
2 comments
ADMIN
Peter Milchev
Posted on: 29 May 2020 13:48

Hello,

As a temporary solution a custom toolbar button can be created: 

// https://www.youtube.com/watch?v=3FjYcMKZ3SU
function getFullscreenElement() {
    return document.fullscreenElement
        || document.webkitfullscreenElement
        || document.mozfullscreenElement
        || document.msfullscreenElement
}

$(document).ready(function () {
    $("#pdfViewer").kendoPDFViewer({
        pdfjsProcessing: {
            file: "https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf"
        },
        width: "100%",
        height: 1200,
        toolbar: {
            items: [
                {
                    type: "button",
                    togglable: true,
                    name: "myCustomTool",
                    icon: "fullscreen",
                    toggle: function (ev) {
                        var viewerElement = this.options.viewer.element[0];
                        if (getFullscreenElement()) {
                            document.exitFullscreen()
                        } else {
                            viewerElement.requestFullscreen();
                        }
                    }
                },
            ]
        }
    })
});

 

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
ADMIN
Nencho
Posted on: 13 Mar 2020 10:01

Hello, Marty,

I'm afraid that this is no such built-in functionality in the PDF Viewer. However, it does make sense to have it as a built-in. That said, we approved the idea and you can cast your vote for it, so it could be considered for future implementation.

Regards,
Nencho
Progress Telerik