Plugin that allows Flutter apps to generate and print documents to android or ios compatible printers
See the example on how to use the plugin.
This plugin uses the
To load an image it is possible to use Image.toByteData:
var Image im; var bytes = await im.toByteData(format: ui.ImageByteFormat.rawRgba); PDFImage image = PDFImage( pdf, image: bytes.buffer.asUint8List(), width: im.width, height: im.height); g.drawImage(image, 100.0, 100.0, 80.0);
To use a TrueType font from a flutter bundle:
var font = await rootBundle.load("assets/open-sans.ttf"); PDFTTFFont ttf = new PDFTTFFont(pdf, font); g.setColor(new PDFColor(0.3, 0.3, 0.3)); g.drawString(ttf, 20.0, "Dart is awesome", 50.0, 30.0);
Flutter example project
to generate the project files, run:
flutter create .
to run the example, start a simulator and run:
Add this to your package's pubspec.yaml file:
dependencies: printing: ^1.0.6
You can install packages from the command line:
$ flutter packages get
Alternatively, your editor might support
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.0.6||Oct 28, 2018|
|1.0.5||Sep 2, 2018|
|1.0.4||Aug 21, 2018|
|1.0.3||Aug 15, 2018|
|1.0.2||Aug 15, 2018|
|1.0.1||Aug 15, 2018|
|1.0.0||Aug 14, 2018|
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
Document public APIs. (-1 points)
5 out of 5 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.