syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.57k stars 771 forks source link

Zoom does not work in flutter web #1481

Closed thcbk closed 8 months ago

thcbk commented 12 months ago

Hi, the zoom function does not work in flutter web The steps to reproduce:

  1. Create a new empty project in Visual studio code and run "flutter pub add syncfusion_flutter_pdfviewer"
  2. Copy and paste the example code from https://pub.dev/packages/syncfusion_flutter_pdfviewer/example into lib/main.dart
  3. Copy the following and paste to the \<body> tag of web/index.html:
    <script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.min.js"></script>
    <script type="text/javascript">
    pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js";
    </script>
  4. Run the application
  5. Expected behavior: The pdf should have the ability of zooming in and out.
  6. Actual behavior: The pdf file Flutter Succinctly was shown but it cannot be zoomed in and out.
  7. Flutter doctor: Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.10.2, on Microsoft Windows [Version 10.0.19045.3570], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [X] Android toolchain - develop for Android devices X Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use flutter config --android-sdk to update to that location.

    [√] Chrome - develop for the web [X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [!] Android Studio (not installed) [√] Connected device (3 available) [√] Network resources

deepika134 commented 11 months ago

We tried to reproduce reported issue with provided details, but the zoom works fine in SfPdfViewer web platform on our end. For your reference, we have attached the tested sample, as well as a screen recording of the output, and it can be download from the attachment. Please check the sample and let us know if you are still experiencing the issue on your end. If so, please provide a modified issue reproducing sample and issue replicating video/steps. This will be helpful for us to provide a prompt solution as soon as possible. github_1481.zip

thcbk commented 11 months ago

Hello, thanks for your reply. I have tried your example and it evenly can't open a pdf. Please see the attached video. I also record the running demo of my own example using your syncfusion pdf, it can open the sample pdf but cannot zoom in or zoom out. Please see the attached video.

https://github.com/syncfusion/flutter-widgets/assets/140240846/7d582d83-9f96-4d8f-ac30-e9e5ccc8ce3b

https://github.com/syncfusion/flutter-widgets/assets/140240846/f288697e-3998-401d-810c-d2a3316a3338

I also attach my sample project:

https://drive.google.com/file/d/1tUNHZE1e8QGIvHWsHQAKOrbhqy6u-fOR/view?usp=sharing

thcbk commented 11 months ago

Hello, my message is too large so it cannot be sent, please see my reply in github page

https://github.com/syncfusion/flutter-widgets/issues/1481

Message too large

Your message couldn't be delivered to @.**** because it exceeds the size limit. Try reducing the message size and resending.

On Fri, Oct 27, 2023 at 9:55 AM deepika134 @.***> wrote:

We tried to reproduce reported issue with provided details, but the zoom works fine in SfPdfViewer web platform on our end. For your reference, we have attached the tested sample, as well as a screen recording of the output, and it can be download from the attachment. Please check the sample and let us know if you are still experiencing the issue on your end. If so, please provide a modified issue reproducing sample and issue replicating video/steps. This will be helpful for us to provide a prompt solution as soon as possible. github_1481.zip https://github.com/syncfusion/flutter-widgets/files/13184516/github_1481.zip

— Reply to this email directly, view it on GitHub https://github.com/syncfusion/flutter-widgets/issues/1481#issuecomment-1782208651, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBN6PTVF2FLHZLPEQV5NJGLYBMPBXAVCNFSM6AAAAAA6O65JX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGIYDQNRVGE . You are receiving this because you authored the thread.Message ID: @.***>

deepika134 commented 11 months ago

We have provided support for pinch zoom and double tap zoom in SfPdfViewer. Please check the following link to know more about the details for zooming. Magnification in Flutter PDF Viewer widget | Syncfusion

Please refer to the following link for the support provided to perform zooming using keyboard keys. Accessibility in Flutter PDF Viewer widget | Syncfusion

sample_1481.zip