openData static method

Future<PdfDocument> openData(
  1. Uint8List data, {
  2. PdfPasswordProvider? passwordProvider,
  3. bool firstAttemptByEmptyPassword = true,
  4. String? sourceName,
  5. void onDispose()?,
})

Opening the PDF on memory.

passwordProvider is used to provide password for encrypted PDF. See PdfPasswordProvider for more info. firstAttemptByEmptyPassword is used to determine whether the first attempt to open the PDF is by empty password or not. For more info, see PdfPasswordProvider.

sourceName can be any arbitrary string to identify the source of the PDF; data does not identify the source if such name is explicitly specified.

Implementation

static Future<PdfDocument> openData(
  Uint8List data, {
  PdfPasswordProvider? passwordProvider,
  bool firstAttemptByEmptyPassword = true,
  String? sourceName,
  void Function()? onDispose,
}) =>
    PdfDocumentFactory.instance.openData(
      data,
      passwordProvider: passwordProvider,
      firstAttemptByEmptyPassword: firstAttemptByEmptyPassword,
      sourceName: sourceName,
      onDispose: onDispose,
    );