Skip to content

[BUG] PdfDocumentRefData can not accept a large UnitList8 #595

@paladinghub

Description

@paladinghub

When I change PdfDocumentRefFile to PdfDocumentRefData in the demo, start the project and open a large PDF, scroll the PDF page, and the content on the PDF will disappear.
Version :pdfrx: ^2.2.24
platform:windows 11

I remember there were no problem before upgrading to the latest version. My previous version was 1.2.7

code in main.dart

Future<void> openFile({bool useProgressiveLoading = true}) async {
    final file = await fs.openFile(
      acceptedTypeGroups: [
        fs.XTypeGroup(label: 'PDF files', extensions: <String>['pdf'], uniformTypeIdentifiers: ['com.adobe.pdf']),
      ],
    );
    if (file == null) return;
    final bytes = await file.readAsBytes();

    if (kIsWeb) {
      documentRef.value = PdfDocumentRefData(
        bytes,
        sourceName: 'web-open-file%${file.name}',
        passwordProvider: () => passwordDialog(context),
        useProgressiveLoading: useProgressiveLoading,
      );
    } else {
      documentRef.value = PdfDocumentRefData(
        sourceName: 'open-file%${_fileName(file.path)}',
        bytes,
        passwordProvider: () => passwordDialog(context),
        useProgressiveLoading: useProgressiveLoading,
      );
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions