0

I am able to display pdf successfully with the following class in the my flutter mobile app . However, a blank screen poping up on the chrome.

I added the relevant scripts for the web to 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>

I am reading the url from firestore.

Chrome version: Version 103.0.5060.134 (Official Build) (arm64) syncfusion_flutter_pdfviewer: ^20.2.43-beta

    class View extends StatelessWidget {
  PdfViewerController? _pdfViewerController;
  final url;
  View({Key? key, this.url}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('CV'),
      ),
      body: SfPdfViewer.network(
        url,
        controller: _pdfViewerController,
      ),
    );
  }
}
matto
  • 5
  • 3
  • Please keep in mind that Syncfusion is commercial software, not open source. You will likely eventually reach the threshold where you must start paying them to use their software. Beware. – Randal Schwartz Aug 10 '22 at 19:46
  • Thank you, are there any other pdf viewers for the web that you can recommend? – matto Aug 11 '22 at 13:16
  • i found the solution on this post: https://stackoverflow.com/a/58613527 – matto Oct 12 '22 at 20:06

0 Answers0