openFile static method

Future<PdfDocument> openFile(
  1. String filePath, {
  2. PdfPasswordProvider? passwordProvider,
  3. bool firstAttemptByEmptyPassword = true,
})

Opening the specified file. For Web, filePath can be relative path from index.html or any arbitrary URL but it may be restricted by CORS.

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.

Implementation

static Future<PdfDocument> openFile(
  String filePath, {
  PdfPasswordProvider? passwordProvider,
  bool firstAttemptByEmptyPassword = true,
}) =>
    PdfDocumentFactory.instance.openFile(
      filePath,
      passwordProvider: passwordProvider,
      firstAttemptByEmptyPassword: firstAttemptByEmptyPassword,
    );