lengthSync method

int lengthSync()

Size in bytes of the registered asset.

PdfReader.fromFile asks for this to decide whether a document is large enough to be worth reading in blocks. Without it the whole package stops compiling for the web, which is what tool/check_platforms.dart is there to catch.

Implementation

int lengthSync() =>
    BrowserFileStore.bytes(path)?.length ??
    (throw StateError('Register browser asset bytes before reading: $path'));