pdfjs 2.1.266

pdfjs_dart #

Pub Build Status documentation


Dart bindings for Mozilla's PDF.js library

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pdfjs: ^2.1.266

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pdfjs/pdfjs.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
78
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
52
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Apr 1, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

175 out of 175 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/interfaces.dart. (-6.78 points)

Analysis of lib/src/interfaces.dart reported 14 hints, including:

line 23 col 19: Unnecessary new keyword.

line 58 col 9: Unnecessary new keyword.

line 77 col 30: Unnecessary new keyword.

line 78 col 20: Unnecessary new keyword.

line 91 col 5: Don't explicitly initialize variables to null.

Fix lib/src/pdfjs_global.dart. (-4.41 points)

Analysis of lib/src/pdfjs_global.dart reported 9 hints, including:

line 144 col 12: Unnecessary new keyword.

line 150 col 12: 'getDocument' is deprecated and shouldn't be used.

line 155 col 12: 'getDocument' is deprecated and shouldn't be used.

line 160 col 12: 'getDocument' is deprecated and shouldn't be used.

line 166 col 12: 'getDocument' is deprecated and shouldn't be used.

Fix lib/src/pdf_document_proxy.dart. (-3.45 points)

Analysis of lib/src/pdf_document_proxy.dart reported 7 hints, including:

line 67 col 28: Unnecessary new keyword.

line 71 col 17: Unnecessary new keyword.

line 88 col 29: Unnecessary new keyword.

line 90 col 24: Unnecessary new keyword.

line 124 col 16: Unnecessary new keyword.

Fix additional 7 files with analysis or formatting issues. (-7.97 points)

Additional issues in the following files:

  • lib/src/pdf_page_proxy.dart (5 hints)
  • lib/src/document_init_parameters.dart (3 hints)
  • lib/src/page_viewport.dart (2 hints)
  • lib/src/pdf_document_loading_task.dart (2 hints)
  • lib/src/pdf_page_view.dart (2 hints)
  • lib/src/pdf_data_range_transport.dart (1 hint)
  • lib/src/private.dart (1 hint)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-18 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and pdfjs.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.0 <3.0.0