Skip to content

[Need help] Unable to load pdf file #24

@codebythura

Description

@codebythura

When I load pdf a file from assets, the document returned with page count 0.
'package:easy_pdf_viewer/src/document.dart': Failed assertion: line 168 pos 12: 'page > 0': is not true.

My code

abstract class PDFManager {
  static Future<String?> getCover(String url) async {
    final doc = await PDFDocument.fromAsset(url);
    final cover = await doc.get(page: 0); 
    return cover.imgPath;
  }
}

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