SfPdfViewer.memory constructor

SfPdfViewer.memory(
  1. Uint8List bytes, {
  2. Key? key,
  3. bool canShowScrollHead = true,
  4. double pageSpacing = 4,
  5. PdfViewerController? controller,
  6. PdfZoomLevelChangedCallback? onZoomLevelChanged,
  7. bool canShowPageLoadingIndicator = true,
  8. bool canShowScrollStatus = true,
  9. PdfPageChangedCallback? onPageChanged,
  10. bool enableDoubleTapZooming = true,
  11. bool enableTextSelection = true,
  12. PdfTextSelectionChangedCallback? onTextSelectionChanged,
  13. PdfHyperlinkClickedCallback? onHyperlinkClicked,
  14. PdfDocumentLoadedCallback? onDocumentLoaded,
  15. PdfDocumentLoadFailedCallback? onDocumentLoadFailed,
  16. PdfGestureTapCallback? onTap,
  17. PdfFormFieldValueChangedCallback? onFormFieldValueChanged,
  18. PdfFormFieldFocusChangeCallback? onFormFieldFocusChange,
  19. bool enableDocumentLinkAnnotation = true,
  20. bool canShowPaginationDialog = true,
  21. bool canShowSignaturePadDialog = true,
  22. Offset initialScrollOffset = Offset.zero,
  23. double initialZoomLevel = 1,
  24. double maxZoomLevel = 3,
  25. PdfInteractionMode interactionMode = PdfInteractionMode.selection,
  26. PdfScrollDirection scrollDirection = PdfScrollDirection.vertical,
  27. PdfPageLayoutMode pageLayoutMode = PdfPageLayoutMode.continuous,
  28. Color currentSearchTextHighlightColor = const Color.fromARGB(80, 249, 125, 0),
  29. Color otherSearchTextHighlightColor = const Color.fromARGB(50, 255, 255, 1),
  30. String? password,
  31. bool canShowPasswordDialog = true,
  32. bool canShowHyperlinkDialog = true,
  33. bool enableHyperlinkNavigation = true,
})

Creates a widget that displays the PDF document obtained from Uint8List.

class MyAppState extends State

@override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: SfPdfViewer.memory( bytes, ), ), ); } }

Implementation

SfPdfViewer.memory(
  Uint8List bytes, {
  Key? key,
  this.canShowScrollHead = true,
  this.pageSpacing = 4,
  this.controller,
  this.onZoomLevelChanged,
  this.canShowPageLoadingIndicator = true,
  this.canShowScrollStatus = true,
  this.onPageChanged,
  this.enableDoubleTapZooming = true,
  this.enableTextSelection = true,
  this.onTextSelectionChanged,
  this.onHyperlinkClicked,
  this.onDocumentLoaded,
  this.onDocumentLoadFailed,
  this.onTap,
  this.onFormFieldValueChanged,
  this.onFormFieldFocusChange,
  this.enableDocumentLinkAnnotation = true,
  this.canShowPaginationDialog = true,
  this.canShowSignaturePadDialog = true,
  this.initialScrollOffset = Offset.zero,
  this.initialZoomLevel = 1,
  this.maxZoomLevel = 3,
  this.interactionMode = PdfInteractionMode.selection,
  this.scrollDirection = PdfScrollDirection.vertical,
  this.pageLayoutMode = PdfPageLayoutMode.continuous,
  this.currentSearchTextHighlightColor =
      const Color.fromARGB(80, 249, 125, 0),
  this.otherSearchTextHighlightColor = const Color.fromARGB(50, 255, 255, 1),
  this.password,
  this.canShowPasswordDialog = true,
  this.canShowHyperlinkDialog = true,
  this.enableHyperlinkNavigation = true,
})  : _provider = MemoryPdf(bytes),
      assert(pageSpacing >= 0),
      super(key: key);