Open 7Eltantawy opened 3 years ago
I'm facing this error on loading pdf from url This is myCode
import 'package:flutter/material.dart'; import 'package:flutter_plugin_pdf_viewer/flutter_plugin_pdf_viewer.dart'; class PdfViwer extends StatefulWidget { PdfViwer(this.urlPath); final urlPath; @override _PdfViwerState createState() => _PdfViwerState(); } class _PdfViwerState extends State<PdfViwer> { bool nighmode = false; bool pageSnapping = false; bool isloading = false; PDFDocument document; @override void initState() { super.initState(); loadfile(); } loadfile() async { document = await PDFDocument.fromURL( 'http://www.africau.edu/images/default/sample.pdf'); setState(() { document = document; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( centerTitle: true, title: Text('PDF'), ), body: Center(child: PDFViewer(document: document)), ); } }
did you find solve ?
No, I used URL launcher instead but I hope to find a solution
Exception has occurred. _Exception (Exception: Error reading PDF!)
I'm facing this error on loading pdf from url This is myCode