We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

On Tap Event


Is there any way or sample for getting on tap event on PDF pages ?

Best wishes

2 Replies

HB Hamdi Boyaci December 27, 2022 07:36 PM UTC

or/ and LongPress event also.

DR Deepika Ravi Syncfusion Team December 29, 2022 01:43 AM UTC

Hi Hamdi Boyaci,

In SfPdfViewer, we have used the gestures to detect tapping and zooming, so when using the gestures in the main.dart , it does not trigger those gestures first instead, which triggers the gestures inside the SfPdfViewer widget. We recommend using the RawGestureDetector over the SfPdfViewer widget. The following code example also explains the same.

Code Snippet:


  Widget build(BuildContext context) {

    return Scaffold(

      appBar: AppBar(

        title: const Text('Syncfusion Flutter PDF Viewer'),


      body: RawGestureDetector(

        gestures: {



            () => GestureRecognizer(), //constructor

            (GestureRecognizer instance) {


              instance.onTap = () => print('Tapped');




        child: SfPdfViewer.network(


          key: _pdfViewerKey,







class GestureRecognizer extends TapGestureRecognizer {


  void rejectGesture(int pointer) {





Deepika R

Live Chat Icon For mobile
Up arrow icon