password property

String? password
final

The password to open the PDF document in SfPdfViewer.

This example demonstrates how to load the encrypted document in SfPdfViewer.

class MyAppState extends State<MyApp>{

late PdfViewerController _pdfViewerController;

 @override
 void initState(){
   _pdfViewerController = PdfViewerController();
   super.initState();
 }

 @override
 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       appBar: AppBar(
          title: Text('Syncfusion Flutter PdfViewer'),
       ),
       body: SfPdfViewer.asset(
         'assets/flutter-succinctly.pdf',
         controller: _pdfViewerController,
         password:'syncfusion',
       ),
     ),
   );
 }
}

Implementation

final String? password;