Open a PDF From Local Storage in Flutter PDF Viewer
14 Aug 20261 minute to read
The SfPdfViewer.file creates a widget that displays the PDF document obtained from a File. The following code example demonstrates this.
@override
Widget build(BuildContext context) {
return Scaffold(
body: SfPdfViewer.file(
File('storage/emulated/0/Download/flutter-succinctly.pdf')));
}On Android, add the
android.permission.READ_EXTERNAL_STORAGEpermission in theAndroidManifest.xmlfile.
Since the file system is not accessible from the browser, SfPdfViewer.file is not supported on Flutter Web.