PdfViewer.data constructor
PdfViewer.data(
- Uint8List data, {
- required String sourceName,
- PdfPasswordProvider? passwordProvider,
- bool firstAttemptByEmptyPassword = true,
- bool useProgressiveLoading = true,
- Key? key,
- PdfViewerController? controller,
- PdfViewerParams params = const PdfViewerParams(),
- int initialPageNumber = 1,
Create PdfViewer from a byte data.
datais the byte data.sourceNamemust be some ID, e.g., file name or URL, to identify the source of the PDF. IfsourceNameis not unique for each source, the viewer may not work correctly.passwordProvideris used to provide password for encrypted PDF. See PdfPasswordProvider for more info.firstAttemptByEmptyPasswordis used to determine whether the first attempt to open the PDF is by empty password or not. For more info, see PdfPasswordProvider.controlleris the controller to control the viewer.paramsis the parameters to customize the viewer.initialPageNumberis the page number to show initially.
Implementation
PdfViewer.data(
Uint8List data, {
required String sourceName,
PdfPasswordProvider? passwordProvider,
bool firstAttemptByEmptyPassword = true,
bool useProgressiveLoading = true,
super.key,
this.controller,
this.params = const PdfViewerParams(),
this.initialPageNumber = 1,
}) : documentRef = PdfDocumentRefData(
data,
sourceName: sourceName,
passwordProvider: passwordProvider,
firstAttemptByEmptyPassword: firstAttemptByEmptyPassword,
useProgressiveLoading: useProgressiveLoading,
);