How to bind to zoomIn / zoomOut Event for PdfViewer?

1 Answer 31 Views
PDFViewer Toolbar
Christine
Top achievements
Rank 2
Iron
Christine asked on 09 Aug 2022, 09:23 AM

Hello

how can I bind to the Click-Event of zoomIn or zoomOut for the standard zoom toolbar or PdfViewer ?

Somehow similar to 

var pdfViewer = $("#pdfviewer").data("kendoPDFViewer");
pdfViewer.toolbar.zoom.combobox.bind("change", onChangeZoom_Pdf); 

Regards

Christine

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 12 Aug 2022, 07:08 AM

Hello, Christine,

If you wish to bind to the click event of the ZoomIn/Out buttons, you will find the code snippet below:

$("[title='Zoom In']").click(function(){
          alert("Zoom In");
        })
        $("[title='Zoom Out']").click(function(){
          alert("Zoom Out");
        })

If that is not what you are looking for, kindly provide some further information.

Regards,
Martin
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Christine
Top achievements
Rank 2
Iron
commented on 30 Aug 2022, 10:24 AM

Hello Martin

thanks for the hint.

As we use several languages, I used "data-command" instead of the title.

To avoid the event being called for other elements, I added the name of the pdf viewer.

$("#pdfviewer [data-command='zoomout']").click(function () {
    // add functionality
})

Best regards

Christine

Martin
Telerik team
commented on 02 Sep 2022, 10:11 AM

I am glad that you were able to accommodate the approach to better suit your needs. Feel free to ask if further questions arise.
Tags
PDFViewer Toolbar
Asked by
Christine
Top achievements
Rank 2
Iron
Answers by
Martin
Telerik team
Share this question
or