This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
forked from CrossPT/flutter_plugin_pdf_viewer
-
Notifications
You must be signed in to change notification settings - Fork 147
The application crashes when I try to load a pdf file from assets (Android) #110
Comments
Al-Krause-ex
changed the title
The application crashes when I try to download a pdf file from assets (Android)
The application crashes when I try to load a pdf file from assets (Android)
May 2, 2022
for me too |
1 similar comment
for me too |
me too! |
Me too |
me too, is there any fix ? |
I am using this |
me too |
Same Here |
Any update? I am getting the same issue too. |
I have same issues... |
I have same issues with fromURL() |
same issues! |
1 similar comment
same issues! |
any update |
Same here |
Any update on this issue?. |
Same here |
same problem here! |
so am I |
same |
same here |
did any one find the solution for this issue? |
I changed the lib |
same issue |
I use the previous version (2.0.0) as this Stackoverflow answer, then it work |
same issue |
Seems like Version 2.0.2 solved the issue for me. I posted what I did here. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I load a pdf file from assets, my application crashes. The PDF file is 2 MB.
The code:
import 'package:advance_pdf_viewer/advance_pdf_viewer.dart';
import 'package:flutter/material.dart';
class PdfPage extends StatefulWidget { const PdfPage({Key? key}) : super(key: key);
@override
_PdfPageState createState() => _PdfPageState();
}
class _PdfPageState extends State<PdfPage> {
PDFDocument? doc;
var isLoading = false;
@override
void initState() {
isLoading = true;
loadDoc();
super.initState();
}
Future loadDoc() async { doc = await PDFDocument.fromAsset('assets/pdfs/screen.pdf'); setState(() { isLoading = false; }); }
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: isLoading
? const CircularProgressIndicator()
: PDFViewer(document: doc!),
));
}
}
Mistake:
The text was updated successfully, but these errors were encountered: